[SRU][Xenial][PATCH] UBUNTU: SAUCE: Restore the IBRS host state on VMEXIT
Gavin Guo
gavin.guo at canonical.com
Fri Jan 18 09:12:32 UTC 2019
On Tue, Jan 15, 2019 at 4:33 PM Juerg Haefliger
<juerg.haefliger at canonical.com> wrote:
>
> 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: Gavin Guo <gavin.guo at canonical.com>
> Signed-off-by: Juerg Haefliger <juergh at canonical.com>
> ---
> arch/x86/kernel/cpu/bugs.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 15867c20ed1c..63d5b84e680b 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -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))
> 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) {
> msrval = setguest ? guestval : hostval;
> wrmsrl(MSR_IA32_SPEC_CTRL, msrval);
> --
> 2.19.1
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
The kernel with the patch based on version v4.4.0-141.167 has been
tested[1] and the bug cannot be reproduced.
[1]. https://kernel.ubuntu.com/~juergh/lp1764956/
Acked-by: Gavin Guo <gavin.guo at canonical.com>
Tested-by: Gavin Guo <gavin.guo at canonical.com>
More information about the kernel-team
mailing list