mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
x86/apic: Allow NMI to be injected from hypervisor for Secure AVIC
Secure AVIC requires the "AllowedNmi" bit in the Secure AVIC Control MSR to be set for an NMI to be injected from the hypervisor. So set it. Signed-off-by: Kishon Vijay Abraham I <kvijayab@amd.com> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Tianyu Lan <tiala@microsoft.com> Link: https://lore.kernel.org/20250828111243.208946-1-Neeraj.Upadhyay@amd.com
This commit is contained in:
committed by
Borislav Petkov (AMD)
parent
9de196f519
commit
869e36b966
@@ -703,6 +703,9 @@
|
||||
#define MSR_AMD64_SNP_SECURE_AVIC BIT_ULL(MSR_AMD64_SNP_SECURE_AVIC_BIT)
|
||||
#define MSR_AMD64_SNP_RESV_BIT 19
|
||||
#define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
|
||||
#define MSR_AMD64_SAVIC_CONTROL 0xc0010138
|
||||
#define MSR_AMD64_SAVIC_ALLOWEDNMI_BIT 1
|
||||
#define MSR_AMD64_SAVIC_ALLOWEDNMI BIT_ULL(MSR_AMD64_SAVIC_ALLOWEDNMI_BIT)
|
||||
#define MSR_AMD64_RMP_BASE 0xc0010132
|
||||
#define MSR_AMD64_RMP_END 0xc0010133
|
||||
#define MSR_AMD64_RMP_CFG 0xc0010136
|
||||
|
||||
@@ -328,6 +328,8 @@ static void savic_setup(void)
|
||||
res = savic_register_gpa(gpa);
|
||||
if (res != ES_OK)
|
||||
snp_abort();
|
||||
|
||||
native_wrmsrq(MSR_AMD64_SAVIC_CONTROL, gpa | MSR_AMD64_SAVIC_ALLOWEDNMI);
|
||||
}
|
||||
|
||||
static int savic_probe(void)
|
||||
|
||||
Reference in New Issue
Block a user