]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm: Implement HWCR support
authorBorislav Petkov <bp@suse.de>
Thu, 18 Apr 2019 16:32:50 +0000 (18:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Apr 2019 19:32:22 +0000 (21:32 +0200)
commitb05debb369d5d6b0b3ad365d574e2bec680b430a
treeff52632c417b12349903c076c23e0c06eeb82ea5
parenta9e5e27df56447ed820efb1cde0427126b23d189
x86/kvm: Implement HWCR support

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: Borislav 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: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c