summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianyu Lan <ltykernel@gmail.com>2025-09-18 18:00:22 +0300
committerWei Liu <wei.liu@kernel.org>2025-11-15 09:18:14 +0300
commit5e52db91d112bd1da00b520e21f570db14105bde (patch)
tree39ee6a77d8e192e4e8fa539cb04a1121e88e916f
parentc52c957e41e75d3f74157acffc53cefa3089ffa7 (diff)
downloadlinux-5e52db91d112bd1da00b520e21f570db14105bde.tar.xz
x86/hyperv: Allow Hyper-V to inject STIMER0 interrupts
When Secure AVIC is enabled, call Secure AVIC function to allow Hyper-V to inject STIMER0 interrupt. Reviewed-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Signed-off-by: Tianyu Lan <tiala@microsoft.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
-rw-r--r--arch/x86/hyperv/hv_init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index e890fd37e9c2..21ed8963fafd 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -170,6 +170,10 @@ static int hv_cpu_init(unsigned int cpu)
wrmsrq(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
}
+ /* Allow Hyper-V stimer vector to be injected from Hypervisor. */
+ if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE)
+ apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, true);
+
return hyperv_init_ghcb();
}
@@ -277,6 +281,9 @@ static int hv_cpu_die(unsigned int cpu)
*ghcb_va = NULL;
}
+ if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE)
+ apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, false);
+
hv_common_cpu_die(cpu);
if (hv_vp_assist_page && hv_vp_assist_page[cpu]) {