mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
This commit is contained in:
1 parent
9fd7a4433d
commit
6fc510e1f1
1 file changed
+3
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user