[4/4] kvm-unit-test: nVMX: Use #defines for exit reason in advance_guest_state_test()
diff mbox series

Message ID 20191015001633.8603-5-krish.sadhukhan@oracle.com
State New
Headers show
Series
  • : kvm-unit-test: nVMX: Test deferring of error from VM-entry MSR-load area
Related show

Commit Message

Krish Sadhukhan Oct. 15, 2019, 12:16 a.m. UTC
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
---
 x86/vmx_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jim Mattson Oct. 16, 2019, 5:51 p.m. UTC | #1
On Mon, Oct 14, 2019 at 5:52 PM Krish Sadhukhan
<krish.sadhukhan@oracle.com> wrote:
>
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
> ---
>  x86/vmx_tests.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index d68f0c0..759e24a 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -5043,7 +5043,7 @@ static void guest_state_test_main(void)
>  static void advance_guest_state_test(void)
>  {
>         u32 reason = vmcs_read(EXI_REASON);
> -       if (! (reason & 0x80000000)) {
> +       if (! (reason & VMX_ENTRY_FAILURE)) {
Nit: Drop the superfluous space while you're here?
>                 u64 guest_rip = vmcs_read(GUEST_RIP);
>                 u32 insn_len = vmcs_read(EXI_INST_LEN);
>                 vmcs_write(GUEST_RIP, guest_rip + insn_len);
> --
> 2.20.1
>
Reviewed-by: Jim Mattson <jmattson@google.com>

Patch
diff mbox series

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index d68f0c0..759e24a 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -5043,7 +5043,7 @@  static void guest_state_test_main(void)
 static void advance_guest_state_test(void)
 {
 	u32 reason = vmcs_read(EXI_REASON);
-	if (! (reason & 0x80000000)) {
+	if (! (reason & VMX_ENTRY_FAILURE)) {
 		u64 guest_rip = vmcs_read(GUEST_RIP);
 		u32 insn_len = vmcs_read(EXI_INST_LEN);
 		vmcs_write(GUEST_RIP, guest_rip + insn_len);