Re: [PATCH] KVM: vmx: add mismatched size in vmcs_check32

From: Paolo Bonzini
Date: Thu Apr 08 2021 - 12:28:53 EST


On 08/04/21 18:05, Sean Christopherson wrote:
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.

KVM also uses raw vmread/vmwrite (__vmcs_readl/__vmcs_writel) when copying to and from the shadow VMCS, so that path will not go through vmcs_check32 either.

Paolo