X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fapic.c;h=6e036a5833517197fd16f22196df1ed94eaa120b;hb=3412245c776566ff54b42d0a550a77e00f398280;hp=cb588233fd784a6153c52b2fa343a01b9de82a1b;hpb=4bc3ee757b44d3e466fd89e348106c47fa5511ee;p=palacios.git diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index cb58823..6e036a5 100644 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@ -280,6 +280,8 @@ static int activate_apic_irq(struct apic_state * apic, uint32_t irq_num) { static int apic_do_eoi(struct apic_state * apic) { int i = 0, j = 0; + PrintDebug("Received APIC EOI\n"); + // We iterate backwards to find the highest priority for (i = 31; i >= 0; i--) { uchar_t * svc_major = apic->int_svc_reg + i; @@ -289,6 +291,12 @@ static int apic_do_eoi(struct apic_state * apic) { uchar_t flag = 0x1 << j; if ((*svc_major) & flag) { *svc_major &= ~flag; + +#ifdef CRAY_XT + if (((i * 8) + j) == 238) { + V3_ACK_IRQ(238); + } +#endif return 0; } } @@ -739,14 +747,13 @@ static int apic_write(addr_t guest_addr, void * src, uint_t length, void * priv_ // Action Registers + case EOI_OFFSET: + // do eoi + apic_do_eoi(apic); + break; + case INT_CMD_LO_OFFSET: case INT_CMD_HI_OFFSET: - case EOI_OFFSET: - { - // do eoi - apic_do_eoi(apic); - break; - } // Unhandled Registers case EXT_INT_LOC_VEC_TBL_OFFSET0: case EXT_INT_LOC_VEC_TBL_OFFSET1: @@ -807,6 +814,16 @@ static int apic_get_intr_number(void * private_data) { } static int apic_raise_intr(void * private_data, int irq) { +#ifdef CRAY_XT + // The Seastar is connected directly to the LAPIC via LINT0 on the ICC bus + + if (irq == 238) { + struct vm_device * dev = (struct vm_device *)private_data; + struct apic_state * apic = (struct apic_state *)dev->private_data; + + return activate_apic_irq(apic, irq); + } +#endif return 0; } @@ -826,6 +843,12 @@ static int apic_begin_irq(void * private_data, int irq) { *svc_location |= flag; *req_location &= ~flag; +#ifdef CRAY_XT + if ((irq == 238) || (irq == 239)) { + PrintError("APIC: Begin IRQ %d (ISR=%x), (IRR=%x)\n", irq, *svc_location, *req_location); + } +#endif + return 0; }