From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: Print amd virtualization features in /proc/cpuinfo
Date: Wed, 9 Sep 2009 18:16:43 +0200 [thread overview]
Message-ID: <20090909161643.GB15711@amd.com> (raw)
In-Reply-To: <1249996732-13794-1-git-send-email-joerg.roedel@amd.com>
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
>
--
next prev parent reply other threads:[~2009-09-09 16:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 13:18 [PATCH] x86: Print amd virtualization features in /proc/cpuinfo Joerg Roedel
2009-09-09 16:16 ` Joerg Roedel [this message]
2009-09-09 16:39 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2009-12-14 12:08 [PATCH] x86: Print AMD " Joerg Roedel
2010-02-05 12:51 ` Joerg Roedel
2010-02-13 11:06 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090909161643.GB15711@amd.com \
--to=joerg.roedel@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.