From: Keir Fraser Date: Wed, 28 May 2008 09:02:00 +0000 (+0100) Subject: hvmloader: No need to map shared_info page into the legacy VGA MMIO X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14207^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cc8cdb7e4735bfd5433820fa714f43c9afafbe4a;p=xen.git hvmloader: No need to map shared_info page into the legacy VGA MMIO hole. We can access address 0xfffff000 from 32-bit protected mode. Signed-off-by: Keir Fraser --- diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c index 37f40ef2fa..c98fd73049 100644 --- a/tools/firmware/hvmloader/util.c +++ b/tools/firmware/hvmloader/util.c @@ -609,7 +609,7 @@ int get_apic_mode(void) uint16_t get_cpu_mhz(void) { struct xen_add_to_physmap xatp; - struct shared_info *shared_info = (struct shared_info *)0xa0000; + struct shared_info *shared_info = (struct shared_info *)0xfffff000; struct vcpu_time_info *info = &shared_info->vcpu_info[0].time; uint64_t cpu_khz; uint32_t tsc_to_nsec_mul, version; @@ -619,7 +619,7 @@ uint16_t get_cpu_mhz(void) if ( cpu_mhz != 0 ) return cpu_mhz; - /* Map shared-info page to 0xa0000 (i.e., overlap VGA hole). */ + /* Map shared-info page. */ xatp.domid = DOMID_SELF; xatp.space = XENMAPSPACE_shared_info; xatp.idx = 0; @@ -644,14 +644,6 @@ uint16_t get_cpu_mhz(void) else cpu_khz = cpu_khz >> tsc_shift; - /* Get the VGA MMIO hole back by remapping shared info to scratch. */ - xatp.domid = DOMID_SELF; - xatp.space = XENMAPSPACE_shared_info; - xatp.idx = 0; - xatp.gpfn = 0xfffff; /* scratch pfn */ - if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 ) - BUG(); - cpu_mhz = (uint16_t)(((uint32_t)cpu_khz + 500) / 1000); return cpu_mhz; }