hv: vioapic: correct the ioapic id mask

The APIC ID field should be bit 24:27 in IOAPIC Identification register.
The bits 28:31 are reserved bits which need to be avoid touched.

Signed-off-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yu Wang 2018-08-01 13:29:55 +00:00 committed by lijinxia
parent 68cbdb39de
commit 86de47b142
1 changed files with 2 additions and 1 deletions

View File

@ -51,6 +51,7 @@ struct vioapic {
#define VIOAPIC_LOCK(vioapic) spinlock_obtain(&((vioapic)->mtx))
#define VIOAPIC_UNLOCK(vioapic) spinlock_release(&((vioapic)->mtx))
#define IOAPIC_ID_MASK 0x0f000000U
#define MASK_ALL_INTERRUPTS 0x0001000000010000UL
#define IOAPIC_RTE_LOW_INTVEC ((uint32_t)IOAPIC_RTE_INTVEC)
@ -320,7 +321,7 @@ vioapic_indirect_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
regnum = addr & 0xffUL;
switch (regnum) {
case IOAPIC_ID:
vioapic->id = data & APIC_ID_MASK;
vioapic->id = data & IOAPIC_ID_MASK;
break;
case IOAPIC_VER:
case IOAPIC_ARB: