X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fapic.c;h=5afe31dac1bd41218e6d7bd8f111ec0ec785d5d5;hb=d7645f84d2e53a8f698960dff574fb6ae4a8a3c7;hp=0ce5c7720d6e1a01522694ed53a3fc57b4e5cb37;hpb=f737ee43ce5cef6dbebf40940482811bfd3169b8;p=palacios.git diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index 0ce5c77..5afe31d 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; @@ -291,6 +293,12 @@ static int apic_do_eoi(struct apic_state * apic) { *svc_major &= ~flag; #ifdef CRAY_XT + + if ((((i * 8) + j) == 238) || + (((i * 8) + j) == 239)) { + PrintError("Acking IRQ %d\n", ((i * 8) + j)); + } + if (((i * 8) + j) == 238) { V3_ACK_IRQ(238); } @@ -745,14 +753,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: @@ -842,6 +849,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; } @@ -911,7 +924,7 @@ static void apic_update_time(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv } tmr_ticks = cpu_cycles >> shift_num; - // PrintDebug("Timer Ticks: %p\n", (void *)tmr_ticks); + PrintDebug("Timer Ticks: %p\n", (void *)tmr_ticks); if (tmr_ticks < apic->tmr_cur_cnt) { apic->tmr_cur_cnt -= tmr_ticks; @@ -922,6 +935,7 @@ static void apic_update_time(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv // raise irq PrintDebug("Raising APIC Timer interrupt (periodic=%d) (icnt=%d) (div=%d)\n", apic->tmr_vec_tbl.tmr_mode, apic->tmr_init_cnt, shift_num); + if (activate_internal_irq(apic, APIC_TMR_INT) == -1) { PrintError("Could not raise Timer interrupt\n"); }