File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 67
67
#define MAX_AGAW_WIDTH 64
68
68
#define MAX_AGAW_PFN_WIDTH (MAX_AGAW_WIDTH - VTD_PAGE_SHIFT)
69
69
70
- #define __DOMAIN_MAX_PFN (gaw ) ((((uint64_t)1) << (gaw- VTD_PAGE_SHIFT)) - 1)
71
- #define __DOMAIN_MAX_ADDR (gaw ) ((((uint64_t)1) << gaw) - 1)
70
+ #define __DOMAIN_MAX_PFN (gaw ) ((((uint64_t)1) << (( gaw) - VTD_PAGE_SHIFT)) - 1)
71
+ #define __DOMAIN_MAX_ADDR (gaw ) ((((uint64_t)1) << ( gaw) ) - 1)
72
72
73
73
/* We limit DOMAIN_MAX_PFN to fit in an unsigned long, and DOMAIN_MAX_ADDR
74
74
to match. That way, we can use 'unsigned long' for PFNs with impunity. */
@@ -739,6 +739,18 @@ static void domain_update_iommu_cap(struct dmar_domain *domain)
739
739
*/
740
740
if (domain -> nid == NUMA_NO_NODE )
741
741
domain -> nid = domain_update_device_node (domain );
742
+
743
+ /*
744
+ * First-level translation restricts the input-address to a
745
+ * canonical address (i.e., address bits 63:N have the same
746
+ * value as address bit [N-1], where N is 48-bits with 4-level
747
+ * paging and 57-bits with 5-level paging). Hence, skip bit
748
+ * [N-1].
749
+ */
750
+ if (domain_use_first_level (domain ))
751
+ domain -> domain .geometry .aperture_end = __DOMAIN_MAX_ADDR (domain -> gaw - 1 );
752
+ else
753
+ domain -> domain .geometry .aperture_end = __DOMAIN_MAX_ADDR (domain -> gaw );
742
754
}
743
755
744
756
struct context_entry * iommu_context_addr (struct intel_iommu * iommu , u8 bus ,
You can’t perform that action at this time.
0 commit comments