Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jason Wang and committed by
H. Peter Anvin
448ac44d 96e39ac0

+1 -15
+1 -15
arch/x86/include/asm/xen/hypervisor.h
··· 40 40 41 41 static inline uint32_t xen_cpuid_base(void) 42 42 { 43 - uint32_t base, eax, ebx, ecx, edx; 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; 43 + return hypervisor_cpuid_base("XenVMMXenVMM", 2); 58 44 } 59 45 60 46 #ifdef CONFIG_XEN