Skip to contentSkip to conversation

x86: Print AMD virtualization features in /proc/cpuinfo

PATCH In review Joerg Roedel 2 participants 4 messages Dec 14, 2009 – Feb 14, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Print AMD virtualization features in /proc/cpuinfo

This patch adds code to cpu initialization path to detect the extended virtualization features of AMD cpus to show them in /proc/cpuinfo.

---
 arch/x86/include/asm/cpufeature.h          |    4 ++++
 arch/x86/kernel/cpu/addon_cpuid_features.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpufeature.h +4 -0
index 613700f..7dbc1c2 100644
@@ -167,6 +167,10 @@
 #define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
 #define X86_FEATURE_EPT         (8*32+ 3) /* Intel Extended Page Table */
 #define X86_FEATURE_VPID        (8*32+ 4) /* Intel Virtual Processor ID */
+#define X86_FEATURE_NPT		(8*32+5)  /* AMD Nested Page Table support */
+#define X86_FEATURE_LBRV	(8*32+6)  /* AMD LBR Virtualization support */
+#define X86_FEATURE_SVML	(8*32+7)  /* "svm_lock" AMD SVM locking MSR */
+#define X86_FEATURE_NRIPS	(8*32+8)  /* "nrip_save" AMD SVM next_rip save */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
arch/x86/kernel/cpu/addon_cpuid_features.c +4 -0
index 468489b..97ad79c 100644
@@ -32,6 +32,10 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
 		{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
 		{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_NPT,   CR_EDX, 0, 0x8000000a },
+		{ X86_FEATURE_LBRV,  CR_EDX, 1, 0x8000000a },
+		{ X86_FEATURE_SVML,  CR_EDX, 2, 0x8000000a },
+		{ X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a },
 		{ 0, 0, 0, 0 }
 	};
 
Signature · 1 line
1.6.5.4
#1 lore raw

Are there any problems with this patch or was it just forgotten :-) Please let me know.

Joerg

Quoted 43 lines · Joerg Roedel

This patch adds code to cpu initialization path to detect the extended virtualization features of AMD cpus to show them in /proc/cpuinfo.

---
 arch/x86/include/asm/cpufeature.h          |    4 ++++
 arch/x86/kernel/cpu/addon_cpuid_features.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpufeature.h +4 -0
index 613700f..7dbc1c2 100644
@@ -167,6 +167,10 @@
 #define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
 #define X86_FEATURE_EPT         (8*32+ 3) /* Intel Extended Page Table */
 #define X86_FEATURE_VPID        (8*32+ 4) /* Intel Virtual Processor ID */
+#define X86_FEATURE_NPT		(8*32+5)  /* AMD Nested Page Table support */
+#define X86_FEATURE_LBRV	(8*32+6)  /* AMD LBR Virtualization support */
+#define X86_FEATURE_SVML	(8*32+7)  /* "svm_lock" AMD SVM locking MSR */
+#define X86_FEATURE_NRIPS	(8*32+8)  /* "nrip_save" AMD SVM next_rip save */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
arch/x86/kernel/cpu/addon_cpuid_features.c +4 -0
index 468489b..97ad79c 100644
@@ -32,6 +32,10 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
 		{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
 		{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_NPT,   CR_EDX, 0, 0x8000000a },
+		{ X86_FEATURE_LBRV,  CR_EDX, 1, 0x8000000a },
+		{ X86_FEATURE_SVML,  CR_EDX, 2, 0x8000000a },
+		{ X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a },
 		{ 0, 0, 0, 0 }
 	};
 
Signature · 1 line
1.6.5.4
#2 lore raw

Ping.

Quoted 55 lines · Joerg Roedel

Are there any problems with this patch or was it just forgotten :-) Please let me know.

Joerg

Quoted 43 lines · Joerg Roedel

This patch adds code to cpu initialization path to detect the extended virtualization features of AMD cpus to show them in /proc/cpuinfo.

---
 arch/x86/include/asm/cpufeature.h          |    4 ++++
 arch/x86/kernel/cpu/addon_cpuid_features.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpufeature.h +4 -0
index 613700f..7dbc1c2 100644
@@ -167,6 +167,10 @@
 #define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
 #define X86_FEATURE_EPT         (8*32+ 3) /* Intel Extended Page Table */
 #define X86_FEATURE_VPID        (8*32+ 4) /* Intel Virtual Processor ID */
+#define X86_FEATURE_NPT		(8*32+5)  /* AMD Nested Page Table support */
+#define X86_FEATURE_LBRV	(8*32+6)  /* AMD LBR Virtualization support */
+#define X86_FEATURE_SVML	(8*32+7)  /* "svm_lock" AMD SVM locking MSR */
+#define X86_FEATURE_NRIPS	(8*32+8)  /* "nrip_save" AMD SVM next_rip save */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
arch/x86/kernel/cpu/addon_cpuid_features.c +4 -0
index 468489b..97ad79c 100644
@@ -32,6 +32,10 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
 		{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
 		{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_NPT,   CR_EDX, 0, 0x8000000a },
+		{ X86_FEATURE_LBRV,  CR_EDX, 1, 0x8000000a },
+		{ X86_FEATURE_SVML,  CR_EDX, 2, 0x8000000a },
+		{ X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a },
 		{ 0, 0, 0, 0 }
 	};
 
Signature · 1 line
1.6.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw

[tip:x86/cpu] x86, cpu: Print AMD virtualization features in /proc/cpuinfo

In reply to Joerg Roedel
Commit-ID:  414bb144efa2d2fe16d104d836d0d6b6e9265788
Gitweb:     http://git.kernel.org/tip/414bb144efa2d2fe16d104d836d0d6b6e9265788
Author:     Joerg Roedel <[email protected]>
AuthorDate: Mon, 14 Dec 2009 13:08:41 +0100
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Sat, 13 Feb 2010 15:04:40 -0800

x86, cpu: Print AMD virtualization features in /proc/cpuinfo

This patch adds code to cpu initialization path to detect the extended virtualization features of AMD cpus to show them in /proc/cpuinfo.

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/cpufeature.h          |    4 ++++
 arch/x86/kernel/cpu/addon_cpuid_features.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/x86/include/asm/cpufeature.h +4 -0
index 637e1ec..0cd82d0 100644
@@ -168,6 +168,10 @@
 #define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
 #define X86_FEATURE_EPT         (8*32+ 3) /* Intel Extended Page Table */
 #define X86_FEATURE_VPID        (8*32+ 4) /* Intel Virtual Processor ID */
+#define X86_FEATURE_NPT		(8*32+5)  /* AMD Nested Page Table support */
+#define X86_FEATURE_LBRV	(8*32+6)  /* AMD LBR Virtualization support */
+#define X86_FEATURE_SVML	(8*32+7)  /* "svm_lock" AMD SVM locking MSR */
+#define X86_FEATURE_NRIPS	(8*32+8)  /* "nrip_save" AMD SVM next_rip save */
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 
arch/x86/kernel/cpu/addon_cpuid_features.c +4 -0
index 468489b..97ad79c 100644
@@ -32,6 +32,10 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
 		{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
 		{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_NPT,   CR_EDX, 0, 0x8000000a },
+		{ X86_FEATURE_LBRV,  CR_EDX, 1, 0x8000000a },
+		{ X86_FEATURE_SVML,  CR_EDX, 2, 0x8000000a },
+		{ X86_FEATURE_NRIPS, CR_EDX, 3, 0x8000000a },
 		{ 0, 0, 0, 0 }
 	};