Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243E5C282DA for ; Fri, 19 Apr 2019 08:57:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD23D217FA for ; Fri, 19 Apr 2019 08:57:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GxBueZG/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD23D217FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ddOX2HPs3++id4jHRh6dt97U8zz+1pR0FbWm15CP/TI=; b=GxBueZG/8FUd+/ koO02dxEp4/O034SYLmBaYZD56RSsGIwhoh7n7WZMFReEWUvCxDBPzPI2rh8GdA412lnaU6icREAa mgofvG5V1j1QPqGoAnnPs/YeGujRdURZhlS2+LAmHth+jW60LRksCIVorzSdE96q4KdUosH/0CD7o YGw7OsORY8cUI9g3w2ZP99dEyypHHorApDkWavZ0ZxQdf/VKIiaRF1gidpMICQGKMm2rDX4GfXeMw +bvhFktMzrEi+UlqeIRT0Sbq+amK11hFCaIrmhAdVsBekEC6QzDoGHDmn/Qt1xqhv7h83bG6acYva oUU6FKafy4mhKWBepaKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHPKU-0006gP-M3; Fri, 19 Apr 2019 08:57:06 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHPKR-0006g4-0q for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2019 08:57:04 +0000 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 9AD9F52509B9315BB671; Fri, 19 Apr 2019 16:56:56 +0800 (CST) Received: from dggeme754-chm.china.huawei.com (10.3.19.100) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 19 Apr 2019 16:56:56 +0800 Received: from [127.0.0.1] (10.184.212.80) by dggeme754-chm.china.huawei.com (10.3.19.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 19 Apr 2019 16:56:55 +0800 Subject: Re: [PATCH] arm64: fix kernel stack overflow in kdump capture kernel To: Julien Thierry , , References: <20190418140251.31218-1-liwei391@huawei.com> <401bab0b-88f6-02ea-c49d-08947a337244@arm.com> From: "liwei (GF)" Message-ID: Date: Fri, 19 Apr 2019 16:56:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <401bab0b-88f6-02ea-c49d-08947a337244@arm.com> X-Originating-IP: [10.184.212.80] X-ClientProxiedBy: dggeme715-chm.china.huawei.com (10.1.199.111) To dggeme754-chm.china.huawei.com (10.3.19.100) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190419_015703_238904_5B6CD339 X-CRM114-Status: GOOD ( 13.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, daniel.thompson@linaro.org, marc.zyngier@arm.com, christoffer.dall@arm.com, james.morse@arm.com, joel@joelfernandes.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Julien, On 2019/4/18 22:26, Julien Thierry wrote: > Hi Wei, > > On 18/04/2019 15:02, Wei Li wrote: >> When enabling ARM64_PSEUDO_NMI feature in kdump capture kernel, it will >> report a kernel stack overflow exception: >> >> [ 0.000000] CPU features: detected: IRQ priority masking >> [ 0.000000] alternatives: patching kernel code >> [ 0.000000] Insufficient stack space to handle exception! >> [ 0.000000] ESR: 0x96000044 -- DABT (current EL) >> [ 0.000000] FAR: 0x0000000000000040 >> [ 0.000000] Task stack: [0xffff0000097f0000..0xffff0000097f4000] >> [ 0.000000] IRQ stack: [0x0000000000000000..0x0000000000004000] >> [ 0.000000] Overflow stack: [0xffff80002b7cf290..0xffff80002b7d0290] >> [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.34-lw+ #3 > > Can you reproduce this on a recent kernel? > OK, i will try to reproduce this on 5.1.0-rc*. >> preempt_disable(); >> trace_hardirqs_off(); >> @@ -451,7 +451,7 @@ void __init smp_prepare_boot_cpu(void) >> >> /* Conditionally switch to GIC PMR for interrupt masking */ >> if (system_uses_irq_prio_masking()) >> - init_gic_priority_masking(); >> + init_gic_priority_masking(false); > > The assumption is that PSR.A should be set at this point (the kernel is > not more ready to take async exceptions than it is ready to take > interrupts) and we shouldn't be unmasking PSR.I. I think the assumption here is not right, since PSR.A has been unmasked in setup_arch() before smp_prepare_boot_cpu(). > PSR.A should be set when booting Linux (requirement in > Documentation/arm64/booting.txt), do you know what is clearing it and why? Thanks, Wei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel