]> xenbits.xensource.com Git - xen.git/commit
x86/msr: Fix migration compatibility issue with MSR_SPEC_CTRL
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 Jan 2022 19:55:02 +0000 (19:55 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 27 Jan 2022 17:59:18 +0000 (17:59 +0000)
commit969a57f73f6b011b2ebf4c0ab1715efc65837335
treeadf95f2f6adea8f26a9770f96e17901f78ba57f5
parentd940ce8e2a85100223fb8b3ab96407fdcec7f02c
x86/msr: Fix migration compatibility issue with MSR_SPEC_CTRL

This bug existed in early in 2018 between MSR_SPEC_CTRL arriving in microcode,
and SSBD arriving a few months later.  It went unnoticed presumably because
everyone was busy rebooting everything.

The same bug will reappear when adding PSFD support.

Clamp the guest MSR_SPEC_CTRL value to that permitted by CPUID on migrate.
The guest is already playing with reserved bits at this point, and clamping
the value will prevent a migration to a less capable host from failing.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/include/asm/msr.h
xen/arch/x86/msr.c