Seems there is a bug in qemu where the APIC version is being checked as
value 3. However, it should be 1.

static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
{
...
    switch(index) {
    case 0x03: /* version */
        val = 0x11 | ((APIC_LVT_NB - 1) << 16); /* version 0x11 */
        break;

Comparing to KVM, it has the correct value:

static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
                      unsigned long addr,
                      unsigned long length)
{
    unsigned long result = 0;

    switch (ioapic->ioregsel) {
    case IOAPIC_REG_VERSION:
        result = ((((IOAPIC_NUM_PINS - 1) & 0xff) << 16)
              | (IOAPIC_VERSION_ID & 0xff));
        break;

./virt/kvm/ioapic.h:#define IOAPIC_REG_VERSION 0x01

I hit this as we have on OS that was checking for the number of IRQ pins
and we were falling into the default case.

Is this a known issue? What's the best way to submit a patch/get this
committed if it is an accepted bug?

tx

neil

Reply via email to