return -EFAULT;
}
+#ifdef CONFIG_X86
+ /* This check is here simply to detect when RMRR values are not properly represented in the
+ system memory map. This check can be extended to IA64 if the page_is_ram_type() function
+ is updated to properly report what are reserved memory ranges */
+ if ( (!page_is_ram_type(paddr_to_pfn(rmrr->base_address), RAM_TYPE_RESERVED))||
+ (!page_is_ram_type(paddr_to_pfn(rmrr->end_address) - 1, RAM_TYPE_RESERVED)) )
+ {
+ dprintk(XENLOG_WARNING VTDPREFIX,
+ "RMRR address range not in reserved memory base = %"PRIx64" end = %"PRIx64"; " \
+ "iommu_include_reserved parameter may be needed\n",
+ rmrr->base_address, rmrr->end_address);
+ }
+#endif
+
rmrru = xmalloc(struct acpi_rmrr_unit);
if ( !rmrru )
return -ENOMEM;
static int domid_bitmap_size; /* domain id bitmap size in bits */
static unsigned long *domid_bitmap; /* iommu domain id bitmap */
+/* iommu_include_reserved: include reserved memory ranges in dom0 1-1 iommu mappings if set */
+static int iommu_include_reserved = 0;
+boolean_param("iommu_include_reserved", iommu_include_reserved);
+
static void setup_dom0_devices(struct domain *d);
static void setup_dom0_rmrr(struct domain *d);
{
struct hvm_iommu *hd = domain_hvm_iommu(d);
struct iommu *iommu = NULL;
- u64 i;
struct acpi_drhd_unit *drhd;
+ u64 i;
+ u32 mem_type;
drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
iommu = drhd->iommu;
{
extern int xen_in_range(paddr_t start, paddr_t end);
+ /* input param overrides default memory mapping */
+ mem_type = RAM_TYPE_CONVENTIONAL;
+ if (iommu_include_reserved)
+ mem_type |= RAM_TYPE_RESERVED;
+
/*
* Set up 1:1 page table for dom0 except the critical segments
* like Xen and tboot.
{
/* CS 19084 remove tboot_in_range, CS 19085 use page_is_conventional_ram */
/* Modified to include reserved memory regions - this fix will be pushed upstream */
- if ( !page_is_ram_type(i, RAM_TYPE_CONVENTIONAL|RAM_TYPE_RESERVED) ||
+ if ( !page_is_ram_type(i, mem_type) ||
xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
continue;