From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543AbcF2FP2 (ORCPT ); Wed, 29 Jun 2016 01:15:28 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:59495 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751126AbcF2FP0 (ORCPT ); Wed, 29 Jun 2016 01:15:26 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="8173688" From: Wei Jiangang To: CC: , , , , , Wei Jiangang Subject: [PATCH 1/2] x86/apic: shutdown local APIC before I/O APIC during crash Date: Wed, 29 Jun 2016 12:51:49 +0800 Message-ID: <1467175910-2966-1-git-send-email-weijg.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.50] X-yoursite-MailScanner-ID: 7EB06418A731.AE074 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: weijg.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit <522e66464467> disables I/O APIC before shutdown of the local APIC for both reboot and crash path. and commit <2885432aaf15> declares that 'it still makes sense to quiet IO APIC before disabling Local APIC'. However, the former introduced a bug for crashdown. If specify 'notsc' for capture-kernel, and then trigger crashdown. The capture-kernel will be blocked at calibrate_delay_converge(). /* wait for "start of" clock tick */ ticks = jiffies; while (ticks == jiffies) ; /* nothing */ serial console log as following, ............ [ 0.000000] Linux version 4.7.0-rc2+ (root@localhost.localdomain) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #2 SMP Wed Jun 156 [ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.7.0-rc2+ root=/dev/mapper/centos-root ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=256M vconsole.keymap=us console=tty0 console=ttyS0,115200n8 LANG=en_US.UTF-8 irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off panic=10 rootflags=nofail acpi_no_memhotplug notsc ............ [ 0.000000] tsc: Kernel compiled with CONFIG_X86_TSC, cannot disable TSC completely ............ [ 0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484882848 ns [ 0.000000] tsc: Fast TSC calibration using PIT [ 0.000000] tsc: Detected 3192.714 MHz processor [ 0.000000] Calibrating delay loop... The bug remains and unsolved for a long time, since 2013. I find the arch-criminal by bisect. The commit <522e66464467> used to fix erratum AVR31 for "Intel Atom Processor C2000 Product Family Specification Update". You can find the doc at http://www.intel.com/content/dam/www/public/us /en/documents/specification-updates/atom-c2000-family-spec-update.pdf. IMO, It doesn't make sense that change the order of disabling between I/O APIC and local APIC just for a certain model C2000. And I couldn't find any related descriptions for Intel 64 and IA-32 Arch. so, I want to revert the crash part of commit <522e66464467>. Signed-off-by: Wei Jiangang --- arch/x86/kernel/crash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 9ef978d69c22..9aa0235c1f7d 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -179,12 +179,13 @@ void native_machine_crash_shutdown(struct pt_regs *regs) */ cpu_emergency_stop_pt(); + lapic_shutdown(); #ifdef CONFIG_X86_IO_APIC /* Prevent crash_kexec() from deadlocking on ioapic_lock. */ ioapic_zap_locks(); disable_IO_APIC(); #endif - lapic_shutdown(); + #ifdef CONFIG_HPET_TIMER hpet_disable(); #endif -- 1.9.3