From: Paolo Bonzini <pbonzini@redhat.com>
To: KarimAllah Ahmed <karahmed@amazon.de>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H . Peter Anvin" <hpa@zytor.com>,
"David Woodhouse" <dwmw@amazon.co.uk>
Subject: Re: [PATCH v3 1/4] KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX
Date: Tue, 30 Jan 2018 18:17:45 -0500 [thread overview]
Message-ID: <91a5b0d3-37cc-2af3-a598-f3918697f91e@redhat.com> (raw)
In-Reply-To: <1517271028-15916-2-git-send-email-karahmed@amazon.de>
On 29/01/2018 19:10, KarimAllah Ahmed wrote:
> [dwmw2: Stop using KF() for bits in it, too]
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: kvm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/cpuid.c | 8 +++-----
> arch/x86/kvm/cpuid.h | 1 +
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 0099e10..c0eb337 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -67,9 +67,7 @@ u64 kvm_supported_xcr0(void)
>
> #define F(x) bit(X86_FEATURE_##x)
>
> -/* These are scattered features in cpufeatures.h. */
> -#define KVM_CPUID_BIT_AVX512_4VNNIW 2
> -#define KVM_CPUID_BIT_AVX512_4FMAPS 3
> +/* For scattered features from cpufeatures.h; we currently expose none */
> #define KF(x) bit(KVM_CPUID_BIT_##x)
>
> int kvm_update_cpuid(struct kvm_vcpu *vcpu)
> @@ -392,7 +390,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
>
> /* cpuid 7.0.edx*/
> const u32 kvm_cpuid_7_0_edx_x86_features =
> - KF(AVX512_4VNNIW) | KF(AVX512_4FMAPS);
> + F(AVX512_4VNNIW) | F(AVX512_4FMAPS);
>
> /* all calls to cpuid_count() should be made on the same cpu */
> get_cpu();
> @@ -477,7 +475,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> if (!tdp_enabled || !boot_cpu_has(X86_FEATURE_OSPKE))
> entry->ecx &= ~F(PKU);
> entry->edx &= kvm_cpuid_7_0_edx_x86_features;
> - entry->edx &= get_scattered_cpuid_leaf(7, 0, CPUID_EDX);
> + cpuid_mask(&entry->edx, CPUID_7_EDX);
> } else {
> entry->ebx = 0;
> entry->ecx = 0;
> diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
> index cdc70a3..dcfe227 100644
> --- a/arch/x86/kvm/cpuid.h
> +++ b/arch/x86/kvm/cpuid.h
> @@ -54,6 +54,7 @@ static const struct cpuid_reg reverse_cpuid[] = {
> [CPUID_8000_000A_EDX] = {0x8000000a, 0, CPUID_EDX},
> [CPUID_7_ECX] = { 7, 0, CPUID_ECX},
> [CPUID_8000_0007_EBX] = {0x80000007, 0, CPUID_EBX},
> + [CPUID_7_EDX] = { 7, 0, CPUID_EDX},
> };
>
> static __always_inline struct cpuid_reg x86_feature_cpuid(unsigned x86_feature)
>
next prev parent reply other threads:[~2018-01-30 23:17 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 0:10 [PATCH v3 0/4] KVM: Expose speculation control feature to guests KarimAllah Ahmed
2018-01-30 0:10 ` [PATCH v3 1/4] KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX KarimAllah Ahmed
2018-01-30 23:17 ` Paolo Bonzini [this message]
2018-01-30 0:10 ` [PATCH v3 2/4] KVM: x86: Add IBPB support KarimAllah Ahmed
2018-01-30 14:22 ` Tom Lendacky
2018-01-30 14:36 ` David Woodhouse
2018-01-30 17:19 ` Jim Mattson
2018-01-30 17:43 ` David Woodhouse
2018-01-30 0:10 ` [PATCH v3 3/4] KVM: VMX: Emulate MSR_IA32_ARCH_CAPABILITIES KarimAllah Ahmed
2018-01-30 0:22 ` Raj, Ashok
2018-01-30 0:25 ` KarimAllah Ahmed
2018-01-30 23:21 ` Paolo Bonzini
2018-01-30 0:10 ` [PATCH v3 4/4] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL KarimAllah Ahmed
2018-01-30 17:49 ` Jim Mattson
2018-01-30 21:00 ` KarimAllah Ahmed
2018-01-30 22:49 ` Jim Mattson
2018-01-30 23:32 ` Paolo Bonzini
2018-01-30 23:50 ` KarimAllah Ahmed
2018-01-31 0:16 ` Jim Mattson
2018-01-31 0:19 ` Paolo Bonzini
2018-01-31 0:27 ` Jim Mattson
2018-01-31 0:52 ` KarimAllah Ahmed
2018-01-31 0:56 ` Paolo Bonzini
2018-01-30 9:00 ` [PATCH v3 0/4] KVM: Expose speculation control feature to guests David Woodhouse
2018-01-30 9:32 ` KarimAllah Ahmed
2018-01-30 23:36 ` Paolo Bonzini
2018-01-30 23:48 ` Raj, Ashok
2018-01-31 0:16 ` Paolo Bonzini
2018-01-31 0:26 ` David Woodhouse
2018-01-31 6:54 ` Dave Hansen
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=91a5b0d3-37cc-2af3-a598-f3918697f91e@redhat.com \
--to=pbonzini@redhat.com \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=karahmed@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rkrcmar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®