All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krish Sadhukhan <krish.sadhukhan@oracle.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, jmattson@google.com
Subject: [PATCH 4/6 v4][KVM nVMX]: nested_check_guest_cregs_dregs_msrs() should return -EINVAL for error conditions
Date: Thu,  4 Apr 2019 21:46:48 -0400	[thread overview]
Message-ID: <20190405014650.16880-5-krish.sadhukhan@oracle.com> (raw)
In-Reply-To: <20190405014650.16880-1-krish.sadhukhan@oracle.com>

 ..to match the error return type of other similar functions.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/vmx/nested.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 8347e9066e26..efd226d4ea36 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2683,11 +2683,11 @@ static int nested_check_guest_cregs_dregs_msrs(struct kvm_vcpu *vcpu,
 {
 	if (!nested_guest_cr0_valid(vcpu, vmcs12->guest_cr0) ||
 	    !nested_guest_cr4_valid(vcpu, vmcs12->guest_cr4))
-		return 1;
+		return -EINVAL;
 
 	if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT) &&
 	    !kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, vmcs12->guest_ia32_pat))
-		return 1;
+		return -EINVAL;
 
 	return 0;
 }
-- 
2.17.2


  parent reply	other threads:[~2019-04-05  2:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05  1:46 [KVM nVMX]: Check "load IA32_PAT" VM-exit{entry} controls on vmentry of L2 guests (v4) Krish Sadhukhan
2019-04-05  1:46 ` [PATCH 1/6 v4][KVM nVMX]: Check "load IA32_PAT" VM-exit control on vmentry Krish Sadhukhan
2019-04-08 17:21   ` Sean Christopherson
2019-04-05  1:46 ` [PATCH 2/6 v4][KVM nVMX]: Check "load IA32_PAT" VM-entry " Krish Sadhukhan
2019-04-05  1:46 ` [PATCH 3/6 v4][KVM nVMX]: Move the checks for Guest Control Registers and Guest MSRs to a separate function Krish Sadhukhan
2019-04-05  1:46 ` Krish Sadhukhan [this message]
2019-04-08 17:24   ` [PATCH 4/6 v4][KVM nVMX]: nested_check_guest_cregs_dregs_msrs() should return -EINVAL for error conditions Sean Christopherson
2019-04-05  1:46 ` [PATCH 5/6 v4][KVM nVMX]: nested_vmx_check_vmentry_postreqs() should return VMX_EXIT_REASONS_FAILED_VMENTRY | EXIT_REASON_INVALID_STATE " Krish Sadhukhan
2019-04-08 17:27   ` Sean Christopherson
2019-04-05  1:46 ` [PATCH 6/6 v4][kvm-unit-test nVMX]: Check "load IA32_PAT" on vmentry of L2 guests Krish Sadhukhan
2019-04-08 17:34   ` Sean Christopherson

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=20190405014650.16880-5-krish.sadhukhan@oracle.com \
    --to=krish.sadhukhan@oracle.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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.