]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: selftests: Extend state_test to check vGIF
authorYosry Ahmed <yosry@kernel.org>
Wed, 25 Feb 2026 00:59:45 +0000 (00:59 +0000)
committerSean Christopherson <seanjc@google.com>
Mon, 2 Mar 2026 23:58:22 +0000 (15:58 -0800)
commit2303ca26fbb005a45aaf5a547465f978df906cb7
tree3408b4b3a40573e0faea25502ab5d3803b5fa89f
parent03bee264f8ebfd39e0254c98e112d033a7aa9055
KVM: selftests: Extend state_test to check vGIF

V_GIF_MASK is one of the fields written by the CPU after VMRUN, and
sync'd by KVM from vmcb02 to cached vmcb12 after running L2. Part of the
reason is to make sure V_GIF_MASK is saved/restored correctly, as the
cached vmcb12 is the payload of nested state.

Verify that V_GIF_MASK is saved/restored correctly in state_test by
enabling vGIF in vmcb12, toggling GIF in L2 at different GUEST_SYNC()
points, and verifying that V_GIF_MASK is correctly propagated to the
nested state.

Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260225005950.3739782-4-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86/state_test.c