From: Paolo Bonzini <pbonzini@redhat.com>
To: David Edmondson <david.edmondson@oracle.com>,
linux-kernel@vger.kernel.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
Nadav Amit <namit@cs.technion.ac.il>,
x86@kernel.org, Wanpeng Li <wanpengli@tencent.com>,
kvm@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Sean Christopherson <sean.j.christopherson@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Joerg Roedel <joro@8bytes.org>,
Jim Mattson <jmattson@google.com>, Borislav Petkov <bp@alien8.de>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] KVM: x86: clflushopt should be treated as a no-op by emulation
Date: Fri, 13 Nov 2020 12:26:20 +0100 [thread overview]
Message-ID: <72b96832-634a-56f0-95aa-f9a282d8fbf8@redhat.com> (raw)
In-Reply-To: <20201103120400.240882-1-david.edmondson@oracle.com>
On 03/11/20 13:04, David Edmondson wrote:
> The instruction emulator ignores clflush instructions, yet fails to
> support clflushopt. Treat both similarly.
>
> Fixes: 13e457e0eebf ("KVM: x86: Emulator does not decode clflush well")
> Signed-off-by: David Edmondson <david.edmondson@oracle.com>
> ---
> arch/x86/kvm/emulate.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 0d917eb70319..56cae1ff9e3f 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -4046,6 +4046,12 @@ static int em_clflush(struct x86_emulate_ctxt *ctxt)
> return X86EMUL_CONTINUE;
> }
>
> +static int em_clflushopt(struct x86_emulate_ctxt *ctxt)
> +{
> + /* emulating clflushopt regardless of cpuid */
> + return X86EMUL_CONTINUE;
> +}
> +
> static int em_movsxd(struct x86_emulate_ctxt *ctxt)
> {
> ctxt->dst.val = (s32) ctxt->src.val;
> @@ -4585,7 +4591,7 @@ static const struct opcode group11[] = {
> };
>
> static const struct gprefix pfx_0f_ae_7 = {
> - I(SrcMem | ByteOp, em_clflush), N, N, N,
> + I(SrcMem | ByteOp, em_clflush), I(SrcMem | ByteOp, em_clflushopt), N, N,
> };
>
> static const struct group_dual group15 = { {
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2020-11-13 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 12:04 [PATCH] KVM: x86: clflushopt should be treated as a no-op by emulation David Edmondson
2020-11-13 11:07 ` Joao Martins
2020-11-13 11:26 ` Paolo Bonzini [this message]
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=72b96832-634a-56f0-95aa-f9a282d8fbf8@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=david.edmondson@oracle.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namit@cs.technion.ac.il \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--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;
as well as URLs for NNTP newsgroup(s).