Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4250623pxt; Wed, 11 Aug 2021 01:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcZMdBMIF12QSAq423m4qlpIAGOp0j4on2GqJgNC4oOi0+4jPrVK8GYMMpDvzVgPHSzQe6 X-Received: by 2002:a17:907:104f:: with SMTP id oy15mr2533073ejb.46.1628669729935; Wed, 11 Aug 2021 01:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628669729; cv=none; d=google.com; s=arc-20160816; b=JKyVWkMAK5JJRiXhdq6suuuKDD8ky0Wcg+BNgG6w4SuLwECOw5aNBTVzyUkPtmB/bf iePYj9bvkopwy6SrbGuffZe7PdplVp499Bi1vh91txRIv62JSBdJ3MfJVx1/v1YUFXzF 6gHQihBUCNZ3TL49B6DiUTI1zJgafkzAbyFhd7AlfJl8AwKf/Qg/NQN9tZr85cr8m/sm IA72s7Jcoswpm6p05HfytOX3ltmVgfTrRvXVKoJG9MpnRf765xiTGicZVg73BQVw2sfb XI5C0aM+oeN7+5HCibv5R/yXVtrdjUHXJoCuYtxA5umsVzg83dnF6w8/sgXxt24ZEAh4 ERCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Tz0+jEgIobQjuTow/ARUuugSs1kLubTzwy0T9ZLI9hU=; b=PScM+3tMhRhx5zoUFsT3kefXFVhMeOFWK32fjDTFVv+ht9wve8AsoDRBZI110XkGw9 8ad+I8bn1FhUEQsNxNuFmIkUy1A+4k+5wnE1yZlF617QTQHOfntsTXmnlglPb4i0Ti8d KQfd2En4d/qctlJ/NvdNRtjCwrOKWvDUyVeIqNr6RcY+1rK4dxilxn3lqirPazd7ldnd AgZ9E9tTdRSjTfKZKl+n6Hn3uhZGgkGeykVfgAuSWSSyq19jh2NcSlRwXjjGVsTYDfJh /ejV3cdKrX0MSLOC5p438zgZLJvAfu4PzJ0WVzuknWPoN/aigb0zYc9Mye2K1WgFYJgf dhkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf27si9391321edb.374.2021.08.11.01.15.04; Wed, 11 Aug 2021 01:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235849AbhHKIMK (ORCPT + 99 others); Wed, 11 Aug 2021 04:12:10 -0400 Received: from mail-vs1-f51.google.com ([209.85.217.51]:45756 "EHLO mail-vs1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235094AbhHKIMJ (ORCPT ); Wed, 11 Aug 2021 04:12:09 -0400 Received: by mail-vs1-f51.google.com with SMTP id a1so947704vsd.12; Wed, 11 Aug 2021 01:11:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tz0+jEgIobQjuTow/ARUuugSs1kLubTzwy0T9ZLI9hU=; b=fe+PFcMlNn5jjkw3HuZIgBmrfHqI3ogLbui4oymkdMtgrd6H7NXENRIIRJpNL0BINs MeinDJ8afMnFXErb3oRlLcT5ah2lnm1EcsNrrOQI9CXqlZe96a8Cl0mdqaxiiNkUHGXn /prN/GZI1kwZQFQtOX9IlSGCukMi8gAmCI6XyT6g9YII12U3h5QB6Ikbm8rBru2mY6LA rJAEJ7k/tNIq6lVBudpDcAK48QeCRCXf7X/SnbUFCCEvM2k3RocPQsgQel/m4E+cFRmH 29yJhnMuYIxGmZt2hK8EnWCIp246of5TqYVM6IumYUaHy8YdUI7tlqwmWhZAhaAcn9TS Rqog== X-Gm-Message-State: AOAM532WqA4lOw63DZFKP1SgRnXUWhUjOHvV+2GwuqIwTLXZhyXktU16 hsWM8hoshuVhTHjhmqRz7feYA4BRMeDjUX7prd0= X-Received: by 2002:a67:ca1c:: with SMTP id z28mr17470575vsk.40.1628669506037; Wed, 11 Aug 2021 01:11:46 -0700 (PDT) MIME-Version: 1.0 References: <04c4d231fb03a3810d72a45c8a5bc2272c5975f3.1626266516.git.geert+renesas@glider.be> <20210714135101.GB2441138@robh.at.kernel.org> In-Reply-To: <20210714135101.GB2441138@robh.at.kernel.org> From: Geert Uytterhoeven Date: Wed, 11 Aug 2021 10:11:34 +0200 Message-ID: Subject: Re: [PATCH v4 02/10] memblock: Add variables for usable memory limitation To: Rob Herring Cc: Russell King , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Mike Rapoport , Baoquan He , Vivek Goyal , Andrew Morton , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , linux-riscv , kexec@lists.infradead.org, Linux MM , Linux-Renesas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 14, 2021 at 3:51 PM Rob Herring wrote: > On Wed, Jul 14, 2021 at 02:50:12PM +0200, Geert Uytterhoeven wrote: > > Add two global variables (cap_mem_addr and cap_mem_size) for storing a > > base address and size, describing a limited region in which memory may > > be considered available for use by the kernel. If enabled, memory > > outside of this range is not available for use. > > > > These variables can by filled by firmware-specific code, and used in > > calls to memblock_cap_memory_range() by architecture-specific code. > > An example user is the parser of the "linux,usable-memory-range" > > property in the DT "/chosen" node. > > > > Signed-off-by: Geert Uytterhoeven > > --- > > This is similar to how the initial ramdisk (phys_initrd_{start,size}) > > and ELF core headers (elfcorehdr_{addr,size})) are handled. > > > > Does there exist a suitable place in the common memblock code to call > > "memblock_cap_memory_range(cap_mem_addr, cap_mem_size)", or does this > > have to be done in architecture-specific code? > > Can't you just call it from early_init_dt_scan_usablemem? If the > property is present, you want to call it. If the property is not > present, nothing happens. Seems to work fine when called from early_init_dt_scan_nodes(). Hence v5 will no longer need to touch memblock. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds