diff mbox series

[kvm-unit-test,VMX] : Use #define for bit# 1 in GUEST_RFLAGS

Message ID 20190328023246.12087-1-krish.sadhukhan@oracle.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-test,VMX] : Use #define for bit# 1 in GUEST_RFLAGS | expand

Commit Message

Krish Sadhukhan March 28, 2019, 2:32 a.m. UTC
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>

---
 x86/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Hildenbrand March 29, 2019, 9:48 a.m. UTC | #1
On 28.03.19 03:32, Krish Sadhukhan wrote:
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
> 
> ---
>  x86/vmx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/x86/vmx.c b/x86/vmx.c
> index 6ba56bc..d1a0da8 100644
> --- a/x86/vmx.c
> +++ b/x86/vmx.c
> @@ -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);
> @@ -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);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Paolo Bonzini Dec. 10, 2019, 5:12 p.m. UTC | #2
On 28/03/19 03:32, Krish Sadhukhan wrote:
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
> 
> ---
>  x86/vmx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/x86/vmx.c b/x86/vmx.c
> index 6ba56bc..d1a0da8 100644
> --- a/x86/vmx.c
> +++ b/x86/vmx.c
> @@ -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);
> @@ -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
diff mbox series

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index 6ba56bc..d1a0da8 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -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);
@@ -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);