From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D7BD5C433EF for ; Fri, 17 Dec 2021 02:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Kzdqi9qkvEpZ1SE+dIiK0ScJ1v170+MdhQgaU1nvtk8=; b=bXSaER68dNJLDEbW7icjh9YwKM ldjHOJ5blPEcnV5hWWFVqvDXlm6wLdcgqkjD2XNS3KKnSbO+CG1z7WUeS/T2v/sKVPNefR+4UfbEJ d4I/C+fcE+xVNSdKUY/XLlGu/2N+FpISGD34k43+GzItGlvAkVFt1lKZi7IkpUnpeLLctRkWUW5vB oR6mfKEKMyq5kjVFq9dEHhUV5nm8wp8DT7odiM/a3e+97xpLDAc8Msn7VuBBk4M7UoJhxdTIIrunC AtPNFFaf9iyGyMR4N61+ibBPLAIARLvf+HEGMxQgOGIGuIgNBW2GZ0TSRBIQmOC+ElJdyVoLGTB3+ sLL1/Lqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1my3L7-008Qz7-MJ; Fri, 17 Dec 2021 02:51:21 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1my3Kz-008QwO-1T; Fri, 17 Dec 2021 02:51:15 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JFYPz346szbjLQ; Fri, 17 Dec 2021 10:50:47 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 17 Dec 2021 10:51:06 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 17 Dec 2021 10:51:05 +0800 Subject: Re: [PATCH v17 03/10] x86: kdump: use macro CRASH_ADDR_LOW_MAX in functions reserve_crashkernel() To: Borislav Petkov CC: Baoquan He , Thomas Gleixner , "Ingo Molnar" , , "H . Peter Anvin" , , Dave Young , Vivek Goyal , Eric Biederman , , Catalin Marinas , Will Deacon , , Rob Herring , Frank Rowand , , "Jonathan Corbet" , , Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou References: <20211210065533.2023-1-thunder.leizhen@huawei.com> <20211210065533.2023-4-thunder.leizhen@huawei.com> <20211216011040.GG3023@MiWiFi-R3L-srv> <9513d74c-d4c7-babd-f823-8999e195d96d@huawei.com> <35810a61-604e-9b90-2a7f-cfca6ae042ac@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Fri, 17 Dec 2021 10:51:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211216_185113_474765_652A6332 X-CRM114-Status: GOOD ( 15.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021/12/16 22:48, Borislav Petkov wrote: > On Thu, Dec 16, 2021 at 08:08:30PM +0800, Leizhen (ThunderTown) wrote: >> If the memory of 'crash_base' is successfully allocated at (1), because the last >> parameter CRASH_ADDR_LOW_MAX is the upper bound, so we can sure that >> "crash_base < CRASH_ADDR_LOW_MAX". So that, reserve_crashkernel_low() will not be >> invoked at (3). That's why I said (1ULL << 32) is inaccurate and enlarge the CRASH_ADDR_LOW >> upper limit. > > No, this is actually wrong - that check *must* be 4G. See: > > eb6db83d1059 ("x86/setup: Do not reserve crashkernel high memory if low reservation failed") > > It is even documented: > > crashkernel=size[KMG],low > [KNL, X86-64] range under 4G. When crashkernel=X,high [KNL, X86-64], This doc is for X86-64, not for X86-32 > is passed, kernel could allocate physical memory region > above 4G, that cause second kernel crash on system > that require some amount of low memory, e.g. swiotlb > requires at least 64M+32K low memory, also enough extra > low memory is needed to make sure DMA buffers for 32-bit > devices won't run out. vi arch/x86/kernel/setup.c +398 /* * Keep the crash kernel below this limit. * * Earlier 32-bits kernels would limit the kernel to the low 512 MB range * due to mapping restrictions. If there is no such restriction, we can make CRASH_ADDR_LOW_MAX equal to (1ULL << 32) minus 1 on X86_32. > > so you need to do a low allocation for DMA *when* the reserved memory is > above 4G. *NOT* above 512M. But that works due to the obscure situation, > as Baoquan stated, that reserve_crashkernel_low() returns 0 on 32-bit. > > So all this is telling us is that that function needs serious cleanup. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel