qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest
@ 2012-02-28  5:15 Liu, Jinsong
  2012-03-06  4:28 ` Liu, Jinsong
  2012-03-08 22:07 ` Marcelo Tosatti
  0 siblings, 2 replies; 3+ messages in thread
From: Liu, Jinsong @ 2012-02-28  5:15 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, kvm; +Cc: Jan Kiszka, qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 2065 bytes --]

>From ecd8be962f69393c183f941bfdbd7a7d3876d442 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Mon, 27 Feb 2012 05:19:32 +0800
Subject: [PATCH] KVM: expose Intel cpu new features to guest

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to guest.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/include/asm/cpufeature.h |    2 ++
 arch/x86/kvm/cpuid.c              |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 17c5d4b..e8d12a8 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -198,10 +198,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
 #define X86_FEATURE_FSGSBASE	(9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/
 #define X86_FEATURE_BMI1	(9*32+ 3) /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE		(9*32+ 4) /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2	(9*32+ 5) /* AVX2 instructions */
 #define X86_FEATURE_SMEP	(9*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2	(9*32+ 8) /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS	(9*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_RTM		(9*32+11) /* Restricted Transactional Memory */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 9fed5be..c2134b8 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -247,7 +247,8 @@ static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 
 	/* cpuid 7.0.ebx */
 	const u32 kvm_supported_word9_x86_features =
-		F(FSGSBASE) | F(BMI1) | F(AVX2) | F(SMEP) | F(BMI2) | F(ERMS);
+		F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
+		F(BMI2) | F(ERMS) | F(RTM);
 
 	/* all calls to cpuid_count() should be made on the same cpu */
 	get_cpu();
-- 
1.7.1

[-- Attachment #2: 0001-KVM-expose-Intel-cpu-new-features-to-guest.patch --]
[-- Type: application/octet-stream, Size: 2017 bytes --]

From ecd8be962f69393c183f941bfdbd7a7d3876d442 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Mon, 27 Feb 2012 05:19:32 +0800
Subject: [PATCH] KVM: expose Intel cpu new features to guest

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to guest.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/include/asm/cpufeature.h |    2 ++
 arch/x86/kvm/cpuid.c              |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 17c5d4b..e8d12a8 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -198,10 +198,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
 #define X86_FEATURE_FSGSBASE	(9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/
 #define X86_FEATURE_BMI1	(9*32+ 3) /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE		(9*32+ 4) /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2	(9*32+ 5) /* AVX2 instructions */
 #define X86_FEATURE_SMEP	(9*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2	(9*32+ 8) /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS	(9*32+ 9) /* Enhanced REP MOVSB/STOSB */
+#define X86_FEATURE_RTM		(9*32+11) /* Restricted Transactional Memory */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 9fed5be..c2134b8 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -247,7 +247,8 @@ static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 
 	/* cpuid 7.0.ebx */
 	const u32 kvm_supported_word9_x86_features =
-		F(FSGSBASE) | F(BMI1) | F(AVX2) | F(SMEP) | F(BMI2) | F(ERMS);
+		F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
+		F(BMI2) | F(ERMS) | F(RTM);
 
 	/* all calls to cpuid_count() should be made on the same cpu */
 	get_cpu();
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest
  2012-02-28  5:15 [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest Liu, Jinsong
@ 2012-03-06  4:28 ` Liu, Jinsong
  2012-03-08 22:07 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Liu, Jinsong @ 2012-03-06  4:28 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, kvm; +Cc: Jan Kiszka, qemu-devel@nongnu.org

Avi,

Any comments?

Thanks,
Jinsong

Liu, Jinsong wrote:
> From ecd8be962f69393c183f941bfdbd7a7d3876d442 Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Mon, 27 Feb 2012 05:19:32 +0800
> Subject: [PATCH] KVM: expose Intel cpu new features to guest
> 
> Intel recently release 2 new features, HLE and TRM.
> Refer to http://software.intel.com/file/41417.
> This patch expose them to guest.
> 
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  arch/x86/include/asm/cpufeature.h |    2 ++
>  arch/x86/kvm/cpuid.c              |    3 ++-
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/include/asm/cpufeature.h
> b/arch/x86/include/asm/cpufeature.h 
> index 17c5d4b..e8d12a8 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -198,10 +198,12 @@
>  /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word
>  9 */ #define X86_FEATURE_FSGSBASE	(9*32+ 0) /* {RD/WR}{FS/GS}BASE
>  instructions*/ #define X86_FEATURE_BMI1	(9*32+ 3) /* 1st group bit
> manipulation extensions */ +#define X86_FEATURE_HLE		(9*32+ 4) /*
>  Hardware Lock Elision */ #define X86_FEATURE_AVX2	(9*32+ 5) /* AVX2
>  instructions */ #define X86_FEATURE_SMEP	(9*32+ 7) /* Supervisor
>  Mode Execution Protection */ #define X86_FEATURE_BMI2	(9*32+ 8) /*
>  2nd group bit manipulation extensions */ #define
> X86_FEATURE_ERMS	(9*32+ 9) /* Enhanced REP MOVSB/STOSB */ +#define
> X86_FEATURE_RTM		(9*32+11) /* Restricted Transactional Memory */ 
> 
>  #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 9fed5be..c2134b8 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -247,7 +247,8 @@ static int do_cpuid_ent(struct kvm_cpuid_entry2
> *entry, u32 function, 
> 
>  	/* cpuid 7.0.ebx */
>  	const u32 kvm_supported_word9_x86_features =
> -		F(FSGSBASE) | F(BMI1) | F(AVX2) | F(SMEP) | F(BMI2) | F(ERMS);
> +		F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
> +		F(BMI2) | F(ERMS) | F(RTM);
> 
>  	/* all calls to cpuid_count() should be made on the same cpu */
>  	get_cpu();

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest
  2012-02-28  5:15 [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest Liu, Jinsong
  2012-03-06  4:28 ` Liu, Jinsong
@ 2012-03-08 22:07 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2012-03-08 22:07 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Jan Kiszka, Avi Kivity, kvm, qemu-devel@nongnu.org

On Tue, Feb 28, 2012 at 05:15:46AM +0000, Liu, Jinsong wrote:
> >From ecd8be962f69393c183f941bfdbd7a7d3876d442 Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Mon, 27 Feb 2012 05:19:32 +0800
> Subject: [PATCH] KVM: expose Intel cpu new features to guest
> 
> Intel recently release 2 new features, HLE and TRM.
> Refer to http://software.intel.com/file/41417.
> This patch expose them to guest.
> 
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  arch/x86/include/asm/cpufeature.h |    2 ++
>  arch/x86/kvm/cpuid.c              |    3 ++-
>  2 files changed, 4 insertions(+), 1 deletions(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-08 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28  5:15 [Qemu-devel] [PATCH] KVM: expose Intel cpu new features to guest Liu, Jinsong
2012-03-06  4:28 ` Liu, Jinsong
2012-03-08 22:07 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).