>From 9f1cf4f5f4f143be2d9e87d1b2f4c4cf4c286b69 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 19 Nov 2020 14:11:43 +0100 Subject: [PATCH] --- xen/arch/x86/hvm/vioapic.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 67d4a6237f..9c0423b26e 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -43,7 +43,13 @@ /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */ #define IRQ0_SPECIAL_ROUTING 1 -static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq); +static void _vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq); + +static bool __read_mostly print; +#define vioapic_deliver(vioapic, irq) ({\ + if ( print && irq == 34 ) \ + printk("%s:%d:%s: vioapic_deliver\n", __FILE__, __LINE__, __func__); \ + _vioapic_deliver(vioapic, irq); }) static struct hvm_vioapic *addr_vioapic(const struct domain *d, unsigned long addr) @@ -119,6 +125,16 @@ static uint32_t vioapic_read_indirect(const struct hvm_vioapic *vioapic) if ( redir_index >= vioapic->nr_pins ) { + switch ( vioapic->ioregsel ) + { + case 3: + print = true; + break; + + case 0xf: + print = false; + break; + } gdprintk(XENLOG_WARNING, "apic_mem_readl:undefined ioregsel %x\n", vioapic->ioregsel); break; @@ -391,7 +407,7 @@ static void ioapic_inj_irq( vlapic_set_irq(target, vector, trig_mode); } -static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin) +static void _vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin) { uint16_t dest = vioapic->redirtbl[pin].fields.dest_id; uint8_t dest_mode = vioapic->redirtbl[pin].fields.dest_mode; -- 2.29.2