From: Jack Lange Date: Wed, 2 Mar 2011 22:21:39 +0000 (-0600) Subject: Merge branch 'devel' of ssh://palacios@newskysaw/home/palacios/palacios into devel X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=c7b8465c6a056d5603e8733b280fefe6809ed738;p=palacios.git Merge branch 'devel' of ssh://palacios@newskysaw/home/palacios/palacios into devel Conflicts: palacios/src/devices/apic.c --- c7b8465c6a056d5603e8733b280fefe6809ed738 diff --cc palacios/src/devices/apic.c index ca991a3,427ec79..dab92b6 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@@ -37,8 -33,10 +33,8 @@@ #ifndef CONFIG_DEBUG_APIC #undef PrintDebug #define PrintDebug(fmt, args...) - -#endif - +#else + -#ifdef CONFIG_DEBUG_APIC static char * shorthand_str[] = { "(no shorthand)", "(self)", @@@ -56,10 -54,13 +52,9 @@@ static char * deliverymode_str[] = "(Start Up)", "(ExtInt)", }; -#endif - -// Temporary removal of locking -#define v3_lock(p) p=p -#define v3_unlock(p) p=p +#endif - typedef enum { APIC_TMR_INT, APIC_THERM_INT, APIC_PERF_INT, APIC_LINT0_INT, APIC_LINT1_INT, APIC_ERR_INT } apic_irq_type_t; @@@ -747,28 -797,50 +763,34 @@@ static int route_ipi(struct apic_dev_st icr->dst, icr->val); -#if 0 - if (icr->vec!=48) { - V3_Print("apic: IPI %s %u from apic %p to %s %s %u (icr=0x%llx)\n", - deliverymode_str[icr->del_mode], - icr->vec, - src_apic, - (icr->dst_mode == 0) ? "(physical)" : "(logical)", - shorthand_str[icr->dst_shorthand], - icr->dst, - icr->val); - } - -#endif - + switch (icr->dst_shorthand) { case APIC_SHORTHAND_NONE: // no shorthand if (icr->dst_mode == APIC_DEST_PHYSICAL) { - if (icr->dst >= apic_dev->num_apics) { + dest_apic=find_physical_apic(apic_dev,icr); + + if (dest_apic==NULL) { PrintError("apic: Attempted send to unregistered apic id=%u\n", icr->dst); - goto route_ipi_out_bad; + return -1; } + - - //V3_Print("apic: phsyical destination of %u (apic %u at 0x%p)\n", icr->dst,dest_apic->lapic_id.val,dest_apic); + dest_apic = &(apic_dev->apics[icr->dst]); + - V3_Print("apic: phsyical destination of %u (apic %u at 0x%p)\n", icr->dst,dest_apic->lapic_id.val,dest_apic); + - v3_lock(dest_apic->lock); if (deliver_ipi(src_apic, dest_apic, icr->vec, icr->del_mode) == -1) { PrintError("apic: Could not deliver IPI\n"); - v3_unlock(dest_apic->lock); - goto route_ipi_out_bad; + return -1; } - v3_unlock(dest_apic->lock); + - //V3_Print("apic: done\n"); + V3_Print("apic: done\n"); + + } else if (icr->dst_mode == APIC_DEST_LOGICAL) { if (icr->del_mode!=APIC_LOWEST_DELIVERY ) {