* [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo
@ 2009-12-14 12:08 Joerg Roedel
2010-02-05 12:51 ` Joerg Roedel
2010-02-14 0:18 ` [tip:x86/cpu] x86, cpu: " tip-bot for Joerg Roedel
0 siblings, 2 replies; 7+ messages in thread
From: Joerg Roedel @ 2009-12-14 12:08 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
Cc: x86, linux-kernel, 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.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/include/asm/cpufeature.h | 4 ++++
arch/x86/kernel/cpu/addon_cpuid_features.c | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 613700f..7dbc1c2 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -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__)
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 468489b..97ad79c 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -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 }
};
--
1.6.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo
2009-12-14 12:08 [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo Joerg Roedel
@ 2010-02-05 12:51 ` Joerg Roedel
2010-02-13 11:06 ` Joerg Roedel
2010-02-14 0:18 ` [tip:x86/cpu] x86, cpu: " tip-bot for Joerg Roedel
1 sibling, 1 reply; 7+ messages in thread
From: Joerg Roedel @ 2010-02-05 12:51 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: x86, linux-kernel
Are there any problems with this patch or was it just forgotten :-)
Please let me know.
Joerg
On Mon, Dec 14, 2009 at 01:08:41PM +0100, Joerg Roedel wrote:
> This patch adds code to cpu initialization path to detect
> the extended virtualization features of AMD cpus to show
> them in /proc/cpuinfo.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
> arch/x86/include/asm/cpufeature.h | 4 ++++
> arch/x86/kernel/cpu/addon_cpuid_features.c | 4 ++++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
> index 613700f..7dbc1c2 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -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__)
>
> diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
> index 468489b..97ad79c 100644
> --- a/arch/x86/kernel/cpu/addon_cpuid_features.c
> +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
> @@ -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 }
> };
>
> --
> 1.6.5.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo
2010-02-05 12:51 ` Joerg Roedel
@ 2010-02-13 11:06 ` Joerg Roedel
0 siblings, 0 replies; 7+ messages in thread
From: Joerg Roedel @ 2010-02-13 11:06 UTC (permalink / raw)
To: Joerg Roedel
Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, x86, linux-kernel
Ping.
On Fri, Feb 05, 2010 at 01:51:00PM +0100, Joerg Roedel wrote:
> Are there any problems with this patch or was it just forgotten :-)
> Please let me know.
>
> Joerg
>
> On Mon, Dec 14, 2009 at 01:08:41PM +0100, Joerg Roedel wrote:
> > This patch adds code to cpu initialization path to detect
> > the extended virtualization features of AMD cpus to show
> > them in /proc/cpuinfo.
> >
> > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> > ---
> > arch/x86/include/asm/cpufeature.h | 4 ++++
> > arch/x86/kernel/cpu/addon_cpuid_features.c | 4 ++++
> > 2 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
> > index 613700f..7dbc1c2 100644
> > --- a/arch/x86/include/asm/cpufeature.h
> > +++ b/arch/x86/include/asm/cpufeature.h
> > @@ -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__)
> >
> > diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
> > index 468489b..97ad79c 100644
> > --- a/arch/x86/kernel/cpu/addon_cpuid_features.c
> > +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
> > @@ -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 }
> > };
> >
> > --
> > 1.6.5.4
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:x86/cpu] x86, cpu: Print AMD virtualization features in /proc/cpuinfo
2009-12-14 12:08 [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo Joerg Roedel
2010-02-05 12:51 ` Joerg Roedel
@ 2010-02-14 0:18 ` tip-bot for Joerg Roedel
1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Joerg Roedel @ 2010-02-14 0:18 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, joerg.roedel, tglx
Commit-ID: 414bb144efa2d2fe16d104d836d0d6b6e9265788
Gitweb: http://git.kernel.org/tip/414bb144efa2d2fe16d104d836d0d6b6e9265788
Author: Joerg Roedel <joerg.roedel@amd.com>
AuthorDate: Mon, 14 Dec 2009 13:08:41 +0100
Committer: H. Peter Anvin <hpa@zytor.com>
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.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
LKML-Reference: <1260792521-15212-1-git-send-email-joerg.roedel@amd.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/include/asm/cpufeature.h | 4 ++++
arch/x86/kernel/cpu/addon_cpuid_features.c | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 637e1ec..0cd82d0 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -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__)
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 468489b..97ad79c 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -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 }
};
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: Print amd virtualization features in /proc/cpuinfo
2009-09-09 16:16 ` Joerg Roedel
@ 2009-09-09 16:39 ` H. Peter Anvin
0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2009-09-09 16:39 UTC (permalink / raw)
To: Joerg Roedel; +Cc: Ingo Molnar, Thomas Gleixner, x86, linux-kernel
On 09/09/2009 09:16 AM, Joerg Roedel wrote:
> Hi Ingo,
>
> do you have any objections against this patch? Please let me know so I
> can fix them.
>
> Thanks,
>
> Joerg
These features should be table-driven like the ones already in
scattered_cpuid_features() instead of open-coded.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: Print amd virtualization features in /proc/cpuinfo
2009-08-11 13:18 [PATCH] x86: Print amd " Joerg Roedel
@ 2009-09-09 16:16 ` Joerg Roedel
2009-09-09 16:39 ` H. Peter Anvin
0 siblings, 1 reply; 7+ messages in thread
From: Joerg Roedel @ 2009-09-09 16:16 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: x86, linux-kernel
Hi Ingo,
do you have any objections against this patch? Please let me know so I
can fix them.
Thanks,
Joerg
On Tue, Aug 11, 2009 at 03:18:52PM +0200, Joerg Roedel wrote:
> This patch adds code to cpu initialization path to detect the extended
> virtualization features of AMD cpus and shows them in /proc/cpuinfo.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
> arch/x86/include/asm/cpufeature.h | 5 +++++
> arch/x86/kernel/cpu/amd.c | 25 +++++++++++++++++++++++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
> index 4a28d22..d3218e3 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -165,6 +165,11 @@
> #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) /* LBR Virtualization support */
> +#define X86_FEATURE_SVML (8*32+7) /* "svm_lock" SVM locking MSR */
> +#define X86_FEATURE_NRIPS (8*32+8) /* "nrip_save" svm next_rip save */
> +
>
> #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index ec6c7a8..ac567d4 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -367,6 +367,28 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
> #endif
> }
>
> +static void __cpuinit detect_amd_virt_flags(struct cpuinfo_x86 *c)
> +{
> +
> +#define SVM_FEATURE_NPT_MASK 0x00000001
> +#define SVM_FEATURE_LBRV_MASK 0x00000002
> +#define SVM_FEATURE_SVML_MASK 0x00000004
> +#define SVM_FEATURE_NRIPS_MASK 0x00000008
> +
> + u32 virt_flags;
> +
> + virt_flags = cpuid_edx(0x8000000A);
> +
> + if (virt_flags & SVM_FEATURE_NPT_MASK)
> + set_cpu_cap(c, X86_FEATURE_NPT);
> + if (virt_flags & SVM_FEATURE_LBRV_MASK)
> + set_cpu_cap(c, X86_FEATURE_LBRV);
> + if (virt_flags & SVM_FEATURE_SVML_MASK)
> + set_cpu_cap(c, X86_FEATURE_SVML);
> + if (virt_flags & SVM_FEATURE_NRIPS_MASK)
> + set_cpu_cap(c, X86_FEATURE_NRIPS);
> +}
> +
> static void __cpuinit init_amd(struct cpuinfo_x86 *c)
> {
> #ifdef CONFIG_SMP
> @@ -499,6 +521,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
> }
> }
> #endif
> +
> + if (cpu_has(c, X86_FEATURE_SVM))
> + detect_amd_virt_flags(c);
> }
>
> #ifdef CONFIG_X86_32
> --
> 1.6.3.3
>
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] x86: Print amd virtualization features in /proc/cpuinfo
@ 2009-08-11 13:18 Joerg Roedel
2009-09-09 16:16 ` Joerg Roedel
0 siblings, 1 reply; 7+ messages in thread
From: Joerg Roedel @ 2009-08-11 13:18 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
Cc: x86, linux-kernel, Joerg Roedel
This patch adds code to cpu initialization path to detect the extended
virtualization features of AMD cpus and shows them in /proc/cpuinfo.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/include/asm/cpufeature.h | 5 +++++
arch/x86/kernel/cpu/amd.c | 25 +++++++++++++++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 4a28d22..d3218e3 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -165,6 +165,11 @@
#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) /* LBR Virtualization support */
+#define X86_FEATURE_SVML (8*32+7) /* "svm_lock" SVM locking MSR */
+#define X86_FEATURE_NRIPS (8*32+8) /* "nrip_save" svm next_rip save */
+
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index ec6c7a8..ac567d4 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -367,6 +367,28 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
#endif
}
+static void __cpuinit detect_amd_virt_flags(struct cpuinfo_x86 *c)
+{
+
+#define SVM_FEATURE_NPT_MASK 0x00000001
+#define SVM_FEATURE_LBRV_MASK 0x00000002
+#define SVM_FEATURE_SVML_MASK 0x00000004
+#define SVM_FEATURE_NRIPS_MASK 0x00000008
+
+ u32 virt_flags;
+
+ virt_flags = cpuid_edx(0x8000000A);
+
+ if (virt_flags & SVM_FEATURE_NPT_MASK)
+ set_cpu_cap(c, X86_FEATURE_NPT);
+ if (virt_flags & SVM_FEATURE_LBRV_MASK)
+ set_cpu_cap(c, X86_FEATURE_LBRV);
+ if (virt_flags & SVM_FEATURE_SVML_MASK)
+ set_cpu_cap(c, X86_FEATURE_SVML);
+ if (virt_flags & SVM_FEATURE_NRIPS_MASK)
+ set_cpu_cap(c, X86_FEATURE_NRIPS);
+}
+
static void __cpuinit init_amd(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_SMP
@@ -499,6 +521,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
}
}
#endif
+
+ if (cpu_has(c, X86_FEATURE_SVM))
+ detect_amd_virt_flags(c);
}
#ifdef CONFIG_X86_32
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-02-14 0:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-14 12:08 [PATCH] x86: Print AMD virtualization features in /proc/cpuinfo Joerg Roedel
2010-02-05 12:51 ` Joerg Roedel
2010-02-13 11:06 ` Joerg Roedel
2010-02-14 0:18 ` [tip:x86/cpu] x86, cpu: " tip-bot for Joerg Roedel
-- strict thread matches above, loose matches on Subject: below --
2009-08-11 13:18 [PATCH] x86: Print amd " Joerg Roedel
2009-09-09 16:16 ` Joerg Roedel
2009-09-09 16:39 ` H. Peter Anvin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.