[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260210005449.3125133-1-yosry.ahmed@linux.dev>
Date: Tue, 10 Feb 2026 00:54:45 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yosry Ahmed <yosry.ahmed@...ux.dev>
Subject: [PATCH 0/4] KVM: nSVM: Fix save/restore of next_rip & int_state
next_rip and int_state are both not sync'd correctly to the cached
vmcb12 after VMRUN of L2. Sync the cached vmcb12 is the payload of
nested state, these fields are not saved/restored correctly.
Sync both fields correctly, and extend state_test to check vGIF (already
sync'd field) and next_rip. Checking the interrupt shadow would be
tricky, as GUEST_SYNC() executes several instructions before exiting to
L0, so the interrupt shadow will be consumed before the test can check
for it. L2 could execute STI followed directly by in/out, but that would
not handle transitioning between L2 and L2 correctly (see
ucall_arch_do_ucall()).
Yosry Ahmed (4):
KVM: nSVM: Sync next_rip to cached vmcb12 after VMRUN of L2
KVM: nSVM: Sync int_state to cached vmcb12 after VMRUN of L2
KVM: selftests: Extend state_test to check vGIF
KVM: selftests: Extend state_test to check next_rip
arch/x86/kvm/svm/nested.c | 7 ++--
arch/x86/kvm/svm/svm.c | 26 +++++++++------
tools/testing/selftests/kvm/x86/state_test.c | 35 ++++++++++++++++++++
3 files changed, 55 insertions(+), 13 deletions(-)
base-commit: e944fe2c09f405a2e2d147145c9b470084bc4c9a
--
2.53.0.rc2.204.g2597b5adb4-goog
Powered by blists - more mailing lists