Commit c28cac1
committed
iommufd: Support pasid attach/replace
JIRA: https://issues.redhat.com/browse/RHEL-114131
Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
commit 2fb69c6
Author: Yi Liu <yi.l.liu@intel.com>
Date: Fri Mar 21 10:19:33 2025 -0700
iommufd: Support pasid attach/replace
This extends the below APIs to support PASID. Device drivers to manage pasid
attach/replace/detach.
int iommufd_device_attach(struct iommufd_device *idev,
ioasid_t pasid, u32 *pt_id);
int iommufd_device_replace(struct iommufd_device *idev,
ioasid_t pasid, u32 *pt_id);
void iommufd_device_detach(struct iommufd_device *idev,
ioasid_t pasid);
The pasid operations share underlying attach/replace/detach infrastructure
with the device operations, but still have some different implications:
- no reserved region per pasid otherwise SVA architecture is already
broken (CPU address space doesn't count device reserved regions);
- accordingly no sw_msi trick;
Cache coherency enforcement is still applied to pasid operations since
it is about memory accesses post page table walking (no matter the walk
is per RID or per PASID).
Link: https://patch.msgid.link/r/20250321171940.7213-12-yi.l.liu@intel.com
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
(cherry picked from commit 2fb69c6)
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>1 parent cabb194 commit c28cac1
File tree
4 files changed
+53
-33
lines changed- drivers
- iommu/iommufd
- vfio
- include/linux
4 files changed
+53
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
433 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
| |||
464 | 467 | | |
465 | 468 | | |
466 | 469 | | |
467 | | - | |
468 | | - | |
469 | 470 | | |
470 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
471 | 476 | | |
472 | 477 | | |
473 | 478 | | |
| |||
483 | 488 | | |
484 | 489 | | |
485 | 490 | | |
486 | | - | |
487 | | - | |
488 | 491 | | |
489 | 492 | | |
490 | 493 | | |
| |||
502 | 505 | | |
503 | 506 | | |
504 | 507 | | |
505 | | - | |
506 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
507 | 514 | | |
508 | 515 | | |
509 | 516 | | |
| |||
904 | 911 | | |
905 | 912 | | |
906 | 913 | | |
907 | | - | |
| 914 | + | |
908 | 915 | | |
| 916 | + | |
909 | 917 | | |
910 | 918 | | |
911 | 919 | | |
912 | | - | |
913 | | - | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
914 | 923 | | |
915 | 924 | | |
916 | 925 | | |
917 | 926 | | |
918 | | - | |
| 927 | + | |
| 928 | + | |
919 | 929 | | |
920 | 930 | | |
921 | 931 | | |
922 | | - | |
| 932 | + | |
923 | 933 | | |
924 | 934 | | |
925 | 935 | | |
| |||
934 | 944 | | |
935 | 945 | | |
936 | 946 | | |
937 | | - | |
| 947 | + | |
938 | 948 | | |
| 949 | + | |
939 | 950 | | |
940 | 951 | | |
941 | 952 | | |
| |||
946 | 957 | | |
947 | 958 | | |
948 | 959 | | |
949 | | - | |
| 960 | + | |
| 961 | + | |
950 | 962 | | |
951 | | - | |
| 963 | + | |
| 964 | + | |
952 | 965 | | |
953 | | - | |
| 966 | + | |
954 | 967 | | |
955 | 968 | | |
956 | 969 | | |
957 | 970 | | |
958 | 971 | | |
959 | | - | |
| 972 | + | |
960 | 973 | | |
| 974 | + | |
961 | 975 | | |
962 | 976 | | |
963 | 977 | | |
| 978 | + | |
964 | 979 | | |
965 | | - | |
| 980 | + | |
966 | 981 | | |
967 | 982 | | |
968 | 983 | | |
969 | | - | |
| 984 | + | |
970 | 985 | | |
971 | 986 | | |
972 | 987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
| 948 | + | |
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
| 963 | + | |
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
| 997 | + | |
998 | 998 | | |
999 | 999 | | |
1000 | 1000 | | |
| |||
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
1658 | | - | |
| 1658 | + | |
1659 | 1659 | | |
1660 | 1660 | | |
1661 | 1661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | | - | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
0 commit comments