Re: [Xen-devel] [PATCH] xen/apic: implement io apic read withhypercall

From: Konrad Rzeszutek Wilk
Date: Thu Apr 26 2012 - 11:39:41 EST


> >>
> >> unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
> >> {
> >>         struct physdev_apic apic_op;
> >>         int ret;
> >>
> >>         apic_op.apic_physbase = mpc_ioapic_addr(apic);
> >>         apic_op.reg = reg;
> >>         ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op);
> >>         if (!ret)
> >>                 return apic_op.value;
> >>
> >>         /* emulate register */
> >>         if (reg == 0x1)
> >>                 return 0x00170020;
> >>         else if (reg == 0x0)
> >>                 return apic << 24;
> >>         else
> >>                 return -1;
> >
> >        return 0xfd;
>
> Where does this magic number 0xfd come from?
>
> Both native_io_apic_read and xen_io_apic_read does not return 0xfd on error.

That is correct. But that is what it should have been. Suresh
pointed that out sometime and I managed to lose that part in one of the
commits. The earlier patch of this version did that.

Thought thinking about it this some I am not sure if 0xff is a better
choice... In the end it probably does not matter the slighest.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/