hvmloader: No need to map shared_info page into the legacy VGA MMIO
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 May 2008 09:02:00 +0000 (10:02 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 May 2008 09:02:00 +0000 (10:02 +0100)
hole. We can access address 0xfffff000 from 32-bit protected mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/firmware/hvmloader/util.c

index 37f40ef2fa2ef243be54c8e266e30c2d7452bdbc..c98fd730493c5432c497c78b13e148e3b890d916 100644 (file)
@@ -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;
 }