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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 2A7ECC433DF for ; Wed, 14 Oct 2020 12:46:41 +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 970FC221FE for ; Wed, 14 Oct 2020 12:46:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Jjt99yaL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="WDMrFN9e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 970FC221FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LDaV8eQeGliE3rYjC/qpQhhmvk7IkghenR8yNpJ3+78=; b=Jjt99yaLXNjUkNQ1Osjxoquxk JDr/NiEtsR9xNCPoI0ANAXk6/4Ba9UanQtu+pr46WyQXuFlUyRfLjfaYM+Q5nGpicY/9lflnhzu2U UYyEObh1Nuwelq94JCeUeaxhl20HZMfYWGA5GNXpr6ZXf4sHjP+OGNxV/ImOiculydjouA6uhOUJ0 sJ7UosHThHP8Qto8QWaQFwLocVNaZ6EU3IqDOP44RosbcZSi3WlIymjWBoxQ9l+KmyrDDPoJvEHPJ sz7AJ9YCDkx3z57VhOKQBO2YhMhFATEFghZ/smA4aB6FTwovw9o73RIm87baPr4tiH56KjPqIJzSp JG8EkIZmg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSg9V-0006YZ-4e; Wed, 14 Oct 2020 12:45:09 +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 1kSg9R-0006Xs-Q9 for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 12:45:07 +0000 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 022AE20848 for ; Wed, 14 Oct 2020 12:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602679503; bh=6ppjzznNfXeMqO4LyVAjrU2/JGmafZJqPKLHZkiP5wQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WDMrFN9e89dT1EzhLNdABUUdMiXcEqo9qngnTAVFA8/bmpwf2/3PQ6RbLDSwRV1Da taHknkTL/3gOkZQiGUJWok92u6+wZkm45QJx/lRD2ThY/E/JO1ZDUMeo3UczHXJMrc FOXasJLpb4Z3Ht1VEOHUIBQpb/BI0F6MeNBEZZuU= Received: by mail-ot1-f47.google.com with SMTP id e20so3233930otj.11 for ; Wed, 14 Oct 2020 05:45:02 -0700 (PDT) X-Gm-Message-State: AOAM532HKogmJRq2K9Ivotr9fPEAdsNTTZNpxmB38wo6R52mUYRdTqeo JZ5gT2Lx02O+dbXcLyC1Ohf5L6o8zvqH0DpNO1I= X-Google-Smtp-Source: ABdhPJzlp8w6Tm/FX17qfsqKxftQkicXryVcTgriRqMFbY7SeG6EOdvh0iHAl8m5S1ePZnHs9RsNo+dJiOUdGRCv3a4= X-Received: by 2002:a05:6830:4028:: with SMTP id i8mr2718741ots.90.1602679502091; Wed, 14 Oct 2020 05:45:02 -0700 (PDT) MIME-Version: 1.0 References: <20201010093153.30177-1-ardb@kernel.org> <20201012092821.GB9844@gaia> <20201012112453.GD9844@gaia> <20201012154954.GB6493@gaia> <20201012162238.GC6493@gaia> <20201012165933.GD6493@gaia> In-Reply-To: From: Ard Biesheuvel Date: Wed, 14 Oct 2020 14:44:50 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan To: Nicolas Saenz Julienne X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_084506_040272_B60CC2A9 X-CRM114-Status: GOOD ( 38.98 ) 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 , Catalin Marinas , Sudeep Holla , Robin Murphy , Jeremy Linton , ACPI Devel Maling List , Rob Herring , Hanjun Guo , Will Deacon , Christoph Hellwig , 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, 13 Oct 2020 at 16:42, 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? > Would you mind adopting this patch, and insert it into your series where appropriate? (after dropping the Documentation/ change, and moving the prototype declaration into linux/acpi_iort.h?) Then, you can also include moving the reserve_crashkernel() into bootmem_init(). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel