[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V2 16/25] x86/vioapic: Hook interrupt delivery of vIOAPIC
On 2017年08月23日 17:59, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:17PM -0400, Lan Tianyu wrote: >> From: Chao Gao <chao.gao@xxxxxxxxx> >> >> When irq remapping is enabled, IOAPIC Redirection Entry may be in remapping >> format. If that, generate an irq_remapping_request and call the common >> VIOMMU abstraction's callback to handle this interrupt request. Device >> model is responsible for checking the request's validity. >> >> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx> >> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx> >> --- >> xen/arch/x86/hvm/vioapic.c | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c >> index 72cae93..322f33c 100644 >> --- a/xen/arch/x86/hvm/vioapic.c >> +++ b/xen/arch/x86/hvm/vioapic.c >> @@ -30,6 +30,7 @@ >> #include <xen/lib.h> >> #include <xen/errno.h> >> #include <xen/sched.h> >> +#include <xen/viommu.h> >> #include <public/hvm/ioreq.h> >> #include <asm/hvm/io.h> >> #include <asm/hvm/vpic.h> >> @@ -39,6 +40,8 @@ >> #include <asm/event.h> >> #include <asm/io_apic.h> >> >> +#include "../../../drivers/passthrough/vtd/vtd.h" > > Ouch, that's not very nice. Why do you need this? I though that you > introduced an arch-agnostic layer that should be suitable? Yes, agree. So far, I think of introducing a callback of checking remapping mode in viommu ops and let vIOMMU device model to check whether vioapic is in interrupt remapping mode. Device model can use Intel or AMD IOAPIC remapping format to parse IOAPIC entry. > >> /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */ >> #define IRQ0_SPECIAL_ROUTING 1 >> >> @@ -387,9 +390,20 @@ static void vioapic_deliver(struct hvm_vioapic >> *vioapic, unsigned int pin) >> struct vlapic *target; >> struct vcpu *v; >> unsigned int irq = vioapic->base_gsi + pin; >> + struct IO_APIC_route_remap_entry rte = { { vioapic->redirtbl[pin].bits >> } }; > > Designated initializers please. > > Roger. > -- Best regards Tianyu Lan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |