Skip to contentSkip to conversation

: Use #define for bit# 1 in GUEST_RFLAGS

PATCH Paolo Bonzini 1 participant 1 message Dec 10, 2019 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paolo Bonzini

author maintainer Applied
#1 lore raw
Quoted 22 lines · Krish Sadhukhan
---
 x86/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
x86/vmx.c +1 -1
index 6ba56bc..d1a0da8 100644
@@ -1193,7 +1193,7 @@ static void init_vmcs_guest(void)
 	/* 26.3.1.4 */
 	vmcs_write(GUEST_RIP, (u64)(&guest_entry));
 	vmcs_write(GUEST_RSP, (u64)(guest_stack + PAGE_SIZE - 1));
-	vmcs_write(GUEST_RFLAGS, 0x2);
+	vmcs_write(GUEST_RFLAGS, X86_EFLAGS_FIXED);
 
 	/* 26.3.1.5 */
 	vmcs_write(GUEST_ACTV_STATE, ACTV_ACTIVE);

x86/vmx.c static int test_run(struct vmx_test *test) · line 1711

Quoted 8 lines
x86/vmx.c +1 -1
@@ -1705,7 +1705,7 @@ static int test_run(struct vmx_test *test)
 	test->exits = 0;
 	current = test;
 	regs = test->guest_regs;
-	vmcs_write(GUEST_RFLAGS, regs.rflags | 0x2);
+	vmcs_write(GUEST_RFLAGS, regs.rflags | X86_EFLAGS_FIXED);
 	launched = 0;
 	guest_finished = 0;
 	printf("\nTest suite: %s\n", test->name);

Applied, better late than never...

Paolo