|
25 | 25 |
|
26 | 26 | #include <asm/cacheflush.h>
|
27 | 27 | #include <asm/iommu.h>
|
| 28 | +#include <uapi/linux/iommufd.h> |
28 | 29 |
|
29 | 30 | /*
|
30 | 31 | * VT-d hardware uses 4KiB page size regardless of host page size.
|
@@ -605,15 +606,38 @@ struct dmar_domain {
|
605 | 606 | struct list_head devices; /* all devices' list */
|
606 | 607 | struct list_head dev_pasids; /* all attached pasids */
|
607 | 608 |
|
608 |
| - struct dma_pte *pgd; /* virtual address */ |
609 |
| - int gaw; /* max guest address width */ |
610 |
| - |
611 |
| - /* adjusted guest address width, 0 is level 2 30-bit */ |
612 |
| - int agaw; |
613 | 609 | int iommu_superpage;/* Level of superpages supported:
|
614 | 610 | 0 == 4KiB (no superpages), 1 == 2MiB,
|
615 | 611 | 2 == 1GiB, 3 == 512GiB, 4 == 1TiB */
|
616 |
| - u64 max_addr; /* maximum mapped address */ |
| 612 | + union { |
| 613 | + /* DMA remapping domain */ |
| 614 | + struct { |
| 615 | + /* virtual address */ |
| 616 | + struct dma_pte *pgd; |
| 617 | + /* max guest address width */ |
| 618 | + int gaw; |
| 619 | + /* |
| 620 | + * adjusted guest address width: |
| 621 | + * 0: level 2 30-bit |
| 622 | + * 1: level 3 39-bit |
| 623 | + * 2: level 4 48-bit |
| 624 | + * 3: level 5 57-bit |
| 625 | + */ |
| 626 | + int agaw; |
| 627 | + /* maximum mapped address */ |
| 628 | + u64 max_addr; |
| 629 | + }; |
| 630 | + |
| 631 | + /* Nested user domain */ |
| 632 | + struct { |
| 633 | + /* parent page table which the user domain is nested on */ |
| 634 | + struct dmar_domain *s2_domain; |
| 635 | + /* user page table pointer (in GPA) */ |
| 636 | + unsigned long s1_pgtbl; |
| 637 | + /* page table attributes */ |
| 638 | + struct iommu_hwpt_vtd_s1 s1_cfg; |
| 639 | + }; |
| 640 | + }; |
617 | 641 |
|
618 | 642 | struct iommu_domain domain; /* generic domain data structure for
|
619 | 643 | iommu core */
|
|
0 commit comments