From: Paolo Bonzini <pbonzini@redhat.com>
To: Matthew Whitehead <tedheadster@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: kvm: Restrict X86_FEATURE_VMMCALL to x86_64 platform
Date: Tue, 31 Jul 2018 09:39:18 +0200 [thread overview]
Message-ID: <7c274466-6d93-d1ba-8721-4d69f847b40f@redhat.com> (raw)
In-Reply-To: <20180730194059.5781-1-tedheadster@gmail.com>
On 30/07/2018 21:40, Matthew Whitehead wrote:
> early_init_amd() is called on all AMD processors, both 64 and 32 bit.
> Presently 32 bit processors get the X86_FEATURE_VMMCALL feature set, which
> they do not support. Add conditionals to restrict it to 64 bit processors.
This shouldn't be necessary; for systems that don't have virtualization
extensions, the comment explains why setting X86_FEATURE_VMMCALL is safe.
But it is also wrong, because you can run a 32-bit kernel as a guest on
a 64-bit processor, and then it should set X86_FEATURE_VMMCALL because
the processor has the vmmcall instruction and not Intel's vmcall.
Thanks,
Paolo
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
> ---
> arch/x86/kernel/cpu/amd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 38915fbfae73..df06919324cd 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -662,12 +662,14 @@ static void early_init_amd(struct cpuinfo_x86 *c)
> }
> #endif
>
> +#ifdef CONFIG_X86_64
> /*
> * This is only needed to tell the kernel whether to use VMCALL
> * and VMMCALL. VMMCALL is never executed except under virt, so
> * we can set it unconditionally.
> */
> set_cpu_cap(c, X86_FEATURE_VMMCALL);
> +#endif
>
> /* F16h erratum 793, CVE-2013-6885 */
> if (c->x86 == 0x16 && c->x86_model <= 0xf)
>
next prev parent reply other threads:[~2018-07-31 7:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 19:40 Matthew Whitehead
2018-07-31 7:39 ` Paolo Bonzini [this message]
2018-07-31 12:57 ` tedheadster
2018-07-31 12:59 ` Paolo Bonzini
2018-08-01 15:21 ` Brian Gerst
2018-08-01 15:27 ` Paolo Bonzini
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=7c274466-6d93-d1ba-8721-4d69f847b40f@redhat.com \
--to=pbonzini@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tedheadster@gmail.com \
/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®