Skip to content

Commit 9365569

Browse files
anadavbonzini
authored andcommitted
x86: vmx: Remove max_index tracking in check_vmcs_field()
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 <[email protected]> Cc: Sean Christopherson <[email protected]> Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 2b0418e commit 9365569

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Diff for: x86/vmx.c

+3-15
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,10 @@ static void set_vmcs_field(struct vmcs_field *f, u8 cookie)
281281
vmcs_write(f->encoding, vmcs_field_value(f, cookie));
282282
}
283283

284-
static bool check_vmcs_field(struct vmcs_field *f, u8 cookie, u32 *max_index)
284+
static bool check_vmcs_field(struct vmcs_field *f, u8 cookie)
285285
{
286286
u64 expected;
287287
u64 actual;
288-
u32 index;
289288
int ret;
290289

291290
if (f->encoding == VMX_INST_ERROR) {
@@ -299,12 +298,6 @@ static bool check_vmcs_field(struct vmcs_field *f, u8 cookie, u32 *max_index)
299298
if (ret & X86_EFLAGS_ZF)
300299
return true;
301300

302-
if (max_index) {
303-
index = f->encoding & VMCS_FIELD_INDEX_MASK;
304-
if (index > *max_index)
305-
*max_index = index;
306-
}
307-
308301
if (vmcs_field_readonly(f)) {
309302
printf("Skipping read-only field %lx\n", f->encoding);
310303
return true;
@@ -330,24 +323,19 @@ static void set_all_vmcs_fields(u8 cookie)
330323
set_vmcs_field(&vmcs_fields[i], cookie);
331324
}
332325

333-
static bool __check_all_vmcs_fields(u8 cookie, u32 *max_index)
326+
static bool check_all_vmcs_fields(u8 cookie)
334327
{
335328
bool pass = true;
336329
int i;
337330

338331
for (i = 0; i < ARRAY_SIZE(vmcs_fields); i++) {
339-
if (!check_vmcs_field(&vmcs_fields[i], cookie, max_index))
332+
if (!check_vmcs_field(&vmcs_fields[i], cookie))
340333
pass = false;
341334
}
342335

343336
return pass;
344337
}
345338

346-
static bool check_all_vmcs_fields(u8 cookie)
347-
{
348-
return __check_all_vmcs_fields(cookie, NULL);
349-
}
350-
351339
static u32 find_vmcs_max_index(void)
352340
{
353341
u32 idx, width, type, enc;

0 commit comments

Comments
 (0)