]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/hyperv: Don't use hv apic driver when Secure AVIC is available
authorTianyu Lan <ltykernel@gmail.com>
Thu, 18 Sep 2025 15:00:19 +0000 (11:00 -0400)
committerWei Liu <wei.liu@kernel.org>
Sat, 15 Nov 2025 06:18:14 +0000 (06:18 +0000)
When Secure AVIC is available, the AMD x2apic Secure
AVIC driver will be selected. In that case, have
hv_apic_init() return immediately without doing
anything.

Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Signed-off-by: Tianyu Lan <tiala@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/hyperv/hv_apic.c

index bfde0a3498b900f14b063d09ffd66925ccbfe743..e669053b637d61f07a9615e3ebf67e66960391ce 100644 (file)
@@ -293,6 +293,9 @@ static void hv_send_ipi_self(int vector)
 
 void __init hv_apic_init(void)
 {
+       if (cc_platform_has(CC_ATTR_SNP_SECURE_AVIC))
+               return;
+
        if (ms_hyperv.hints & HV_X64_CLUSTER_IPI_RECOMMENDED) {
                pr_info("Hyper-V: Using IPI hypercalls\n");
                /*