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 D41C4C433F5 for ; Wed, 12 Jan 2022 18:07:09 +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:References: Message-ID:Subject:Cc: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=1YdNDv4e+sqUnR5Dq0/Pf1oJigwmeLn6zNJChjUGD9Q=; b=BFzAwap6eYW7nT vGEOrBzY9H0Ocx9onhaYZCq6XO62HYk6lJI3w+eUvM2pMNeyWLmLl/0B2g8QcOe25FKVMELtplucS vevTh8/iRjJrhJZn6sgu4JionCzWs9f8Xa+IOKKn0ZakMeTGJAhf3C/44y6/sLkFxgS9Rcs8AXPPC aPw0zp7ZzurXl/KBIY3hWkM3xXAU8Gssmh02IemRuvvkflYTXNfF5Ha6zKNJLB1ouPBRkfPTOmb3E dzkWDv5B2DuWg0w/Eyc6lCCEOMLCgMbibbEnHBozpJQj2zDndW0VpyjSxURRXNQskzpIA4VED3k4S 7Zw16ICt2jKU1yw7p29A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7i0U-003PfG-U8; Wed, 12 Jan 2022 18:05:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7i0O-003PdD-BG; Wed, 12 Jan 2022 18:05:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D9C646199F; Wed, 12 Jan 2022 18:05:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DDABC36AE5; Wed, 12 Jan 2022 18:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642010751; bh=jeMAXsD0RQlHdtuX5ty1VxBTZG6coZYil0NxX+mHVXQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rKRlZc1mzdvVLDPimEh2XnSL8qxBf/33jwUf4yenZgE3OzOhcsRRweFgWg/iuckRY clYXBJqANQ0mO8U6PXE0O8QefvoYrqyD8mhvN+Vh0scBpgefaSNjdiegPiEh7TqmNw PYBwjIRX+4K0kD1Adwzevv6CnYI35vPhUSYKm9IAr+DaBM3PJaLzXcfauR2tbp3ORX O8k9JGDFGs/m1s1bsVs/sXXL1vU+0cv5PkvmqkTJG0D44P1ra12fGVBdccnB4pWbs5 IuynmG80HNYhcx75MCn/e0PP7lKe9S23QhRF/safDSz0jzs9FN604K1pLkBJlo7yxp zEWKF0EHBSMpw== Date: Wed, 12 Jan 2022 20:05:41 +0200 From: Mike Rapoport To: Frank van der Linden Cc: linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, frowand.list@gmail.com, ardb@kernel.org, linux-mm@kvack.org, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, geert+renesas@glider.be Subject: Re: [PATCH 1/3] memblock: define functions to set the usable memory range Message-ID: References: <20220110210809.3528-1-fllinden@amazon.com> <20220110210809.3528-2-fllinden@amazon.com> <20220111204441.GA36458@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220111204441.GA36458@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220112_100552_498474_0EFD308C X-CRM114-Status: GOOD ( 23.99 ) 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 Tue, Jan 11, 2022 at 08:44:41PM +0000, Frank van der Linden wrote: > On Tue, Jan 11, 2022 at 12:31:58PM +0200, Mike Rapoport wrote: > > > --- a/include/linux/memblock.h > > > +++ b/include/linux/memblock.h > > > @@ -481,6 +481,8 @@ phys_addr_t memblock_reserved_size(void); > > > phys_addr_t memblock_start_of_DRAM(void); > > > phys_addr_t memblock_end_of_DRAM(void); > > > void memblock_enforce_memory_limit(phys_addr_t memory_limit); > > > +void memblock_set_usable_range(phys_addr_t base, phys_addr_t size); > > > +void memblock_enforce_usable_range(void); > > > void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size); > > > void memblock_mem_limit_remove_map(phys_addr_t limit); > > > > We already have 3 very similar interfaces that deal with memory capping. > > Now you suggest to add fourth that will "generically" solve a single use > > case of DT, EFI and kdump interaction on arm64. > > > > Looks like a workaround for a fundamental issue of incompatibility between > > DT and EFI wrt memory registration. > > Yep, I figured this would be the main argument against this - arm64 > already added several other more-or-less special cased interfaces over > time. > > I'm more than happy to solve this in a different way. > > What would you suggest: > > 1) Try to merge the similar interfaces in to one. This could be a nice cleanup regardless of how we handle "linux,usable-memory-range". > 2) Just deal with it at a lower (arm64) level? Probably it will be the simplest solution in the short term. > 3) Some other way? I'm not expert enough on DT and EFI to see how they communicate the linux,usable-memory-range property. One thought I have is since we already create a DT for kexec/kdump why can't we add some data to EFI memory description similar to linux,usable-memore-range? Another thing is, if we could presume that DT and EFI are consistent in their view what is the span of the physical memory, we could drop memblock_remove(EVERYTHIING) and early_init_dt_add_memory_arch() from efi_init::reserve_regions() and then the loop over EFI memory descriptors will only take care of reserved and nomap regions. > Thanks, > > - Frank > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel