• Borislav Petkov's avatar
    x86/kvm: Implement HWCR support · 191c8137
    Borislav Petkov authored
    The hardware configuration register has some useful bits which can be
    used by guests. Implement McStatusWrEn which can be used by guests when
    injecting MCEs with the in-kernel mce-inject module.
    
    For that, we need to set bit 18 - McStatusWrEn - first, before writing
    the MCi_STATUS registers (otherwise we #GP).
    
    Add the required machinery to do so.
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: Jim Mattson <jmattson@google.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: KVM <kvm@vger.kernel.org>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Sean Christopherson <sean.j.christopherson@intel.com>
    Cc: Tom Lendacky <thomas.lendacky@amd.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Yazen Ghannam <Yazen.Ghannam@amd.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    191c8137
kvm_host.h 46.2 KB