summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2026-07-31 10:33:38 -0700
committerSean Christopherson <seanjc@google.com>2026-07-31 14:03:09 -0700
commit6fc510e1f10129090aabd5ff352e952bfd82fce9 (patch)
tree0eca68e31857f9196174bffd4d67d8b565107e27
parent9fd7a4433d74fbdb12b14ca8e6e600710b3a11b4 (diff)
downloadlinux-next-6fc510e1f10129090aabd5ff352e952bfd82fce9.tar.gz
linux-next-6fc510e1f10129090aabd5ff352e952bfd82fce9.zip
KVM: selftests: Use port 0x80 in invalid nVMX guest state test
Use port 0x80 instead of 0x2000 to trigger an L2 => L0 VM-Exit in the nVMX invalid guest state test, so that the test can be expanded to cover RSM in the L2 => SMI => L2 path without having to manually encode a MOV to DX (the immediate form of IN only supports an imm8). Use port 0x80 as it's a well-known port and is used by other tests, e.g. in the coalesced I/O test. Link: https://patch.msgid.link/20260731173340.2644656-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
-rw-r--r--tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c b/tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c
index 6d88c54f69fa..87f242704030 100644
--- a/tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c
+++ b/tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c
@@ -9,7 +9,7 @@
#include "kselftest.h"
-#define ARBITRARY_IO_PORT 0x2000
+#define ARBITRARY_IO_PORT 0x80
static struct kvm_vm *vm;
@@ -19,8 +19,8 @@ static void l2_guest_code(void)
* Generate an exit to L0 userspace, i.e. main(), via I/O to an
* arbitrary port.
*/
- asm volatile("inb %%dx, %%al"
- : : [port] "d" (ARBITRARY_IO_PORT) : "rax");
+ asm volatile("inb $" __stringify(ARBITRARY_IO_PORT) ", %%al"
+ ::: "rax");
}
static void l1_guest_code(struct vmx_pages *vmx_pages)