All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Nadav Amit <namit@vmware.com>,
	Jim Mattson <jmattson@google.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>
Subject: [kvm-unit-tests PATCH 2/2] x86: vmx: Remove max_index tracking in check_vmcs_field()
Date: Thu, 19 Dec 2019 02:10:06 -0800	[thread overview]
Message-ID: <20191219101006.49103-3-namit@vmware.com> (raw)
In-Reply-To: <20191219101006.49103-1-namit@vmware.com>

Now that comprehensive search for maximum VMCS field index is performed,
the tracking of the maximum index in __check_vmcs_field() is no longer
needed. Remove all the related logic accordingly.

Cc: Jim Mattson <jmattson@google.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/vmx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/x86/vmx.c b/x86/vmx.c
index a1af59c..8bcb438 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -281,11 +281,10 @@ static void set_vmcs_field(struct vmcs_field *f, u8 cookie)
 	vmcs_write(f->encoding, vmcs_field_value(f, cookie));
 }
 
-static bool check_vmcs_field(struct vmcs_field *f, u8 cookie, u32 *max_index)
+static bool check_vmcs_field(struct vmcs_field *f, u8 cookie)
 {
 	u64 expected;
 	u64 actual;
-	u32 index;
 	int ret;
 
 	if (f->encoding == VMX_INST_ERROR) {
@@ -299,12 +298,6 @@ static bool check_vmcs_field(struct vmcs_field *f, u8 cookie, u32 *max_index)
 	if (ret & X86_EFLAGS_ZF)
 		return true;
 
-	if (max_index) {
-		index = f->encoding & VMCS_FIELD_INDEX_MASK;
-		if (index > *max_index)
-			*max_index = index;
-	}
-
 	if (vmcs_field_readonly(f)) {
 		printf("Skipping read-only field %lx\n", f->encoding);
 		return true;
@@ -330,24 +323,19 @@ static void set_all_vmcs_fields(u8 cookie)
 		set_vmcs_field(&vmcs_fields[i], cookie);
 }
 
-static bool __check_all_vmcs_fields(u8 cookie, u32 *max_index)
+static bool check_all_vmcs_fields(u8 cookie)
 {
 	bool pass = true;
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(vmcs_fields); i++) {
-		if (!check_vmcs_field(&vmcs_fields[i], cookie, max_index))
+		if (!check_vmcs_field(&vmcs_fields[i], cookie))
 			pass = false;
 	}
 
 	return pass;
 }
 
-static bool check_all_vmcs_fields(u8 cookie)
-{
-	return __check_all_vmcs_fields(cookie, NULL);
-}
-
 static u32 find_vmcs_max_index(void)
 {
 	u32 idx, width, type, enc;
-- 
2.17.1


  parent reply	other threads:[~2019-12-19 10:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 10:10 [kvm-unit-tests PATCH 0/2] Better max VMCS field index test Nadav Amit
2019-12-19 10:10 ` [kvm-unit-tests PATCH 1/2] x86: vmx: Comprehensive max VMCS field search Nadav Amit
2019-12-19 10:10 ` Nadav Amit [this message]
2020-01-18 19:25 ` [kvm-unit-tests PATCH 0/2] Better max VMCS field index test Paolo Bonzini

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=20191219101006.49103-3-namit@vmware.com \
    --to=namit@vmware.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.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.