Re: APIC questions

From: Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Date: Fri Mar 24 2000 - 12:37:33 EST


On Fri, 24 Mar 2000, Andrew Morton wrote:

> - __setup_APIC_LVTT() is altering bits in the LVTT register which
> 24319202.pdf says are reserved:
> SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV).
>
> Where could I find the documentation for these bits?

1. "82489DX Advanced Programmable Interrupt Controller", Intel order
number 290446.

2. "82489DX User's Manual, AP-388", Intel order number 292116.

However getting these dated 1993 docs from Intel can be a real PITA.

 APIC_TIMER_BASE_DIV means to use the output of the internal divider (that
is configured by the Divider Configuration Register) as the time base
input for the timer. This is compatible with the integrated APIC that
newer Pentium and P6 processors include.

 Other possibilities are as follows:

- APIC_TIMER_BASE_CLKIN, which means to use the APIC clock directly (i.e.
passing by the divider),

- APIC_TIMER_BASE_TMBASE, which means to use the TMBASE input (a separate,
independent pin) which is present on 82489DX APIC chips.

 Additionally, the divider can be configured to use either the APIC clock
or the TMBASE input as its input source. Using of the APIC clock is
compatible with the integrated APIC. You can choose TMBASE by setting an
appropriate bit in the DCR, as defined by the APIC_TDR_DIV_TMBASE macro.

> If they are defined for later processors, is this
> usage safe for older processors?

 It's actually the reverse -- they are not defined for later APICs
anymore. The 82489DX is the first APIC implementation, introduced late
1992 for 486-based systems and with early Pentium (i.e. these at 60/66) in
mind. The reserved bits of integrated APICs which are defined for 82489DX
chips are ignored for compatibility, so there is no problem.

> - When the SMP kernel is run on a UP, the APIC is disabled (APIC_SPIV:8
> == 0). This causes calibrate_APIC_clock() to return zero and a number
> of things which should be non-zero end up being zero. This isn't a
> problem - just something to keep an eye on.

 Hmm, it looks like we have a bug here when there is no APIC at all.
Ingo, what about the following patch (it's against 2.3.42 but it should
work against 2.3.99, too)?

 On the other hand if we have a SMP board with a single CPU we always
enable APIC anyway, so there is no problem.

> - calibrate_APIC_clock() will get a divide-by-zero if someone sets (HZ <
> 10)...

 But why would anyone want to do this? I believe if someone sets HZ to 0,
the resulting kernel will not work even if compiled for UP... In other
words one gets what he deserves if messing with the kernel carelessly.

> - Where could I find docs for the IO-APIC?

 The two mentioned docs describe the I/O APIC unit of the 82489DX (the
chip includes one local unit and one I/O unit in a single core).

 Newer I/O APICs are documented in the following datasheets:

1. "82093AA I/O Advanced Programmable Interrupt Controller (IOAPIC)",
Intel order number 290566.

2. "82378ZB System I/O (SIO) and 82379AB System I/O APIC (SIO.A)", Intel
order number 290571.

3. "82374EB/82374SB EISA System Component (ESC)" (I don't have an order
number handy).

Check Intel's developer site -- they used to be available online.

 I think there may also be I/O APIC specs in datasheets for some newer
chipsets targeted to P6 family processors.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

diff -u --recursive --new-file linux-2.3.42.macro/arch/i386/kernel/smpboot.c linux-2.3.42/arch/i386/kernel/smpboot.c --- linux-2.3.42.macro/arch/i386/kernel/smpboot.c Tue Feb 1 00:33:22 2000 +++ linux-2.3.42/arch/i386/kernel/smpboot.c Fri Mar 24 17:27:10 2000 @@ -944,7 +944,6 @@ setup_IO_APIC(); #endif -smp_done: /* * Set up all local APIC timers in the system: */ @@ -956,6 +955,7 @@ if (cpu_has_tsc && cpucount) synchronize_tsc_bp(); +smp_done: zap_low_mappings(); }

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



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:13 EST