All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haiwei Li <lihaiwei.kernel@gmail.com>
To: Sean Christopherson <seanjc@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Haiwei Li <lihaiwei@tencent.com>
Subject: Re: [PATCH] KVM: vmx: add mismatched size in vmcs_check32
Date: Fri, 9 Apr 2021 09:57:57 +0800	[thread overview]
Message-ID: <CAB5KdObQ=HN2YBZCB2iV5U_uuOuwtgrX=CcApstwKwHeaRqy8w@mail.gmail.com> (raw)
In-Reply-To: <YG8pwERmjxYQoquP@google.com>

On Fri, Apr 9, 2021 at 12:05 AM Sean Christopherson <seanjc@google.com> wrote:
>
> On Thu, Apr 08, 2021, lihaiwei.kernel@gmail.com wrote:
> > From: Haiwei Li <lihaiwei@tencent.com>
> >
> > vmcs_check32 misses the check for 64-bit and 64-bit high.
>
> Can you clarify in the changelog that, while it is architecturally legal to
> access 64-bit and 64-bit high fields with a 32-bit read/write in 32-bit mode,
> KVM should never do partial accesses to VMCS fields.  And/or note that the
> 32-bit accesses are done in vmcs_{read,write}64() when necessary?  Hmm, maybe:
>
>   Add compile-time assertions in vmcs_check32() to disallow accesses to
>   64-bit and 64-bit high fields via vmcs_{read,write}32().  Upper level
>   KVM code should never do partial accesses to VMCS fields.  KVM handles
>   the split accesses automatically in vmcs_{read,write}64() when running
>   as a 32-bit kernel.

Good suggestion, thanks. I will send v2.

      parent reply	other threads:[~2021-04-09  1:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  7:54 [PATCH] KVM: vmx: add mismatched size in vmcs_check32 lihaiwei.kernel
2021-04-08 16:05 ` Sean Christopherson
2021-04-08 16:28   ` Paolo Bonzini
2021-04-09  1:57   ` Haiwei Li [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='CAB5KdObQ=HN2YBZCB2iV5U_uuOuwtgrX=CcApstwKwHeaRqy8w@mail.gmail.com' \
    --to=lihaiwei.kernel@gmail.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=lihaiwei@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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 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.