[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 10/42] xen/riscv: leave the h/w source of an IRQ routed to a guest inactive



intc_route_irq_to_guest() has set the h/w IRQ to the trigger type given
by the host DT. A guest configures its h/w sources itself, though:
vAPLIC passes the guest's writes to their sourcecfg[] through to the h/w
registers. So whatever Xen writes there at routing time gets
overwritten, and until then a source the guest hasn't configured yet
isn't in its reset state, Inactive.

Put the h/w source into Inactive instead, by IRQ_TYPE_NONE. That also
covers an IRQ an earlier domain has left configured, as nothing resets
the h/w source when the IRQ is released. desc->arch.type stays as it is,
and the guest learns the trigger type from its DT as before.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
This patch doesn't depend on the rest of the series, but what it
prevents only shows up later in it:
 - from "xen/riscv: introduce IMSIC h/w interrupt file attaching to
   vcpu" on, the h/w target register of a guest's h/w source points at a
   real guest interrupt file, so a source left active could deliver an
   MSI there before the guest has configured it;
 - "xen/riscv: emulate the pending bits and MSIs of virtual vAPLIC
   sources" reads the h/w pending bits of h/w sources as they are, and
   these stay in line with the guest's view of the source being
   Inactive only if the h/w source is Inactive as well.
---
Changes in v4:
 - New patch.
---
---
 xen/arch/riscv/intc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index ac9c798ec36b..cdbc039d0258 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -95,7 +95,7 @@ int intc_route_irq_to_guest(const struct domain *d, unsigned 
int virq,
     desc->handler = intc_hw_ops->guest_irq_type;
     desc->status |= IRQ_GUEST;
 
-    intc_set_irq_type(desc, desc->arch.type);
+    intc_set_irq_type(desc, IRQ_TYPE_NONE);
     intc_set_irq_priority(desc, priority);
 
     /* Connect @virq to the h/w IRQ: it isn't a virtual source. */
-- 
2.56.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.