Skip to content

vmm: serialize IA32_XSS and CET MSRs#10

Merged
saleemrashid merged 1 commit intov1.14.4-flyfrom
rm/guest-shstk
Apr 23, 2026
Merged

vmm: serialize IA32_XSS and CET MSRs#10
saleemrashid merged 1 commit intov1.14.4-flyfrom
rm/guest-shstk

Conversation

@rianmcguirefly
Copy link
Copy Markdown
Member

@rianmcguirefly rianmcguirefly commented Apr 23, 2026

Kernel v6.18 enables shadow stack virtualization for AMD SVM guests (commit 8db428fd5229b, "KVM: SVM: Enable shadow stack virtualization for SVM"). SHSTK and the CET_USER supervisor xstate are both advertised in the guest's CPUID.

Linux enables every supervisor xstate the CPU enumerates (regardless of whether CONFIG_X86_USER_SHADOW_STACK is enabled), so guests set MSR_IA32_XSS.CET_USER at boot.

Firecracker's SERIALIZABLE_MSR_RANGES does not include MSR_IA32_XSS, so it's 0 on resume from snapshot. If MSR_IA32_XSS isn't round-tripped, the first XRSTORS instruction after resume faults: the processor refuses to restore a buffer whose XCOMP_BV references CET_USER while IA32_XSS.CET_USER is unset.

Kernel commit c0a5f29891222 ("KVM: x86: Report XSS as to-be-saved if there are supported features") added MSR_IA32_XSS to KVM's msrs_to_save_base[] for this reason. Also save the related CET MSRs from the same kernel patch series (6a11c860d8a4a, "KVM: x86: Report KVM supported CET MSRs as to-be-saved"): U_CET, S_CET, PL0_SSP..PL3_SSP, INT_SSP_TAB.

Safe on older kernels: get_msrs_to_save() intersects SERIALIZABLE_MSR_RANGES with KVM_GET_MSR_INDEX_LIST, and pre-v6.18 kernels don't report these MSRs.

@rianmcguirefly rianmcguirefly marked this pull request as ready for review April 23, 2026 04:37
@saleemrashid saleemrashid changed the base branch from v1.14.2-fly to v1.14.4-fly April 23, 2026 13:21
Kernel v6.18 enables shadow stack virtualization for AMD SVM guests (commit
8db428fd5229b, "KVM: SVM: Enable shadow stack virtualization for SVM"). SHSTK
and the CET_USER supervisor xstate are both advertised in the guest's CPUID.

Linux enables every supervisor xstate the CPU enumerates (regardless of whether
CONFIG_X86_USER_SHADOW_STACK is enabled), so guests set MSR_IA32_XSS.CET_USER at
boot.

Firecracker's SERIALIZABLE_MSR_RANGES does not include MSR_IA32_XSS, so it's 0
on resume from snapshot. If MSR_IA32_XSS isn't round-tripped, the first XRSTORS
instruction after resume faults: the processor refuses to restore a buffer whose
XCOMP_BV references CET_USER while IA32_XSS.CET_USER is unset.

Kernel commit c0a5f29891222 ("KVM: x86: Report XSS as to-be-saved if there are
supported features") added MSR_IA32_XSS to KVM's msrs_to_save_base[] for this
reason. Also save the related CET MSRs from the same kernel patch series
(6a11c860d8a4a, "KVM: x86: Report KVM supported CET MSRs as to-be-saved"):
U_CET, S_CET, PL0_SSP..PL3_SSP, INT_SSP_TAB.

Safe on older kernels: get_msrs_to_save() intersects SERIALIZABLE_MSR_RANGES
with KVM_GET_MSR_INDEX_LIST, and pre-v6.18 kernels don't report these MSRs.
@saleemrashid saleemrashid merged commit 8256fa7 into v1.14.4-fly Apr 23, 2026
3 checks passed
@saleemrashid saleemrashid deleted the rm/guest-shstk branch April 23, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants