Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247AbdL1KXx (ORCPT ); Thu, 28 Dec 2017 05:23:53 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:56336 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752015AbdL1KXv (ORCPT ); Thu, 28 Dec 2017 05:23:51 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208,223";a="33282710" Subject: Re: PROBLEM: 4.15.0-rc3 APIC causes lockups on Core 2 Duo laptop To: Alexandru Chirvasitu CC: Thomas Gleixner , Dexuan Cui , Pavel Machek , kernel list , Ingo Molnar , "Maciej W. Rozycki" , Mikael Pettersson , Josh Poulson , "Mihai Costache (Cloudbase Solutions SRL)" , Stephen Hemminger , Marc Zyngier , "linux-pci@vger.kernel.org" , Haiyang Zhang , Simon Xiao , Saeed Mahameed , Jork Loeser , Bjorn Helgaas , "devel@linuxdriverproject.org" , KY Srinivasan References: <1bd74ca3-afca-9d61-6911-61250f459891@cn.fujitsu.com> <20171222142053.3cbhi2nhh24w7yoo@D-69-91-141-110.dhcp4.washington.edu> <20171222222917.GA1138@arch-chirva.localdomain> <20171223200112.GC1138@arch-chirva.localdomain> <548c814c-7e24-00c0-3436-26f2704cb427@cn.fujitsu.com> <20171227161801.GE1410@arch-chirva.localdomain> <308183d9-d8d6-0100-159b-8c8be8636b31@cn.fujitsu.com> <20171228025114.wdydzgppfikuo65z@D-69-91-141-110.dhcp4.washington.edu> From: Dou Liyang Message-ID: <0b98e96f-e176-9288-b54c-8ea908954c01@cn.fujitsu.com> Date: Thu, 28 Dec 2017 18:23:39 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171228025114.wdydzgppfikuo65z@D-69-91-141-110.dhcp4.washington.edu> Content-Type: multipart/mixed; boundary="------------BFAF4E4E7F82FA873D423A56" Content-Language: en-US X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 412E9486A78F.A16A7 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2909 Lines: 94 --------------BFAF4E4E7F82FA873D423A56 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Hi Alexandru, At 12/28/2017 10:51 AM, Alexandru Chirvasitu wrote: > Ah, of course. Attached is the output of `journalctl --boot=-1` after > booting, getting locked up, and then rebooting a good kernel. > For the Hard lockups on both CPUs after login: Please try the patch in the attachment by git am ./0001-x86-vector-Replace-the-raw_spin_lock-with-raw_spin_l.patch or patch -p1 < ./0001-x86-vector-Replace-the-raw_spin_lock-with-raw_spin_l.patch > Slightly different version of 4.15-rc5; this one has both patches > applied, yours and Linus' for kexec, but the latter shouldn't make a > difference. > > --- > > You'll see another trace in there that's been bugging me, about W=X > checking. I'm not qualified to judge how related they are, but during > these past few days I've compiled and tested many kernels, and many of > them have exhibited the W+X thing but*not* the lockups. > Yes, I found it, but I am not familiar with it and have no idea. Thanks, dou. ---------------------8<-------------------------------------------- --------------BFAF4E4E7F82FA873D423A56 Content-Type: text/x-patch; name="0001-x86-vector-Replace-the-raw_spin_lock-with-raw_spin_l.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-x86-vector-Replace-the-raw_spin_lock-with-raw_spin_l.pa"; filename*1="tch" >From 57d8543ea4dcf2a53b1c37757da12866a52aaf57 Mon Sep 17 00:00:00 2001 From: Dou Liyang Date: Thu, 28 Dec 2017 16:20:48 +0800 Subject: [PATCH] x86/vector: Replace the raw_spin_lock() with raw_spin_lock_irqsave() Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/vector.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 750449152b04..a43ca26d5dfd 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -726,6 +726,7 @@ static int apic_set_affinity(struct irq_data *irqd, const struct cpumask *dest, bool force) { struct apic_chip_data *apicd = apic_chip_data(irqd); + unsigned long flags; int err; /* @@ -740,13 +741,13 @@ static int apic_set_affinity(struct irq_data *irqd, (apicd->is_managed || apicd->can_reserve)) return IRQ_SET_MASK_OK; - raw_spin_lock(&vector_lock); + raw_spin_lock_irqsave(&vector_lock, flags); cpumask_and(vector_searchmask, dest, cpu_online_mask); if (irqd_affinity_is_managed(irqd)) err = assign_managed_vector(irqd, vector_searchmask); else err = assign_vector_locked(irqd, vector_searchmask); - raw_spin_unlock(&vector_lock); + raw_spin_unlock_irqrestore(&vector_lock, flags); return err ? err : IRQ_SET_MASK_OK; } -- 2.14.3 --------------BFAF4E4E7F82FA873D423A56--