Skip to content

Commit 3a546de

Browse files
committed
x86/hyperv: Dispatch redirected proxy interrupts
Once a redirected proxy interrupt has been configured, the IOMMU at the host will post it directly to a hardware vector in the VTL2 guest. Calculate the index of the proxy interrupt based on the hardware interrupt vector and indicate that it needs to be asserted. Signed-off-by: Ricardo Neri <[email protected]>
1 parent c11eb8a commit 3a546de

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,31 @@ static DEFINE_RAW_SPINLOCK(redirected_proxy_intr_lock);
177177

178178
DEFINE_IDTENTRY_IRQ(hv_vtl_redirected_interrupt)
179179
{
180+
unsigned long flags;
181+
u32 proxy_intr;
182+
183+
if (!hv_redirected_proxy_intr_handler) {
184+
pr_err_ratelimited("redirected intr handler not defined. hw intr %u not handled\n", vector);
185+
goto out;
186+
}
187+
188+
if (vector < FIRST_HV_VTL_REDIRECTED_VECTOR || vector > FIRST_SYSTEM_VECTOR) {
189+
pr_err_ratelimited("redirected hw vector %u is invalid\n", vector);
190+
goto out;
191+
}
192+
193+
raw_spin_lock_irqsave(&redirected_proxy_intr_lock, flags);
194+
proxy_intr = redirected_proxy_intr[vector - FIRST_HV_VTL_REDIRECTED_VECTOR];
195+
raw_spin_unlock_irqrestore(&redirected_proxy_intr_lock, flags);
196+
197+
if (proxy_intr == REDIRECTED_VECTOR_UNDEF) {
198+
pr_err_ratelimited("hw vector %u not redictected to proxy interrupt\n", vector);
199+
goto out;
200+
}
201+
202+
hv_redirected_proxy_intr_handler(proxy_intr);
203+
204+
out:
180205
apic_eoi();
181206
}
182207
#endif

0 commit comments

Comments
 (0)