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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 C299EC433E7 for ; Tue, 13 Oct 2020 15:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 652F4251FB for ; Tue, 13 Oct 2020 15:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730733AbgJMPpZ (ORCPT ); Tue, 13 Oct 2020 11:45:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:40476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727830AbgJMPpY (ORCPT ); Tue, 13 Oct 2020 11:45:24 -0400 Received: from gaia (unknown [95.149.105.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C49BC251F8; Tue, 13 Oct 2020 15:45:21 +0000 (UTC) Date: Tue, 13 Oct 2020 16:45:19 +0100 From: Catalin Marinas To: Nicolas Saenz Julienne Cc: Ard Biesheuvel , Linux ARM , ACPI Devel Maling List , Will Deacon , Jeremy Linton , Lorenzo Pieralisi , Rob Herring , Christoph Hellwig , Robin Murphy , Hanjun Guo , Sudeep Holla , Anshuman Khandual Subject: Re: [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan Message-ID: <20201013154518.GO10778@gaia> References: <20201012112453.GD9844@gaia> <20201012154954.GB6493@gaia> <20201012162238.GC6493@gaia> <20201012165933.GD6493@gaia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Tue, Oct 13, 2020 at 04:42:36PM +0200, Nicolas Saenz Julienne wrote: > On Mon, 2020-10-12 at 17:59 +0100, Catalin Marinas wrote: > > On Mon, Oct 12, 2020 at 06:35:37PM +0200, Ard Biesheuvel wrote: > > > On Mon, 12 Oct 2020 at 18:22, Catalin Marinas wrote: > > > > On Mon, Oct 12, 2020 at 05:55:45PM +0200, Ard Biesheuvel wrote: > > > > > On Mon, 12 Oct 2020 at 17:50, Catalin Marinas wrote: > > > > > > > > On Mon, Oct 12, 2020 at 12:43:05PM +0200, Ard Biesheuvel wrote: > > > > > > > > > Also, could someone give an executive summary of why it matters where > > > > > > > > > the crashkernel is loaded? As far as I can tell, reserve_crashkernel() > > > > > > > > > only allocates memory for the kernel's executable image itself, which > > > > > > > > > can usually be loaded anywhere in memory. I could see how a > > > > > > > > > crashkernel might need some DMA'able memory if it needs to use the > > > > > > > > > hardware, but I don't think that is what is going on here. > > > > [...] > > > > > > However, the crashkernel=... range is meant for sufficiently large > > > > > > reservation to be able to run the kdump kernel, not just load the image. > > > > > > > > > > Sure. But I was referring to the requirement that it is loaded low in > > > > > memory. Unless I am misunderstanding something, all we need for the > > > > > crashkernel to be able to operate is some ZONE_DMA memory in case it > > > > > is needed by the hardware, and beyond that, it could happily live > > > > > anywhere in memory. > > > > > > > > Yes, the crash kernel doesn't need to be loaded in the low memory. But > > > > some low memory needs to end up in its perceived System RAM. That's what > > > > Chen is trying to do with this series: > > > > > > > > https://lore.kernel.org/linux-arm-kernel/20200907134745.25732-1-chenzhou10@huawei.com/ > > > > > > > > It reserves the normal crashkernel memory at some high address range > > > > with a small block (currently proposed as 256MB similar to x86) in the > > > > "low" range. > > > > > > > > This "low" range for arm64 currently means below 1GB but it's only RPi4 > > > > that needs it this low, all other platforms are fine with the full low > > > > 32-bit range. > > > > > > > > If it's not doable in a nice way, we'll just leave with this permanent > > > > 1GB ZONE_DMA and hope we won't get platforms requiring an even smaller > > > > one. There's also the option of ignoring kdump on RPi4, make ZONE_DMA > > > > depend on !CRASH_DUMP and the "low" reservations can use the full 32-bit > > > > range since the kdump kernel won't need <30-bit addresses. > > > > > > Are you aware of any reason why we cannot defer the call to > > > reserve_crashkernel() to the start of bootmem_init()? That way, we > > > have access to the unflattened DT as well as the IORT, and so we can > > > tweak the zone limits based on the h/w description, but before > > > allocating the crashkernel. > > > > Not really, as long as memblock_reserve/alloc() still works. > > I had a look at this myself, and IIUC we're free to call reserve_crashkernel() > anytime as long as it's before memblock_free_all(). > > So, should I add a patch in my series taking care of that? or you'd rather take > care of it yourselves? Please add it to your series, it wouldn't be needed without your (and Ard's) patches anyway. -- Catalin 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 B92C7C433E7 for ; Tue, 13 Oct 2020 15:46:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 3B728251FD for ; Tue, 13 Oct 2020 15:46:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kIMpedHD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B728251FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M7xMlrlz3tKrxRUFB2mhXHkfJx3cpFjL6qVcYL2Fd3M=; b=kIMpedHDncKZWWycNpasSrwUW FinhwnWN1oWRFidHbG5XTj6DZVhVWEzkhWZyt4EHu0BzGiNqKZ+Z+Pl/kdBnfQILfib99K2lR+4Bk wyo3PqcQdN+xs7CutdV/IyB4V9KGNS2NCEAVjW3Wzhu4bO1oC2dMMEMZxQ5KzXQybpgvddHKQXAYL c7bKSrf+049eHWl3TMYu5tQStLIng39ejTNNoKtOQl+rAs6AhA6Z0/lzzfURUfYwYKoCd/hHuGPsD eo6BgsZyRt/kafyKlHSnvpCKyxlWY8DttFSjU6wUshWNgbzkczU0PmPFLx0emJ4jheDdVqOIHy5/r uIEcCd0gw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSMUS-0005EK-SP; Tue, 13 Oct 2020 15:45:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSMUP-0005Do-8f for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 15:45:26 +0000 Received: from gaia (unknown [95.149.105.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C49BC251F8; Tue, 13 Oct 2020 15:45:21 +0000 (UTC) Date: Tue, 13 Oct 2020 16:45:19 +0100 From: Catalin Marinas To: Nicolas Saenz Julienne Subject: Re: [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan Message-ID: <20201013154518.GO10778@gaia> References: <20201012112453.GD9844@gaia> <20201012154954.GB6493@gaia> <20201012162238.GC6493@gaia> <20201012165933.GD6493@gaia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_114525_459344_1F542974 X-CRM114-Status: GOOD ( 37.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Anshuman Khandual , Robin Murphy , Sudeep Holla , Jeremy Linton , Christoph Hellwig , ACPI Devel Maling List , Rob Herring , Hanjun Guo , Will Deacon , Ard Biesheuvel , Linux ARM 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 Tue, Oct 13, 2020 at 04:42:36PM +0200, Nicolas Saenz Julienne wrote: > On Mon, 2020-10-12 at 17:59 +0100, Catalin Marinas wrote: > > On Mon, Oct 12, 2020 at 06:35:37PM +0200, Ard Biesheuvel wrote: > > > On Mon, 12 Oct 2020 at 18:22, Catalin Marinas wrote: > > > > On Mon, Oct 12, 2020 at 05:55:45PM +0200, Ard Biesheuvel wrote: > > > > > On Mon, 12 Oct 2020 at 17:50, Catalin Marinas wrote: > > > > > > > > On Mon, Oct 12, 2020 at 12:43:05PM +0200, Ard Biesheuvel wrote: > > > > > > > > > Also, could someone give an executive summary of why it matters where > > > > > > > > > the crashkernel is loaded? As far as I can tell, reserve_crashkernel() > > > > > > > > > only allocates memory for the kernel's executable image itself, which > > > > > > > > > can usually be loaded anywhere in memory. I could see how a > > > > > > > > > crashkernel might need some DMA'able memory if it needs to use the > > > > > > > > > hardware, but I don't think that is what is going on here. > > > > [...] > > > > > > However, the crashkernel=... range is meant for sufficiently large > > > > > > reservation to be able to run the kdump kernel, not just load the image. > > > > > > > > > > Sure. But I was referring to the requirement that it is loaded low in > > > > > memory. Unless I am misunderstanding something, all we need for the > > > > > crashkernel to be able to operate is some ZONE_DMA memory in case it > > > > > is needed by the hardware, and beyond that, it could happily live > > > > > anywhere in memory. > > > > > > > > Yes, the crash kernel doesn't need to be loaded in the low memory. But > > > > some low memory needs to end up in its perceived System RAM. That's what > > > > Chen is trying to do with this series: > > > > > > > > https://lore.kernel.org/linux-arm-kernel/20200907134745.25732-1-chenzhou10@huawei.com/ > > > > > > > > It reserves the normal crashkernel memory at some high address range > > > > with a small block (currently proposed as 256MB similar to x86) in the > > > > "low" range. > > > > > > > > This "low" range for arm64 currently means below 1GB but it's only RPi4 > > > > that needs it this low, all other platforms are fine with the full low > > > > 32-bit range. > > > > > > > > If it's not doable in a nice way, we'll just leave with this permanent > > > > 1GB ZONE_DMA and hope we won't get platforms requiring an even smaller > > > > one. There's also the option of ignoring kdump on RPi4, make ZONE_DMA > > > > depend on !CRASH_DUMP and the "low" reservations can use the full 32-bit > > > > range since the kdump kernel won't need <30-bit addresses. > > > > > > Are you aware of any reason why we cannot defer the call to > > > reserve_crashkernel() to the start of bootmem_init()? That way, we > > > have access to the unflattened DT as well as the IORT, and so we can > > > tweak the zone limits based on the h/w description, but before > > > allocating the crashkernel. > > > > Not really, as long as memblock_reserve/alloc() still works. > > I had a look at this myself, and IIUC we're free to call reserve_crashkernel() > anytime as long as it's before memblock_free_all(). > > So, should I add a patch in my series taking care of that? or you'd rather take > care of it yourselves? Please add it to your series, it wouldn't be needed without your (and Ard's) patches anyway. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel