cpufeat_mask() yields an unsigned integer constant. As a result, taking its
complement causes zero extention rather than sign extention.
The result is that, when a guest OS has OXSAVE disabled, all features in 1d
are hidden from native CPUID. Amongst other things, this causes the early
code in Linux to find no LAPIC, but for everything to appear fine later when
userspace is up and running.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
*/
if (next && is_pv_vcpu(next) && !is_idle_vcpu(next) &&
!(next->arch.pv_vcpu.ctrlreg[4] & X86_CR4_OSXSAVE))
- val &= ~cpufeat_mask(X86_FEATURE_OSXSAVE);
+ val &= ~(uint64_t)cpufeat_mask(X86_FEATURE_OSXSAVE);
if (unlikely(these_masks->_1cd != val)) {
wrmsrl(msr_basic, val);