aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-07-25 04:54:33 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-08-05 09:34:09 -0400
commit448ac44d561f0aba5baac54bac62fe40d07230b6 (patch)
tree74fc1954e449654b6c0155a4116378b9a30aa844 /arch/x86
parent96e39ac0e9d18020c8c5a41b64b8fe86c26575ab (diff)
xen: Switch to use hypervisor_cpuid_base()
Switch to use hypervisor_cpuid_base() to detect Xen. Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Link: http://lkml.kernel.org/r/1374742475-2485-2-git-send-email-jasowang@redhat.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/xen/hypervisor.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
index 125f344f06a9..d866959e5685 100644
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -40,21 +40,7 @@ extern struct start_info *xen_start_info;
40 40
41static inline uint32_t xen_cpuid_base(void) 41static inline uint32_t xen_cpuid_base(void)
42{ 42{
43 uint32_t base, eax, ebx, ecx, edx; 43 return hypervisor_cpuid_base("XenVMMXenVMM", 2);
44 char signature[13];
45
46 for (base = 0x40000000; base < 0x40010000; base += 0x100) {
47 cpuid(base, &eax, &ebx, &ecx, &edx);
48 *(uint32_t *)(signature + 0) = ebx;
49 *(uint32_t *)(signature + 4) = ecx;
50 *(uint32_t *)(signature + 8) = edx;
51 signature[12] = 0;
52
53 if (!strcmp("XenVMMXenVMM", signature) && ((eax - base) >= 2))
54 return base;
55 }
56
57 return 0;
58} 44}
59 45
60#ifdef CONFIG_XEN 46#ifdef CONFIG_XEN