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 C2F4EC433FE for ; Fri, 7 Jan 2022 13:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347461AbiAGNJe (ORCPT ); Fri, 7 Jan 2022 08:09:34 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:34883 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347438AbiAGNJa (ORCPT ); Fri, 7 Jan 2022 08:09:30 -0500 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JVk7T1ZbFzccN3; Fri, 7 Jan 2022 21:08:53 +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, 7 Jan 2022 21:09:28 +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, 7 Jan 2022 21:09:27 +0800 Subject: Re: [PATCH v18 02/17] x86/setup: Move xen_pv_domain() check and insert_resource() to setup_arch() 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: <20211222130820.1754-1-thunder.leizhen@huawei.com> <20211222130820.1754-3-thunder.leizhen@huawei.com> <5d8aed79-b20f-2575-3c3f-8945d8cbac3f@huawei.com> <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@huawei.com> Message-ID: <681a2403-1e1c-1b06-54d0-ca92a7f07e71@huawei.com> Date: Fri, 7 Jan 2022 21:09:26 +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: <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@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: dggems704-chm.china.huawei.com (10.3.19.181) 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 2022/1/7 16:13, Leizhen (ThunderTown) wrote: > > > On 2021/12/25 9:53, Leizhen (ThunderTown) wrote: >> >> >> On 2021/12/24 14:36, Leizhen (ThunderTown) wrote: >>> >>> >>> On 2021/12/24 1:26, Borislav Petkov wrote: >>>> On Wed, Dec 22, 2021 at 09:08:05PM +0800, Zhen Lei wrote: >>>>> From: Chen Zhou >>>>> >>>>> We will make the functions reserve_crashkernel() as generic, the >>>>> xen_pv_domain() check in reserve_crashkernel() is relevant only to >>>>> x86, >>>> >>>> Why is that so? Is Xen-PV x86-only? >>>> >>>>> the same as insert_resource() in reserve_crashkernel[_low](). >>>> >>>> Why? >>>> >>>> Looking at >>>> >>>> 0212f9159694 ("x86: Add Crash kernel low reservation") >>>> >>>> it *surprisingly* explains why that resources thing is being added: >>>> >>>> We need to add another range in /proc/iomem like "Crash kernel low", >>>> so kexec-tools could find that info and append to kdump kernel >>>> command line. >>>> >>>> Then, >>>> >>>> 157752d84f5d ("kexec: use Crash kernel for Crash kernel low") >>>> >>>> renamed it because, as it states, kexec-tools was taught to handle >>>> multiple resources of the same name. >>>> >>>> So why does kexec-tools on arm *not* need those iomem resources? How >>>> does it parse the ranges there? Questions over questions... > > Hi Borislav: > The reason why insert_resource() cannot be used in reserve_crashkernel[_low]() > on arm64 is clear. The parent resource node of crashk[_low]_res is added by > request_resource() in request_standard_resources(), so that it will be conflicted. > All request_resource() in request_standard_resources() should be changed to > insert_resource(), to make insert_resource() can be used in reserve_crashkernel[_low](). > > I found commit e25e6e7593ca ("kdump, x86: Process multiple Crash kernel in /proc/iomem") > in kexec-tools. I'm trying to port it to arm64, or make it generic. Chen Zhou's done it before. But the "Crash kernel (low)" can really be eliminated. Chen Zhou just used it to distinguish whether the crashkernel memory range is crashkernel load range or not. We can use get_crash_kernel_load_range() to get and check the load range. > > Thanks. > >> >> It's a good question worth figuring out. I'm going to dig into this. >> I admire your rigorous style and sharp vision. >> > > -- 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 B3A4CC433EF for ; Fri, 7 Jan 2022 13:11:17 +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=S6s0da7QLNadnV8cQ92+L/CPi8r3z7946suhkRdc+t0=; b=VLO+B+QUg0gLRANEp5fwTQOiKc Hzw+IScs694v25iqB6UY9Y8A4+4huyWzqTt0dCuSUAjyUco0a34/5DbrNrTYSK6OdCKznEJN7DrR5 k8G2bJrpuQlPwv7Uh+q7arfjPNU1h5+ca2H/EtYrSrbipxSv5BIWMv54RLDRhehPbWiQ+mo4Xp0Z5 bOjECGQfs0kFOEVypGPyCgX2n32YuGFmpst4y7eOnfMwYIpy6aTtsrAcRQSDwNlXlaeT1IaZxULI1 PM7CGThaf9NRmzmeRQ71POHfWdyzmGRmgBgKVyPpGpmOnsdzcx+gZ2gUUG9Uno2zJZYxUiBxuuE3x 9bWTEh7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5p03-003wh2-2A; Fri, 07 Jan 2022 13:09:43 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5ozu-003weO-HW; Fri, 07 Jan 2022 13:09:39 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JVk7T1ZbFzccN3; Fri, 7 Jan 2022 21:08:53 +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, 7 Jan 2022 21:09:28 +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, 7 Jan 2022 21:09:27 +0800 Subject: Re: [PATCH v18 02/17] x86/setup: Move xen_pv_domain() check and insert_resource() to setup_arch() 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: <20211222130820.1754-1-thunder.leizhen@huawei.com> <20211222130820.1754-3-thunder.leizhen@huawei.com> <5d8aed79-b20f-2575-3c3f-8945d8cbac3f@huawei.com> <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@huawei.com> Message-ID: <681a2403-1e1c-1b06-54d0-ca92a7f07e71@huawei.com> Date: Fri, 7 Jan 2022 21:09:26 +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: <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@huawei.com> 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-20220107_050934_938978_B93EC643 X-CRM114-Status: GOOD ( 18.18 ) 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 2022/1/7 16:13, Leizhen (ThunderTown) wrote: > > > On 2021/12/25 9:53, Leizhen (ThunderTown) wrote: >> >> >> On 2021/12/24 14:36, Leizhen (ThunderTown) wrote: >>> >>> >>> On 2021/12/24 1:26, Borislav Petkov wrote: >>>> On Wed, Dec 22, 2021 at 09:08:05PM +0800, Zhen Lei wrote: >>>>> From: Chen Zhou >>>>> >>>>> We will make the functions reserve_crashkernel() as generic, the >>>>> xen_pv_domain() check in reserve_crashkernel() is relevant only to >>>>> x86, >>>> >>>> Why is that so? Is Xen-PV x86-only? >>>> >>>>> the same as insert_resource() in reserve_crashkernel[_low](). >>>> >>>> Why? >>>> >>>> Looking at >>>> >>>> 0212f9159694 ("x86: Add Crash kernel low reservation") >>>> >>>> it *surprisingly* explains why that resources thing is being added: >>>> >>>> We need to add another range in /proc/iomem like "Crash kernel low", >>>> so kexec-tools could find that info and append to kdump kernel >>>> command line. >>>> >>>> Then, >>>> >>>> 157752d84f5d ("kexec: use Crash kernel for Crash kernel low") >>>> >>>> renamed it because, as it states, kexec-tools was taught to handle >>>> multiple resources of the same name. >>>> >>>> So why does kexec-tools on arm *not* need those iomem resources? How >>>> does it parse the ranges there? Questions over questions... > > Hi Borislav: > The reason why insert_resource() cannot be used in reserve_crashkernel[_low]() > on arm64 is clear. The parent resource node of crashk[_low]_res is added by > request_resource() in request_standard_resources(), so that it will be conflicted. > All request_resource() in request_standard_resources() should be changed to > insert_resource(), to make insert_resource() can be used in reserve_crashkernel[_low](). > > I found commit e25e6e7593ca ("kdump, x86: Process multiple Crash kernel in /proc/iomem") > in kexec-tools. I'm trying to port it to arm64, or make it generic. Chen Zhou's done it before. But the "Crash kernel (low)" can really be eliminated. Chen Zhou just used it to distinguish whether the crashkernel memory range is crashkernel load range or not. We can use get_crash_kernel_load_range() to get and check the load range. > > Thanks. > >> >> It's a good question worth figuring out. I'm going to dig into this. >> I admire your rigorous style and sharp vision. >> > > -- 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 From: Leizhen (ThunderTown) Date: Fri, 7 Jan 2022 21:09:26 +0800 Subject: [PATCH v18 02/17] x86/setup: Move xen_pv_domain() check and insert_resource() to setup_arch() In-Reply-To: <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@huawei.com> References: <20211222130820.1754-1-thunder.leizhen@huawei.com> <20211222130820.1754-3-thunder.leizhen@huawei.com> <5d8aed79-b20f-2575-3c3f-8945d8cbac3f@huawei.com> <7e7c8d93-e745-2bfd-b93d-aecb3b70bf33@huawei.com> Message-ID: <681a2403-1e1c-1b06-54d0-ca92a7f07e71@huawei.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kexec@lists.infradead.org On 2022/1/7 16:13, Leizhen (ThunderTown) wrote: > > > On 2021/12/25 9:53, Leizhen (ThunderTown) wrote: >> >> >> On 2021/12/24 14:36, Leizhen (ThunderTown) wrote: >>> >>> >>> On 2021/12/24 1:26, Borislav Petkov wrote: >>>> On Wed, Dec 22, 2021 at 09:08:05PM +0800, Zhen Lei wrote: >>>>> From: Chen Zhou >>>>> >>>>> We will make the functions reserve_crashkernel() as generic, the >>>>> xen_pv_domain() check in reserve_crashkernel() is relevant only to >>>>> x86, >>>> >>>> Why is that so? Is Xen-PV x86-only? >>>> >>>>> the same as insert_resource() in reserve_crashkernel[_low](). >>>> >>>> Why? >>>> >>>> Looking at >>>> >>>> 0212f9159694 ("x86: Add Crash kernel low reservation") >>>> >>>> it *surprisingly* explains why that resources thing is being added: >>>> >>>> We need to add another range in /proc/iomem like "Crash kernel low", >>>> so kexec-tools could find that info and append to kdump kernel >>>> command line. >>>> >>>> Then, >>>> >>>> 157752d84f5d ("kexec: use Crash kernel for Crash kernel low") >>>> >>>> renamed it because, as it states, kexec-tools was taught to handle >>>> multiple resources of the same name. >>>> >>>> So why does kexec-tools on arm *not* need those iomem resources? How >>>> does it parse the ranges there? Questions over questions... > > Hi Borislav: > The reason why insert_resource() cannot be used in reserve_crashkernel[_low]() > on arm64 is clear. The parent resource node of crashk[_low]_res is added by > request_resource() in request_standard_resources(), so that it will be conflicted. > All request_resource() in request_standard_resources() should be changed to > insert_resource(), to make insert_resource() can be used in reserve_crashkernel[_low](). > > I found commit e25e6e7593ca ("kdump, x86: Process multiple Crash kernel in /proc/iomem") > in kexec-tools. I'm trying to port it to arm64, or make it generic. Chen Zhou's done it before. But the "Crash kernel (low)" can really be eliminated. Chen Zhou just used it to distinguish whether the crashkernel memory range is crashkernel load range or not. We can use get_crash_kernel_load_range() to get and check the load range. > > Thanks. > >> >> It's a good question worth figuring out. I'm going to dig into this. >> I admire your rigorous style and sharp vision. >> > > -- Regards, Zhen Lei