Commit b13c66da authored by Juerg Haefliger's avatar Juerg Haefliger Committed by Juerg Haefliger

UBUNTU: SAUCE: Restore the IBRS host state on VMEXIT

BugLink: https://bugs.launchpad.net/bugs/1764956

IBRS in Ubuntu can be controlled dynamically from userspace. Make sure
the correct state is restored on VMEXIT.
Suggested-by: default avatarGavin Guo <gavin.guo@canonical.com>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarGavin Guo <gavin.guo@canonical.com>
Tested-by: default avatarGavin Guo <gavin.guo@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent fea54182
...@@ -189,6 +189,10 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest) ...@@ -189,6 +189,10 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest)
if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD)) if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD))
hostval |= ssbd_tif_to_spec_ctrl(ti->flags); hostval |= ssbd_tif_to_spec_ctrl(ti->flags);
/* IBRS dynamically controlled in MSR_SPEC_CTRL */
if (ibrs_enabled)
hostval |= SPEC_CTRL_IBRS;
if (hostval != guestval) { if (hostval != guestval) {
msrval = setguest ? guestval : hostval; msrval = setguest ? guestval : hostval;
wrmsrl(MSR_IA32_SPEC_CTRL, msrval); wrmsrl(MSR_IA32_SPEC_CTRL, msrval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment