From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: nVMX MSR load/store feature Date: Mon, 15 Dec 2014 15:08:20 +0100 Message-ID: <548EEB54.9060105@redhat.com> References: <548ECFC4.2000607@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Bandan Das , kvm@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li To: Eugene Korenevsky Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59369 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbaLOOIl (ORCPT ); Mon, 15 Dec 2014 09:08:41 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 15/12/2014 14:59, Eugene Korenevsky wrote: >> The diff is just >> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index d6fe958a0403..09ccf6c09435 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -8305,6 +8305,8 @@ static int nested_vmx_check_msr_switch(struct kvm_vcpu *vcpu, >> WARN_ON(1); >> return -EINVAL; >> } >> + if (count == 0) >> + return 0; >> if (!IS_ALIGNED(addr, 16) || addr >> maxphyaddr || >> (addr + count * sizeof(struct vmx_msr_entry) - 1) >> maxphyaddr) { >> pr_warn_ratelimited( >> >> right? > > Yes. Without this check, `nested_vmx_check_msr_switch` returns -EINVAL > for count==0 and addr==0. Ok, thanks. I'll push the patches to kvm/queue as soon as my testing finishes. Paolo