Commit b92bea9
vfio/pci: Add dma-buf export support for MMIO regions
Add support for exporting PCI device MMIO regions through dma-buf,
enabling safe sharing of non-struct page memory with controlled
lifetime management. This allows RDMA and other subsystems to import
dma-buf FDs and build them into memory regions for PCI P2P operations.
The implementation provides a revocable attachment mechanism using
dma-buf move operations. MMIO regions are normally pinned as BARs
don't change physical addresses, but access is revoked when the VFIO
device is closed or a PCI reset is issued. This ensures kernel
self-defense against potentially hostile userspace.
Signed-off-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>1 parent 3b22a62 commit b92bea9
File tree
9 files changed
+431
-5
lines changed- drivers/vfio/pci
- include
- linux
- uapi/linux
9 files changed
+431
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
58 | 78 | | |
59 | 79 | | |
60 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
593 | 593 | | |
594 | | - | |
| 594 | + | |
| 595 | + | |
595 | 596 | | |
| 597 | + | |
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| |||
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| 632 | + | |
| 633 | + | |
630 | 634 | | |
631 | 635 | | |
632 | 636 | | |
| |||
707 | 711 | | |
708 | 712 | | |
709 | 713 | | |
710 | | - | |
| 714 | + | |
711 | 715 | | |
712 | | - | |
| 716 | + | |
| 717 | + | |
713 | 718 | | |
| 719 | + | |
714 | 720 | | |
715 | 721 | | |
| 722 | + | |
| 723 | + | |
716 | 724 | | |
717 | 725 | | |
718 | 726 | | |
| |||
900 | 908 | | |
901 | 909 | | |
902 | 910 | | |
| 911 | + | |
903 | 912 | | |
| 913 | + | |
| 914 | + | |
904 | 915 | | |
905 | 916 | | |
906 | 917 | | |
| |||
982 | 993 | | |
983 | 994 | | |
984 | 995 | | |
| 996 | + | |
985 | 997 | | |
| 998 | + | |
| 999 | + | |
986 | 1000 | | |
987 | 1001 | | |
988 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
| 293 | + | |
| 294 | + | |
291 | 295 | | |
292 | 296 | | |
293 | 297 | | |
| |||
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
| 378 | + | |
| 379 | + | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| |||
691 | 697 | | |
692 | 698 | | |
693 | 699 | | |
| 700 | + | |
| 701 | + | |
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
| |||
1223 | 1231 | | |
1224 | 1232 | | |
1225 | 1233 | | |
| 1234 | + | |
1226 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
1227 | 1238 | | |
1228 | 1239 | | |
1229 | 1240 | | |
| |||
1512 | 1523 | | |
1513 | 1524 | | |
1514 | 1525 | | |
| 1526 | + | |
| 1527 | + | |
1515 | 1528 | | |
1516 | 1529 | | |
1517 | 1530 | | |
| |||
2088 | 2101 | | |
2089 | 2102 | | |
2090 | 2103 | | |
| 2104 | + | |
2091 | 2105 | | |
2092 | 2106 | | |
2093 | 2107 | | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2094 | 2111 | | |
2095 | 2112 | | |
2096 | 2113 | | |
| |||
2473 | 2490 | | |
2474 | 2491 | | |
2475 | 2492 | | |
2476 | | - | |
| 2493 | + | |
| 2494 | + | |
2477 | 2495 | | |
| 2496 | + | |
2478 | 2497 | | |
2479 | 2498 | | |
2480 | 2499 | | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2481 | 2504 | | |
2482 | 2505 | | |
2483 | 2506 | | |
| |||
0 commit comments