struct hvm_iommu *hd = domain_hvm_iommu(d);
struct iommu *iommu = NULL;
struct acpi_drhd_unit *drhd;
+ unsigned long max_pfn;
u64 i;
drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
hd->agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
+ if (!iommu_inclusive_mapping)
+ max_pfn = max_page;
+ else
+ max_pfn = max(max_page, (unsigned long)(0x100000000 >> PAGE_SHIFT));
+
if ( d->domain_id == 0 )
{
extern int xen_in_range(paddr_t start, paddr_t end);
* Set up 1:1 page table for dom0 except the critical segments
* like Xen and tboot.
*/
- for ( i = 0; i < max_page; i++ )
+ for ( i = 0; i < max_pfn; i++ )
{
/* Set up 1:1 mapping for dom0 */
if ( !page_is_ram_type(i, RAM_TYPE_CONVENTIONAL) )
if (iommu_inclusive_mapping)
{
/* When set, the inclusive mapping maps in everything below 4GB except unusable ranges */
- if ( (i >= 0x100000) || page_is_ram_type(i, RAM_TYPE_UNUSABLE) )
+ if ( page_is_ram_type(i, RAM_TYPE_UNUSABLE) )
continue;
}
else