diff options
| author | Shivansh Dhiman <shivansh.dhiman@amd.com> | 2026-10-08 06:26:43 +0000 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-11-09 17:01:31 -0800 |
| commit | bdd05706f146a6aa3d6e0847fc3b4c61bf40901e (patch) | |
| tree | df0a32ed532b9faf140ef32f94def6f6c1561433 /scripts/Makefile.thinlto | |
| parent | b2ddd6af0646503364e23c021f5d2748473c9d4e (diff) | |
KVM: SVM: Clear VMCB save area instead of entire VMCB on shutdown intercept
The AMD APM previously stated that after an intercepted shutdown, the
entire VMCB state is undefined. In practice, only the save area is
undefined and most of the control area remains valid. Revision 3.45 of
the APM now makes this explicit:
"After an intercepted shutdown, the VMCB control area is valid (with
the exception of offsets 60h, 61h, and 68h) and the VMCB state save
area is undefined."
KVM zeroes the entire VMCB before INITing the vCPU based on the old
wording, discarding control area state that hardware preserves.
Clear only the save area and the three undefined control area fields
(int_ctl[15:0] and int_state) in line with the updated APM.
Also explicitly clear EVENTINJ. Hardware clears it on #VMEXIT, but only
if VMRUN fully entered the guest. Clearing it here should be
unnecessary, since a shutdown can only happen if the guest actually ran.
Do so anyway, as there is no reason to carry a stale event across the
vCPU reset, and the cost is negligible.
Signed-off-by: Shivansh Dhiman <shivansh.dhiman@amd.com>
Link: https://patch.msgid.link/20261008062643.1183018-1-shivansh.dhiman@amd.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
