[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 09/22] vixen: modify the e820 table to advertise HVM special pages as RAM
From: Anthony Liguori <aliguori@xxxxxxxxxx> In order to be able to assign the Xenstore page into the Vixen guest, we need struct page_info's to exist. We do this by modifying the e820 table early in boot and then using the badpages handling to prevent these pages from being added to the xenheap. Since these pages exist in a somewhat weird state in Xen, we need to relax permission checking too in order to be able to assign them to the guest. Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx> --- xen/arch/x86/e820.c | 6 ++++++ xen/arch/x86/mm.c | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c index 7c572ba..9ee147f 100644 --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -9,6 +9,7 @@ #include <asm/processor.h> #include <asm/mtrr.h> #include <asm/msr.h> +#include <asm/guest/vixen.h> /* * opt_mem: Limit maximum address of physical RAM. @@ -698,6 +699,11 @@ unsigned long __init init_e820(const char *str, struct e820map *raw) print_e820_memory_map(raw->map, raw->nr_map); } + if ( is_vixen() ) + { + /* Pretend that passed through special pages are RAM */ + e820_change_range_type(raw, 0xfeffc000, 0xff000000, E820_RESERVED, E820_RAM); + } machine_specific_memory_setup(raw); printk("%s RAM map:\n", str); diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a56f875..935901b 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -122,6 +122,7 @@ #include <asm/fixmap.h> #include <asm/io_apic.h> #include <asm/pci.h> +#include <asm/guest.h> #include <asm/hvm/grant_table.h> #include <asm/pv/grant_table.h> @@ -945,7 +946,7 @@ get_page_from_l1e( case 0: break; case 1: - if ( !is_hardware_domain(l1e_owner) ) + if ( !is_vixen() && !is_hardware_domain(l1e_owner) ) break; /* fallthrough */ case -1: @@ -5536,6 +5537,21 @@ void arch_dump_shared_mem_info(void) mem_sharing_get_nr_saved_mfns()); } +const unsigned long *__init +vixen_get_platform_badpages(unsigned int *array_size) +{ + static unsigned long __initdata bad_pages[] = { + 0xfeffc000, + 0xfeffd000, + 0xfeffe000, + 0xfefff000, + }; + + *array_size = ARRAY_SIZE(bad_pages); + + return bad_pages; +} + const unsigned long *__init get_platform_badpages(unsigned int *array_size) { u32 igd_id; @@ -5547,6 +5563,9 @@ const unsigned long *__init get_platform_badpages(unsigned int *array_size) 0x40004000, }; + if ( is_vixen() ) + return vixen_get_platform_badpages(array_size); + *array_size = ARRAY_SIZE(bad_pages); igd_id = pci_conf_read32(0, 0, 2, 0, 0); if ( !IS_SNB_GFX(igd_id) ) -- 1.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |