Skip to contentSkip to conversation

x86/apic changes for v3.14

GIT PULL Ingo Molnar 2 participants 3 messages Jan 20, 2014 – Mar 24, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-apic-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-apic-for-linus

# HEAD: 5b4d1dbc24bb6fd7179ada0f47be34e27e64decb x86, apic: Make disabled_cpu_apicid static read_mostly, fix typos

Two main changes:

- Improve local APIC Error Status Register reporting robustness.

- Add the 'disable_cpu_apicid=x' boot parameter for kexec booting.

Thanks,

Ingo

------------------>
H. Peter Anvin (1):
x86, apic: Make disabled_cpu_apicid static read_mostly, fix typos

HATAYAMA Daisuke (1):
x86, apic, kexec: Add disable_cpu_apicid kernel parameter

Richard Weinberger (1):
x86/apic: Read Error Status Register correctly

 Documentation/kernel-parameters.txt |  9 +++++
 arch/x86/kernel/apic/apic.c         | 66 ++++++++++++++++++++++++++++++++-----
 2 files changed, 66 insertions(+), 9 deletions(-)
Documentation/kernel-parameters.txt +9 -0
index b9e9bd8..6fdbf8c 100644
@@ -774,6 +774,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	disable=	[IPV6]
 			See Documentation/networking/ipv6.txt.
 
+	disable_cpu_apicid= [X86,APIC,SMP]
+			Format: <int>
+			The number of initial APIC ID for the
+			corresponding CPU to be disabled at boot,
+			mostly used for the kdump 2nd kernel to
+			disable BSP to wake up multiple CPUs without
+			causing system reset or hang due to sending
+			INIT from AP to BSP.
+
 	disable_ddw     [PPC/PSERIES]
 			Disable Dynamic DMA Window support. Use this if
 			to workaround buggy firmware.
arch/x86/kernel/apic/apic.c +57 -9

100 lines not on this page · raw message

#1 lore raw
Quoted 23 lines · Ingo Molnar
arch/x86/kernel/apic/apic.c +3 -7
index d278736..7f26c9a 100644
@@ -1982,21 +1989,20 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
 	};
 
 	/* First tickle the hardware, only then report what went on. -- REW */
-	v0 = apic_read(APIC_ESR);
 	apic_write(APIC_ESR, 0);
-	v1 = apic_read(APIC_ESR);
+	v = apic_read(APIC_ESR);
 	ack_APIC_irq();
 	atomic_inc(&irq_err_count);
 
-	apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
-		    smp_processor_id(), v0 , v1);
+	apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x",
+		    smp_processor_id(), v);
 
-	v1 = v1 & 0xff;
-	while (v1) {
-		if (v1 & 0x1)

arch/x86/kernel/apic/apic.c static inline void __smp_error_interrupt(struct pt_regs *regs) · line 2008

Quoted 10 lines
arch/x86/kernel/apic/apic.c +4 -1
+	v &= 0xff;
+	while (v) {
+		if (v & 0x1)
 			apic_printk(APIC_DEBUG, KERN_CONT " : %s", error_interrupt_reason[i]);
 		i++;
-		v1 >>= 1;
+		v >>= 1;
 	}
 
 	apic_printk(APIC_DEBUG, KERN_CONT "\n");

Sorry to come up with this so late, I've been cleaning up my mailbox from
old mailing traffic and came across your change only now.

I'm afraid this interferes with an old Pentium APIC erratum:

"3AP. Writes to Error Register Clears Register

PROBLEM: The APIC Error register is intended to only be read. If there is a write to this register the data in the APIC Error register will be cleared and lost.

IMPLICATION: There is a possibility of clearing the Error register status since the write to the register is not specifically blocked.

WORKAROUND: Writes should not occur to the Pentium processor APIC Error register.

STATUS: For the steppings affected see the Summary Table of Changes at the beginning of this section."

The steppings affected are actually: B1, B3 and B5. Do we want to keep supporting them? I think yes, we already handle the erratum elsewhere (lapic_setup_esr). So how about:

	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
		apic_write(APIC_ESR, 0);
	v = apic_read(APIC_ESR);

instead? I can make a patch if that would make your life easier.

There's room for optimisation here, but I think it's not worth the effort
as this is a slow path, APIC error interrupts are not supposed to happen and are I believe extremely uncommon with FSB message delivery.

Maciej

#2 lore raw
Quoted 13 lines · Maciej W. Rozycki

IMPLICATION: There is a possibility of clearing the Error register status since the write to the register is not specifically blocked.

WORKAROUND: Writes should not occur to the Pentium processor APIC Error register.

STATUS: For the steppings affected see the Summary Table of Changes at the beginning of this section."

The steppings affected are actually: B1, B3 and B5. Do we want to keep supporting them? I think yes, we already handle the erratum elsewhere (lapic_setup_esr). So how about:

Quoted 5 lines
	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
		apic_write(APIC_ESR, 0);
	v = apic_read(APIC_ESR);

instead? I can make a patch if that would make your life easier.

Sure, a patch would be helpful.

Quoted 4 lines

There's room for optimisation here, but I think it's not worth the
effort as this is a slow path, APIC error interrupts are not supposed to happen and are I believe extremely uncommon with FSB message delivery.

Agreed.

Thanks,

Ingo