@@ -2558,6 +2558,17 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt,
return r;
}
+ if (kvm_cet_user_supported()) {
+ struct msr_data msr;
+
+ val = GET_SMSTATE(u64, smstate, 0x7f08);
+ msr.index = MSR_KVM_GUEST_SSP;
+ msr.host_initiated = true;
+ msr.data = val;
+ /* Mimic host_initiated access to bypass ssp access check. */
+ kvm_x86_ops.set_msr(ctxt->vcpu, &msr);
+ }
+
return X86EMUL_CONTINUE;
}
#endif
@@ -9833,6 +9833,16 @@ static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, char *buf)
for (i = 0; i < 6; i++)
enter_smm_save_seg_64(vcpu, buf, i);
+
+ if (kvm_cet_user_supported()) {
+ struct msr_data msr;
+
+ msr.index = MSR_KVM_GUEST_SSP;
+ msr.host_initiated = true;
+ /* GUEST_SSP is stored in VMCS at vm-exit. */
+ kvm_x86_ops.get_msr(vcpu, &msr);
+ put_smstate(u64, buf, 0x7f08, msr.data);
+ }
}
#endif