mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Confused by local APIC addressing in setup_IO_APIC_irqs()
@ 2001-02-28 18:49 Martin J. Bligh
  2001-02-28 23:04 ` Martin J. Bligh
  0 siblings, 1 reply; 2+ messages in thread
From: Martin J. Bligh @ 2001-02-28 18:49 UTC (permalink / raw)
  To: linux-kernel

It seems to me that we're stuffing a 32 bit bitmask into an
8 bit register ... which seems very odd. Either I don't understand
this properly (probable ;-)) or something's wrong ... can anyone
shed some light on this for me?

It looks like we do this in arch/i386/kernel/io_apic.c (2.4.x):

-----------------------------------------

#define TARGET_CPUS cpu_online_map

void __init setup_IO_APIC_irqs(void)
{
        struct IO_APIC_route_entry entry;
....
entry.dest.logical.logical_dest = TARGET_CPUS;
....
                io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1));
                io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0));

---------------------------------------------

But ....

struct IO_APIC_route_entry {
...
    union {
....
            struct { __u32
                    __reserved_1    : 24,
                    logical_dest    :  8;
            } logical;
    } dest;

---------------------------------------------

But cpu_online map seems to be a 32 bit bitmask of which
CPUs are online .... are we stuffing this directly into an 8-bit
logical desitination register?

Ironically, if I'm understanding this right, it kind of works anyway
for most systems - the low nibble of the logical ID is a bitmask
anyway, so it works normally for up to 4 way. For 8 way or more,
the high nibble will be set to 1111, which is the broadcast cluster ID,
so it'll direct interrupts anywhere .... but I can't believe that was
intentional ;-) For a start, a 7 way system would send to some
non-existant cluster ID ....

Any insights would be much appreciated,

Thanks,

Martin.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Confused by local APIC addressing in setup_IO_APIC_irqs()
  2001-02-28 18:49 Confused by local APIC addressing in setup_IO_APIC_irqs() Martin J. Bligh
@ 2001-02-28 23:04 ` Martin J. Bligh
  0 siblings, 0 replies; 2+ messages in thread
From: Martin J. Bligh @ 2001-02-28 23:04 UTC (permalink / raw)
  To: linux-kernel

> But cpu_online map seems to be a 32 bit bitmask of which
> CPUs are online .... are we stuffing this directly into an 8-bit
> logical desitination register?
>
> Ironically, if I'm understanding this right, it kind of works anyway
> for most systems - the low nibble of the logical ID is a bitmask
> anyway, so it works normally for up to 4 way. For 8 way or more,
> the high nibble will be set to 1111, which is the broadcast cluster ID,
> so it'll direct interrupts anywhere .... but I can't believe that was
> intentional ;-) For a start, a 7 way system would send to some
> non-existant cluster ID ....

Damn ... sorry - figured this out. The way Linux is doing it will work
up to 8 CPUs. I'd forgotten that earlier on in my changes I'd switched
the CPUs local APICs from FLAT logical addressing mode to
CLUSTERED logical addressing mode. I need to switch the IO APIC code
to match ...

Thanks,

Martin.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-28 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-28 18:49 Confused by local APIC addressing in setup_IO_APIC_irqs() Martin J. Bligh
2001-02-28 23:04 ` Martin J. Bligh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®