Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1366396 > unrolled thread

[PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor

Started byBorislav Petkov <bp@alien8.de>
First post2016-03-29 17:50 +0200
Last post2016-04-01 10:00 +0200
Articles 5 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor Borislav Petkov <bp@alien8.de> - 2016-03-29 17:50 +0200
    RE: [PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor "Kershner, David A" <David.Kershner@unisys.com> - 2016-03-29 20:10 +0200
    [tip:x86/cpu] x86/cpufeature: Remove cpu_has_hypervisor tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-03-31 15:10 +0200
    [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge  artifact with the removal of cpu_has_hypervisor tip-bot for Ingo Molnar <tipbot@zytor.com> - 2016-04-01 09:50 +0200
      Re: [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge  artifact with the removal of cpu_has_hypervisor Borislav Petkov <bp@suse.de> - 2016-04-01 10:00 +0200

#1366396 — [PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor

FromBorislav Petkov <bp@alien8.de>
Date2016-03-29 17:50 +0200
Subject[PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor
Message-ID<ri441-8nF-1@gated-at.bofh.it>
From: Borislav Petkov <bp@suse.de>

Use boot_cpu_has() instead.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: virtualization@lists.linux-foundation.org
Cc: sparmaintainer@unisys.com
---
 arch/x86/events/intel/cstate.c                 | 2 +-
 arch/x86/events/intel/uncore.c                 | 2 +-
 arch/x86/include/asm/cpufeature.h              | 1 -
 arch/x86/kernel/cpu/vmware.c                   | 2 +-
 arch/x86/kernel/kvm.c                          | 2 +-
 drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
 6 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 7946c4231169..d5045c8e2e63 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -677,7 +677,7 @@ static int __init cstate_pmu_init(void)
 {
 	int err;
 
-	if (cpu_has_hypervisor)
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		return -ENODEV;
 
 	err = cstate_init();
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 7012d18bb293..3f6d8b5672d5 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -1383,7 +1383,7 @@ static int __init intel_uncore_init(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
 		return -ENODEV;
 
-	if (cpu_has_hypervisor)
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		return -ENODEV;
 
 	max_packages = topology_max_packages();
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index fee7a6efcd2d..3aea54ecabfd 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -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_xsaves		boot_cpu_has(X86_FEATURE_XSAVES)
 #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
  * fast paths and boot_cpu_has() otherwise!
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 364e58346897..8cac429b6a1d 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -94,7 +94,7 @@ static void __init vmware_platform_setup(void)
  */
 static uint32_t __init vmware_platform(void)
 {
-	if (cpu_has_hypervisor) {
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
 		unsigned int eax;
 		unsigned int hyper_vendor_id[3];
 
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 807950860fb7..dc1207e2f193 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -522,7 +522,7 @@ static noinline uint32_t __kvm_cpuid_base(void)
 	if (boot_cpu_data.cpuid_level < 0)
 		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 0;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 5fbda7b218c7..9cf4f8463c4e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -2425,7 +2425,7 @@ static __init uint32_t visorutil_spar_detect(void)
 {
 	unsigned int eax, ebx, ecx, edx;
 
-	if (cpu_has_hypervisor) {
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
 		/* check the ID */
 		cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
 		return  (ebx == UNISYS_SPAR_ID_EBX) &&
-- 
2.7.3

[toc] | [next] | [standalone]


#1366522

From"Kershner, David A" <David.Kershner@unisys.com>
Date2016-03-29 20:10 +0200
Message-ID<ri6fw-1xx-11@gated-at.bofh.it>
In reply to#1366396
> -----Original Message-----
> From: Borislav Petkov [mailto:bp@alien8.de]
> Sent: Tuesday, March 29, 2016 11:42 AM
> To: X86 ML <x86@kernel.org>
> Cc: LKML <linux-kernel@vger.kernel.org>; virtualization@lists.linux-
> foundation.org; *S-Par-Maintainer <SParMaintainer@unisys.com>
> Subject: [PATCH 02/10] x86/cpufeature: Kill cpu_has_hypervisor
> 
> From: Borislav Petkov <bp@suse.de>
> 
> Use boot_cpu_has() instead.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>

Tested-by: David Kershner <david.kershner@unisys.com>

> Cc: virtualization@lists.linux-foundation.org
> Cc: sparmaintainer@unisys.com
> ---
>  arch/x86/events/intel/cstate.c                 | 2 +-
>  arch/x86/events/intel/uncore.c                 | 2 +-
>  arch/x86/include/asm/cpufeature.h              | 1 -
>  arch/x86/kernel/cpu/vmware.c                   | 2 +-
>  arch/x86/kernel/kvm.c                          | 2 +-
>  drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
>  6 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
> index 7946c4231169..d5045c8e2e63 100644
> --- a/arch/x86/events/intel/cstate.c
> +++ b/arch/x86/events/intel/cstate.c
> @@ -677,7 +677,7 @@ static int __init cstate_pmu_init(void)
>  {
>  	int err;
> 
> -	if (cpu_has_hypervisor)
> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
>  		return -ENODEV;
> 
>  	err = cstate_init();
> diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
> index 7012d18bb293..3f6d8b5672d5 100644
> --- a/arch/x86/events/intel/uncore.c
> +++ b/arch/x86/events/intel/uncore.c
> @@ -1383,7 +1383,7 @@ static int __init intel_uncore_init(void)
>  	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
>  		return -ENODEV;
> 
> -	if (cpu_has_hypervisor)
> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
>  		return -ENODEV;
> 
>  	max_packages = topology_max_packages();
> diff --git a/arch/x86/include/asm/cpufeature.h
> b/arch/x86/include/asm/cpufeature.h
> index fee7a6efcd2d..3aea54ecabfd 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -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_xsaves
> 	boot_cpu_has(X86_FEATURE_XSAVES)
>  #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
>   * fast paths and boot_cpu_has() otherwise!
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index 364e58346897..8cac429b6a1d 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -94,7 +94,7 @@ static void __init vmware_platform_setup(void)
>   */
>  static uint32_t __init vmware_platform(void)
>  {
> -	if (cpu_has_hypervisor) {
> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
>  		unsigned int eax;
>  		unsigned int hyper_vendor_id[3];
> 
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 807950860fb7..dc1207e2f193 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -522,7 +522,7 @@ static noinline uint32_t __kvm_cpuid_base(void)
>  	if (boot_cpu_data.cpuid_level < 0)
>  		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 0;
> diff --git a/drivers/staging/unisys/visorbus/visorchipset.c
> b/drivers/staging/unisys/visorbus/visorchipset.c
> index 5fbda7b218c7..9cf4f8463c4e 100644
> --- a/drivers/staging/unisys/visorbus/visorchipset.c
> +++ b/drivers/staging/unisys/visorbus/visorchipset.c
> @@ -2425,7 +2425,7 @@ static __init uint32_t visorutil_spar_detect(void)
>  {
>  	unsigned int eax, ebx, ecx, edx;
> 
> -	if (cpu_has_hypervisor) {
> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
>  		/* check the ID */
>  		cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
>  		return  (ebx == UNISYS_SPAR_ID_EBX) &&
> --
> 2.7.3

[toc] | [prev] | [next] | [standalone]


#1368284 — [tip:x86/cpu] x86/cpufeature: Remove cpu_has_hypervisor

Fromtip-bot for Borislav Petkov <tipbot@zytor.com>
Date2016-03-31 15:10 +0200
Subject[tip:x86/cpu] x86/cpufeature: Remove cpu_has_hypervisor
Message-ID<riKwi-5yc-25@gated-at.bofh.it>
In reply to#1366396
Commit-ID:  0c9f3536cc712dfd5ec3127d55cd7b807cc0adb5
Gitweb:     http://git.kernel.org/tip/0c9f3536cc712dfd5ec3127d55cd7b807cc0adb5
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 29 Mar 2016 17:41:55 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 31 Mar 2016 13:35:07 +0200

x86/cpufeature: Remove cpu_has_hypervisor

Use boot_cpu_has() instead.

Tested-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Borislav 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: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/events/intel/uncore.c                 | 2 +-
 arch/x86/include/asm/cpufeature.h              | 1 -
 arch/x86/kernel/cpu/vmware.c                   | 2 +-
 arch/x86/kernel/kvm.c                          | 2 +-
 drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 7012d18..3f6d8b5 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -1383,7 +1383,7 @@ static int __init intel_uncore_init(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
 		return -ENODEV;
 
-	if (cpu_has_hypervisor)
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		return -ENODEV;
 
 	max_packages = topology_max_packages();
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index fee7a6e..3aea54e 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -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_xsaves		boot_cpu_has(X86_FEATURE_XSAVES)
 #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
  * fast paths and boot_cpu_has() otherwise!
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 364e583..8cac429 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -94,7 +94,7 @@ static void __init vmware_platform_setup(void)
  */
 static uint32_t __init vmware_platform(void)
 {
-	if (cpu_has_hypervisor) {
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
 		unsigned int eax;
 		unsigned int hyper_vendor_id[3];
 
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 8079508..dc1207e 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -522,7 +522,7 @@ static noinline uint32_t __kvm_cpuid_base(void)
 	if (boot_cpu_data.cpuid_level < 0)
 		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 0;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 5fbda7b..9cf4f84 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -2425,7 +2425,7 @@ static __init uint32_t visorutil_spar_detect(void)
 {
 	unsigned int eax, ebx, ecx, edx;
 
-	if (cpu_has_hypervisor) {
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
 		/* check the ID */
 		cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
 		return  (ebx == UNISYS_SPAR_ID_EBX) &&

[toc] | [prev] | [next] | [standalone]


#1369069 — [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor

Fromtip-bot for Ingo Molnar <tipbot@zytor.com>
Date2016-04-01 09:50 +0200
Subject[tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor
Message-ID<rj20a-189-11@gated-at.bofh.it>
In reply to#1366396
Commit-ID:  d7847a7017b2a2759dd5590c0cffdbdf2994918e
Gitweb:     http://git.kernel.org/tip/d7847a7017b2a2759dd5590c0cffdbdf2994918e
Author:     Ingo Molnar <mingo@kernel.org>
AuthorDate: Fri, 1 Apr 2016 09:00:35 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 1 Apr 2016 09:03:27 +0200

x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor

The 0-day build robot by Fengguang Wu reported a build failure:

   arch/x86/events//intel/cstate.c: In function 'cstate_pmu_init':
   arch/x86/events//intel/cstate.c:680:6: error: 'cpu_has_hypervisor' undeclared (first use in this function)

... which was caused by a merge mistake I made when applying
the following patch:

  0c9f3536cc71 ("x86/cpufeature: Remove cpu_has_hypervisor")

apply the missing hunk as well.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: David Kershner <david.kershner@unisys.com>
Cc: Borislav 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: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/events/intel/cstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 7946c42..d5045c8 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -677,7 +677,7 @@ static int __init cstate_pmu_init(void)
 {
 	int err;
 
-	if (cpu_has_hypervisor)
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		return -ENODEV;
 
 	err = cstate_init();

[toc] | [prev] | [next] | [standalone]


#1369082 — Re: [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor

FromBorislav Petkov <bp@suse.de>
Date2016-04-01 10:00 +0200
SubjectRe: [tip:x86/cpu] x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor
Message-ID<rj29R-1bH-43@gated-at.bofh.it>
In reply to#1369069
On Fri, Apr 01, 2016 at 12:40:27AM -0700, tip-bot for Ingo Molnar wrote:
> Commit-ID:  d7847a7017b2a2759dd5590c0cffdbdf2994918e
> Gitweb:     http://git.kernel.org/tip/d7847a7017b2a2759dd5590c0cffdbdf2994918e
> Author:     Ingo Molnar <mingo@kernel.org>
> AuthorDate: Fri, 1 Apr 2016 09:00:35 +0200
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Fri, 1 Apr 2016 09:03:27 +0200
> 
> x86/cpufeature: Fix build bug caused by merge artifact with the removal of cpu_has_hypervisor
> 
> The 0-day build robot by Fengguang Wu reported a build failure:
> 
>    arch/x86/events//intel/cstate.c: In function 'cstate_pmu_init':
>    arch/x86/events//intel/cstate.c:680:6: error: 'cpu_has_hypervisor' undeclared (first use in this function)
> 
> ... which was caused by a merge mistake I made when applying
> the following patch:
> 
>   0c9f3536cc71 ("x86/cpufeature: Remove cpu_has_hypervisor")
> 
> apply the missing hunk as well.
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Cc: David Kershner <david.kershner@unisys.com>
> Cc: Borislav 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: Ingo Molnar <mingo@kernel.org>
> ---
>  arch/x86/events/intel/cstate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
> index 7946c42..d5045c8 100644
> --- a/arch/x86/events/intel/cstate.c
> +++ b/arch/x86/events/intel/cstate.c
> @@ -677,7 +677,7 @@ static int __init cstate_pmu_init(void)
>  {
>  	int err;
>  
> -	if (cpu_has_hypervisor)
> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
>  		return -ENODEV;
>  
>  	err = cstate_init();

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web