Re: [PATCH v2 0/5] KVM: nSVM: Fix save/restore of NextRIP & interrupt shadow
From: Sean Christopherson
Date: Thu Mar 05 2026 - 12:17:01 EST
On Wed, 11 Feb 2026 16:28:37 +0000, Yosry Ahmed wrote:
> NextRIP and interrupt shadow 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()).
>
> [...]
Applied to kvm-x86 nested (except for patch 3), thanks!
[1/5] KVM: nSVM: Sync NextRIP to cached vmcb12 after VMRUN of L2
https://github.com/kvm-x86/linux/commit/778d8c1b2a6f
[2/5] KVM: nSVM: Sync interrupt shadow to cached vmcb12 after VMRUN of L2
https://github.com/kvm-x86/linux/commit/03bee264f8eb
[3/5] KVM: nSVM: Move sync'ing to vmcb12 cache after completing interrupts
(DROP)
[4/5] KVM: selftests: Extend state_test to check vGIF
https://github.com/kvm-x86/linux/commit/2303ca26fbb0
[5/5] KVM: selftests: Extend state_test to check next_rip
https://github.com/kvm-x86/linux/commit/e5cdd34b5f74
--
https://github.com/kvm-x86/linux/tree/next