]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86: drop hypervisor_cpuid_base
authorWei Liu <liuwe@microsoft.com>
Thu, 19 Sep 2019 14:04:25 +0000 (15:04 +0100)
committerWei Liu <wl@xen.org>
Wed, 4 Dec 2019 10:31:25 +0000 (10:31 +0000)
The only user is Xen specific code in PV shim. We can therefore export
the variable directly.

Move __read_mostly to its standard place while at it.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/guest/xen/xen.c
xen/arch/x86/pv/shim.c
xen/include/asm-x86/guest/xen.h

index a329e7c8865ce9019732fa6e41b08041e10941a9..1e3708651869dfe0026bd3c8b9b474d574661828 100644 (file)
@@ -37,7 +37,7 @@
 
 bool __read_mostly xen_guest;
 
-static __read_mostly uint32_t xen_cpuid_base;
+uint32_t __read_mostly xen_cpuid_base;
 extern char hypercall_page[];
 static struct rangeset *mem;
 
@@ -297,11 +297,6 @@ int hypervisor_free_unused_page(mfn_t mfn)
     return rangeset_remove_range(mem, mfn_x(mfn), mfn_x(mfn));
 }
 
-uint32_t hypervisor_cpuid_base(void)
-{
-    return xen_cpuid_base;
-}
-
 static void ap_resume(void *unused)
 {
     map_vcpuinfo();
index 35bf3945ac40533d435e7bd8f2641e49bce707c9..351da970ef46a7ce64291c69ef323388a6d76558 100644 (file)
@@ -995,7 +995,7 @@ domid_t get_initial_domain_id(void)
     if ( !pv_shim )
         return 0;
 
-    cpuid(hypervisor_cpuid_base() + 4, &eax, &ebx, &ecx, &edx);
+    cpuid(xen_cpuid_base + 4, &eax, &ebx, &ecx, &edx);
 
     return (eax & XEN_HVM_CPUID_DOMID_PRESENT) ? ecx : 1;
 }
index 7e04e4a7ab9ba5b767fb6afbbaa73670876c6c95..b015ed18830bb39d591f6377e008e380ad9572d2 100644 (file)
 
 extern bool xen_guest;
 extern bool pv_console;
+extern uint32_t xen_cpuid_base;
 
 void probe_hypervisor(void);
 void hypervisor_setup(void);
 void hypervisor_ap_setup(void);
 int hypervisor_alloc_unused_page(mfn_t *mfn);
 int hypervisor_free_unused_page(mfn_t mfn);
-uint32_t hypervisor_cpuid_base(void);
 void hypervisor_resume(void);
 
 DECLARE_PER_CPU(unsigned int, vcpu_id);