lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] KVM: vmx: add mismatched size in vmcs_check32
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.

\
 
 \ /
  Last update: 2021-04-09 03:58    [W:1.879 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site