|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I
iomem: Prevent Dom0 pci bus from allocating RAM as I/O space
In Dom0, pci bus dynamically allocates I/O address resources from memory hole
within 4GB physical space, which can be RAM space not allocated to Dom0. This
patch set physical RAM space to be unusable in Dom0 E820 map if they are not
owned by Dom0 to prevent them from being misused as I/O address space. Dom0 is
assumed to look for MMIO space only below 4GB. If this assumption is broken,
additional fixes are required.
Signed-off-by: Fengzhe Zhang <fengzhe.zhang@xxxxxxxxx>
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 1a1934a..f1a3896 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -189,6 +189,16 @@ char * __init xen_memory_setup(void)
end -= delta;
extra_pages += PFN_DOWN(delta);
+
+ /*
+ * Set RAM below 4GB that are not owned by Dom0 to be
unusable.
+ * This prevents RAM-backed address space from being
used as
+ * I/O address in Dom0. Dom0 is assumed to look for MMIO
+ * space only below 4GB. If this assumption is broken,
additional
+ * fixes are required.
+ */
+ if (delta && end < 0x100000000UL)
+ e820_add_region(end, delta, E820_UNUSABLE);
}
if (map[i].size > 0 && end > xen_extra_mem_start)
pci_mem_bug.patch
Description: pci_mem_bug.patch
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|