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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8B65C4332F for ; Fri, 31 Dec 2021 09:23:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbhLaJXM (ORCPT ); Fri, 31 Dec 2021 04:23:12 -0500 Received: from szxga08-in.huawei.com ([45.249.212.255]:30129 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhLaJXL (ORCPT ); Fri, 31 Dec 2021 04:23:11 -0500 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4JQKNN52NPz1DKLh; Fri, 31 Dec 2021 17:19:48 +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, 31 Dec 2021 17:23:09 +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, 31 Dec 2021 17:23:08 +0800 Subject: Re: [PATCH v19 01/13] kdump: add helper parse_crashkernel_high_low() From: "Leizhen (ThunderTown)" To: Borislav Petkov CC: Thomas Gleixner , Ingo Molnar , , "H . Peter Anvin" , , Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , , Catalin Marinas , Will Deacon , , Rob Herring , Frank Rowand , , "Jonathan Corbet" , , Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , "John Donnelly" References: <20211228132612.1860-1-thunder.leizhen@huawei.com> <20211228132612.1860-2-thunder.leizhen@huawei.com> <4878dda9-871d-228d-21ac-3ac7c8a84322@huawei.com> <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Message-ID: <207b6257-22bc-c9fe-6206-4096d8e0d276@huawei.com> Date: Fri, 31 Dec 2021 17:22:56 +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: <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/12/30 19:08, Leizhen (ThunderTown) wrote: > > > On 2021/12/30 18:40, Borislav Petkov wrote: >> On Thu, Dec 30, 2021 at 06:14:59PM +0800, Leizhen (ThunderTown) wrote: >>> >>> Hi, Dave, Baoquan, Borislav: >>> What do you think about the introduction of parse_crashkernel_high_low()? If everyone >>> doesn't object, I'll bring it to the next version. But I'll make some adjustments to the >>> patches, see below. If there's any objection, I still strongly recommend removing the >>> parameters "system_ram" and "crash_base" of parse_crashkernel_{high,low}(). >>> >>> How about splitting __parse_crashkernel() into two parts? One for parsing >>> "crashkernel=X[@offset]", another one for parsing "crashkernel=X,{high,low}" and other >>> suffixes in the future. So the parameter requirements are clear at the lowest level. >> >> First of all, please do not top post! >> >> Now, I already explained to you what I'd like to see: >> >> https://lore.kernel.org/r/Ycs3kpZD/vpoo1AX@zn.tnic >> >> yet you still don't get it. >> >> So let me make myself clear: in its current form, this is not really an >> improvement so for all x86 changes: >> >> NAKed-by: Borislav Petkov Hi Borislav: I'm sorry to bother you again. Do you mind if I make the following changes? I can't stand so many comments appearing twice. Even if the size needs to be changed in the future, mode "low_size = CRASH_LOW_SIZE_MIN + " can be used for adaptation without affecting other architectures. diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index e04f5e6eb33f453..da485ee51a9929e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -428,16 +428,7 @@ static int __init reserve_crashkernel_low(void) /* crashkernel=Y,low */ ret = parse_crashkernel_low(boot_command_line, low_mem_limit, &low_size, &base); if (ret) { - /* - * two parts from kernel/dma/swiotlb.c: - * -swiotlb size: user-specified with swiotlb= or default. - * - * -swiotlb overflow buffer: now hardcoded to 32k. We round it - * to 8M for other buffers that may need to stay low too. Also - * make sure we allocate enough extra low memory so that we - * don't run out of DMA buffers for 32-bit devices. - */ - low_size = max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20); + low_size = CRASH_LOW_SIZE_MIN; } else { /* passed with crashkernel=0,low ? */ if (!low_size) diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index de62a722431e7db..c85b15814312b7e 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -69,6 +69,17 @@ phys_addr_t paddr_vmcoreinfo_note(void); #define VMCOREINFO_CONFIG(name) \ vmcoreinfo_append_str("CONFIG_%s=y\n", #name) +/* + * two parts from kernel/dma/swiotlb.c: + * -swiotlb size: user-specified with swiotlb= or default. + * + * -swiotlb overflow buffer: now hardcoded to 32k. We round it + * to 8M for other buffers that may need to stay low too. Also + * make sure we allocate enough extra low memory so that we + * don't run out of DMA buffers for 32-bit devices. + */ +#define CRASH_LOW_SIZE_MIN max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20) + extern unsigned char *vmcoreinfo_data; extern size_t vmcoreinfo_size; extern u32 *vmcoreinfo_note; >> > > OK, thanks for your immediate reply, so I can take less detours. > -- Regards, Zhen Lei 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 F13BBC433EF for ; Fri, 31 Dec 2021 09:25:10 +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:References:CC:To:From:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZSivc7fcWGhR3EUNsEQSw0dpQOreMIDPQsIrI9lkVfY=; b=AM+yItXYKJ8qQ590R1sW4fqGg0 r/nQLPZfFbLRaiws8FgG8HM8srTg805UmWe/gdxXQlw+h3cxcarXzBdt2qc/c9wxuMWPcE7qzwq/a 3oWOc/kRbK0L4/pl42C0jSdKeuD3QKUVTNEbkTB866Y4eHS5N0R9KKPL89ZbhgBhLg1ZtwzD7KL94 AKOxirRJ5mSzKwBLtJcVuQ6o65Hq9GtFQvR6YkHKa8D7kHuVcAibr6s2wtMFihKer+qOTE9TCVviZ rBj6VL7Wr/Q6Yq1tniEcvmB/jn0/vd4u4tQFUuEr3C24uixVCirB8dOx3tB5gxm9EHjMyjipCgIyc ViBEaxDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n3E8B-005r8H-UO; Fri, 31 Dec 2021 09:23:24 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n3E86-005r6E-Ht; Fri, 31 Dec 2021 09:23:20 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4JQKNN52NPz1DKLh; Fri, 31 Dec 2021 17:19:48 +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, 31 Dec 2021 17:23:09 +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, 31 Dec 2021 17:23:08 +0800 Subject: Re: [PATCH v19 01/13] kdump: add helper parse_crashkernel_high_low() From: "Leizhen (ThunderTown)" To: Borislav Petkov CC: Thomas Gleixner , Ingo Molnar , , "H . Peter Anvin" , , Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , , Catalin Marinas , Will Deacon , , Rob Herring , Frank Rowand , , "Jonathan Corbet" , , Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , "John Donnelly" References: <20211228132612.1860-1-thunder.leizhen@huawei.com> <20211228132612.1860-2-thunder.leizhen@huawei.com> <4878dda9-871d-228d-21ac-3ac7c8a84322@huawei.com> <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Message-ID: <207b6257-22bc-c9fe-6206-4096d8e0d276@huawei.com> Date: Fri, 31 Dec 2021 17:22:56 +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: <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Content-Language: en-US X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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-20211231_012318_987705_3D9AF862 X-CRM114-Status: GOOD ( 20.76 ) 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/30 19:08, Leizhen (ThunderTown) wrote: > > > On 2021/12/30 18:40, Borislav Petkov wrote: >> On Thu, Dec 30, 2021 at 06:14:59PM +0800, Leizhen (ThunderTown) wrote: >>> >>> Hi, Dave, Baoquan, Borislav: >>> What do you think about the introduction of parse_crashkernel_high_low()? If everyone >>> doesn't object, I'll bring it to the next version. But I'll make some adjustments to the >>> patches, see below. If there's any objection, I still strongly recommend removing the >>> parameters "system_ram" and "crash_base" of parse_crashkernel_{high,low}(). >>> >>> How about splitting __parse_crashkernel() into two parts? One for parsing >>> "crashkernel=X[@offset]", another one for parsing "crashkernel=X,{high,low}" and other >>> suffixes in the future. So the parameter requirements are clear at the lowest level. >> >> First of all, please do not top post! >> >> Now, I already explained to you what I'd like to see: >> >> https://lore.kernel.org/r/Ycs3kpZD/vpoo1AX@zn.tnic >> >> yet you still don't get it. >> >> So let me make myself clear: in its current form, this is not really an >> improvement so for all x86 changes: >> >> NAKed-by: Borislav Petkov Hi Borislav: I'm sorry to bother you again. Do you mind if I make the following changes? I can't stand so many comments appearing twice. Even if the size needs to be changed in the future, mode "low_size = CRASH_LOW_SIZE_MIN + " can be used for adaptation without affecting other architectures. diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index e04f5e6eb33f453..da485ee51a9929e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -428,16 +428,7 @@ static int __init reserve_crashkernel_low(void) /* crashkernel=Y,low */ ret = parse_crashkernel_low(boot_command_line, low_mem_limit, &low_size, &base); if (ret) { - /* - * two parts from kernel/dma/swiotlb.c: - * -swiotlb size: user-specified with swiotlb= or default. - * - * -swiotlb overflow buffer: now hardcoded to 32k. We round it - * to 8M for other buffers that may need to stay low too. Also - * make sure we allocate enough extra low memory so that we - * don't run out of DMA buffers for 32-bit devices. - */ - low_size = max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20); + low_size = CRASH_LOW_SIZE_MIN; } else { /* passed with crashkernel=0,low ? */ if (!low_size) diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index de62a722431e7db..c85b15814312b7e 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -69,6 +69,17 @@ phys_addr_t paddr_vmcoreinfo_note(void); #define VMCOREINFO_CONFIG(name) \ vmcoreinfo_append_str("CONFIG_%s=y\n", #name) +/* + * two parts from kernel/dma/swiotlb.c: + * -swiotlb size: user-specified with swiotlb= or default. + * + * -swiotlb overflow buffer: now hardcoded to 32k. We round it + * to 8M for other buffers that may need to stay low too. Also + * make sure we allocate enough extra low memory so that we + * don't run out of DMA buffers for 32-bit devices. + */ +#define CRASH_LOW_SIZE_MIN max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20) + extern unsigned char *vmcoreinfo_data; extern size_t vmcoreinfo_size; extern u32 *vmcoreinfo_note; >> > > OK, thanks for your immediate reply, so I can take less detours. > -- Regards, Zhen Lei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Subject: Re: [PATCH v19 01/13] kdump: add helper parse_crashkernel_high_low() From: "Leizhen (ThunderTown)" References: <20211228132612.1860-1-thunder.leizhen@huawei.com> <20211228132612.1860-2-thunder.leizhen@huawei.com> <4878dda9-871d-228d-21ac-3ac7c8a84322@huawei.com> <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Message-ID: <207b6257-22bc-c9fe-6206-4096d8e0d276@huawei.com> Date: Fri, 31 Dec 2021 17:22:56 +0800 MIME-Version: 1.0 In-Reply-To: <7a703955-cd1c-e074-17dd-a9155aa7690a@huawei.com> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly On 2021/12/30 19:08, Leizhen (ThunderTown) wrote: > > > On 2021/12/30 18:40, Borislav Petkov wrote: >> On Thu, Dec 30, 2021 at 06:14:59PM +0800, Leizhen (ThunderTown) wrote: >>> >>> Hi, Dave, Baoquan, Borislav: >>> What do you think about the introduction of parse_crashkernel_high_low()? If everyone >>> doesn't object, I'll bring it to the next version. But I'll make some adjustments to the >>> patches, see below. If there's any objection, I still strongly recommend removing the >>> parameters "system_ram" and "crash_base" of parse_crashkernel_{high,low}(). >>> >>> How about splitting __parse_crashkernel() into two parts? One for parsing >>> "crashkernel=X[@offset]", another one for parsing "crashkernel=X,{high,low}" and other >>> suffixes in the future. So the parameter requirements are clear at the lowest level. >> >> First of all, please do not top post! >> >> Now, I already explained to you what I'd like to see: >> >> https://lore.kernel.org/r/Ycs3kpZD/vpoo1AX@zn.tnic >> >> yet you still don't get it. >> >> So let me make myself clear: in its current form, this is not really an >> improvement so for all x86 changes: >> >> NAKed-by: Borislav Petkov Hi Borislav: I'm sorry to bother you again. Do you mind if I make the following changes? I can't stand so many comments appearing twice. Even if the size needs to be changed in the future, mode "low_size = CRASH_LOW_SIZE_MIN + " can be used for adaptation without affecting other architectures. diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index e04f5e6eb33f453..da485ee51a9929e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -428,16 +428,7 @@ static int __init reserve_crashkernel_low(void) /* crashkernel=Y,low */ ret = parse_crashkernel_low(boot_command_line, low_mem_limit, &low_size, &base); if (ret) { - /* - * two parts from kernel/dma/swiotlb.c: - * -swiotlb size: user-specified with swiotlb= or default. - * - * -swiotlb overflow buffer: now hardcoded to 32k. We round it - * to 8M for other buffers that may need to stay low too. Also - * make sure we allocate enough extra low memory so that we - * don't run out of DMA buffers for 32-bit devices. - */ - low_size = max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20); + low_size = CRASH_LOW_SIZE_MIN; } else { /* passed with crashkernel=0,low ? */ if (!low_size) diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index de62a722431e7db..c85b15814312b7e 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -69,6 +69,17 @@ phys_addr_t paddr_vmcoreinfo_note(void); #define VMCOREINFO_CONFIG(name) \ vmcoreinfo_append_str("CONFIG_%s=y\n", #name) +/* + * two parts from kernel/dma/swiotlb.c: + * -swiotlb size: user-specified with swiotlb= or default. + * + * -swiotlb overflow buffer: now hardcoded to 32k. We round it + * to 8M for other buffers that may need to stay low too. Also + * make sure we allocate enough extra low memory so that we + * don't run out of DMA buffers for 32-bit devices. + */ +#define CRASH_LOW_SIZE_MIN max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20) + extern unsigned char *vmcoreinfo_data; extern size_t vmcoreinfo_size; extern u32 *vmcoreinfo_note; >> > > OK, thanks for your immediate reply, so I can take less detours. > -- Regards, Zhen Lei _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec