Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c9f3536 authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar
Browse files

x86/cpufeature: Remove cpu_has_hypervisor



Use boot_cpu_has() instead.

Tested-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: sparmaintainer@unisys.com
Cc: virtualization@lists.linux-foundation.org
Link: http://lkml.kernel.org/r/1459266123-21878-3-git-send-email-bp@alien8.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 7b5e74e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1383,7 +1383,7 @@ static int __init intel_uncore_init(void)
	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
		return -ENODEV;
		return -ENODEV;


	if (cpu_has_hypervisor)
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
		return -ENODEV;
		return -ENODEV;


	max_packages = topology_max_packages();
	max_packages = topology_max_packages();
+0 −1
Original line number Original line Diff line number Diff line
@@ -136,7 +136,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
#define cpu_has_xsave		boot_cpu_has(X86_FEATURE_XSAVE)
#define cpu_has_xsave		boot_cpu_has(X86_FEATURE_XSAVE)
#define cpu_has_xsaves		boot_cpu_has(X86_FEATURE_XSAVES)
#define cpu_has_xsaves		boot_cpu_has(X86_FEATURE_XSAVES)
#define cpu_has_osxsave		boot_cpu_has(X86_FEATURE_OSXSAVE)
#define cpu_has_osxsave		boot_cpu_has(X86_FEATURE_OSXSAVE)
#define cpu_has_hypervisor	boot_cpu_has(X86_FEATURE_HYPERVISOR)
/*
/*
 * Do not add any more of those clumsy macros - use static_cpu_has() for
 * Do not add any more of those clumsy macros - use static_cpu_has() for
 * fast paths and boot_cpu_has() otherwise!
 * fast paths and boot_cpu_has() otherwise!
+1 −1
Original line number Original line Diff line number Diff line
@@ -94,7 +94,7 @@ static void __init vmware_platform_setup(void)
 */
 */
static uint32_t __init vmware_platform(void)
static uint32_t __init vmware_platform(void)
{
{
	if (cpu_has_hypervisor) {
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
		unsigned int eax;
		unsigned int eax;
		unsigned int hyper_vendor_id[3];
		unsigned int hyper_vendor_id[3];


+1 −1
Original line number Original line Diff line number Diff line
@@ -522,7 +522,7 @@ static noinline uint32_t __kvm_cpuid_base(void)
	if (boot_cpu_data.cpuid_level < 0)
	if (boot_cpu_data.cpuid_level < 0)
		return 0;	/* So we don't blow up on old processors */
		return 0;	/* So we don't blow up on old processors */


	if (cpu_has_hypervisor)
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
		return hypervisor_cpuid_base("KVMKVMKVM\0\0\0", 0);
		return hypervisor_cpuid_base("KVMKVMKVM\0\0\0", 0);


	return 0;
	return 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -2425,7 +2425,7 @@ static __init uint32_t visorutil_spar_detect(void)
{
{
	unsigned int eax, ebx, ecx, edx;
	unsigned int eax, ebx, ecx, edx;


	if (cpu_has_hypervisor) {
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
		/* check the ID */
		/* check the ID */
		cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
		cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
		return  (ebx == UNISYS_SPAR_ID_EBX) &&
		return  (ebx == UNISYS_SPAR_ID_EBX) &&