提交 f1cdecf5 编写于 作者: S Sean Christopherson 提交者: Paolo Bonzini

KVM: x86: Ensure all logical CPUs have consistent reserved cr4 bits

Check the current CPU's reserved cr4 bits against the mask calculated
for the boot CPU to ensure consistent behavior across all CPUs.
Signed-off-by: NSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 b11306b5
...@@ -9461,6 +9461,13 @@ void kvm_arch_hardware_unsetup(void) ...@@ -9461,6 +9461,13 @@ void kvm_arch_hardware_unsetup(void)
int kvm_arch_check_processor_compat(void) int kvm_arch_check_processor_compat(void)
{ {
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
WARN_ON(!irqs_disabled());
if (kvm_host_cr4_reserved_bits(c) != cr4_reserved_bits)
return -EIO;
return kvm_x86_ops->check_processor_compatibility(); return kvm_x86_ops->check_processor_compatibility();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册