X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fapic.c;h=80f3d30f14e1f0821e31250ad424292d5ead4a2d;hb=98cbb1fefedf39bd207e517838cc1a76413e2529;hp=62fbb4d6a49b4e449afdcc3f059523e2f30a2a52;hpb=d61e28b50d54153a18efa5697a2aecc2e52098bc;p=palacios.git diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index 62fbb4d..80f3d30 100644 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@ -297,7 +297,10 @@ static void init_apic_state(struct apic_state * apic, uint32_t id) { apic->tmr_cur_cnt = 0x00000000; apic->missed_ints = 0; - apic->lapic_id.val = id; + // note that it's the *lower* 24 bits that are + // reserved, not the upper 24. + apic->lapic_id.val = 0; + apic->lapic_id.apic_id = id; apic->ipi_state = INIT_ST; @@ -787,13 +790,13 @@ static struct apic_state * find_physical_apic(struct apic_dev_state * apic_dev, if ( (dst_idx > 0) && (dst_idx < apic_dev->num_apics) ) { // see if it simply is the core id - if (apic_dev->apics[dst_idx].lapic_id.val == dst_idx) { + if (apic_dev->apics[dst_idx].lapic_id.apic_id == dst_idx) { dst_apic = &(apic_dev->apics[dst_idx]); } } for (i = 0; i < apic_dev->num_apics; i++) { - if (apic_dev->apics[i].lapic_id.val == dst_idx) { + if (apic_dev->apics[i].lapic_id.apic_id == dst_idx) { dst_apic = &(apic_dev->apics[i]); } } @@ -1433,7 +1436,6 @@ static int apic_write(struct guest_info * core, addr_t guest_addr, void * src, u case INT_CMD_HI_OFFSET: { apic->int_cmd.hi = op_val; //V3_Print("apic %u: core %u: writing command high=0x%x\n", apic->lapic_id.val, core->vcpu_id,apic->int_cmd.hi); - break; } // Unhandled Registers