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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 EE7D5C43214 for ; Wed, 11 Aug 2021 08:11:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D176E60F55 for ; Wed, 11 Aug 2021 08:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235928AbhHKIML (ORCPT ); Wed, 11 Aug 2021 04:12:11 -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-Google-Smtp-Source: ABdhPJyQYdEzQ87d4q8Gjh5OGWc3XIzYeTLsfNGD+TMt1AWgMT8WjUJws7odP2IIw+RmtCkRDyil2IHyZbu6KAbZAGY= 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 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 380ABC4338F for ; Wed, 11 Aug 2021 08:12:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8EDF860EB5 for ; Wed, 11 Aug 2021 08:12:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8EDF860EB5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc: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=8eGFcyxjaPI69BgUFmyerxd7uMv+hSOhwbFOuXFivsw=; b=AK5mF4Udh5M79d pXnLZL002R7Nm8uahU8k+wR8c/5aOT06t9RvLcBg2TD2EV8U4mRkdd2pgPkyrFQcTzGRdg5bKWH/4 f35uZ7V0Tz2MhFYeAlIZUACEZbYZwP6ICVyW3wsXqMtVVgxSLsk+HGOdp9OnqZ3fZli5Ul2kad4sm 3+45AMrEd3heoZqYO2Kvl1SbhhYzxehIvTlSmM4qIT+8XyYyI3poVmlowiN21BblCafTw03HDDGPl A3Ou++w0BSUeHA6ijjxT4QJKNi/Qqw7JYsjVlM1n3n3IUKNcl7DzmDaYcsEsTRdxyZNdyuntZGL2d LavGiFA/IPNiqMFHA/kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDjLK-0060Et-FG; Wed, 11 Aug 2021 08:12:06 +0000 Received: from mail-vs1-f41.google.com ([209.85.217.41]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDjL1-006087-NV; Wed, 11 Aug 2021 08:11:49 +0000 Received: by mail-vs1-f41.google.com with SMTP id f6so974230vso.5; 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=dbwxQVhwg+bRmjrvhBft1rifFLUEn0eVqg+EKj6OoyxqXvWg/p1vjs+XFVB9oth2vM qrtNTD9bKl6RXFTgBtvmq81HhVhMp3CUEHoW+rtdij1d6Aj/ktyGfOMqPS7JpxKv/RKX /283SrDndemRp7rCQwy9od+msQPzryZS4RjgPvuV/IDUrgU5FkEhg/XG4JquSClGWHei XFX8d42cZ+xjdkmPUwhyrWpLGLG1Z6GAIYBUT7mbxedrEIfTjQfMnIx0drKdc0KNn45d /O+/VD37pda+xCv4+6nVmwV/bZeverIU08V/ZQinqHRI3fSHnxCIHoET31+nzcIJ7SZ3 ztPw== X-Gm-Message-State: AOAM530vEK/qCITqjkePp3B89yidsyqSutQMxwA4h5Ai4bp6iYlZtDuA 4hZY0gLel0H+m74DEAhN9QziQhn4DzePwyHIxRU= X-Google-Smtp-Source: ABdhPJyQYdEzQ87d4q8Gjh5OGWc3XIzYeTLsfNGD+TMt1AWgMT8WjUJws7odP2IIw+RmtCkRDyil2IHyZbu6KAbZAGY= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_011147_811209_DF04A6C8 X-CRM114-Status: GOOD ( 32.70 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 39B8EC432BE for ; Wed, 11 Aug 2021 08:11:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 88CF760FC0 for ; Wed, 11 Aug 2021 08:11:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 88CF760FC0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AF54A8D0001; Wed, 11 Aug 2021 04:11:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA5776B0072; Wed, 11 Aug 2021 04:11:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 994058D0001; Wed, 11 Aug 2021 04:11:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 7EB8E6B0071 for ; Wed, 11 Aug 2021 04:11:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2353D181C43A9 for ; Wed, 11 Aug 2021 08:11:47 +0000 (UTC) X-FDA: 78462081054.14.79AF46F Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) by imf04.hostedemail.com (Postfix) with ESMTP id B35795003D60 for ; Wed, 11 Aug 2021 08:11:46 +0000 (UTC) Received: by mail-vs1-f46.google.com with SMTP id y65so982910vsy.3 for ; 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=sy5ZQ3Xe3vgjAULA8Pf66PUYDSTBX5kdb7gfIaAen02P/7xsqJch8awraNVlJ1sNub kOVENyIPWCTkyW2aXstBmL7uM9BKYV+EixZrz1My7KTt5znOk2SGVbX+DLgFPWnAKjUK rJsDL+o5yajUIpHI6jqlkiW3UITy1G8xFA9foAxdhdPhu6RxmIYAlvDIKPR8crFMlZHz AkwZec/7cGvKJSTAcpmFCOkZhEGbcSpc/zkH924MGC9H3glqbOiOpiH/1UdIn4wprRu8 iCoWWy7MGXWERzZh0FWCdbcj0z2p4nP2DUQq2bt9R1oFFJAzkrU9vgzkEgnzfTL8qMKw T2xw== X-Gm-Message-State: AOAM53091iZVtIRPIH6ge4N+PD4/ZjzkQFIn1kroqmUMd4PNaBRUCDrh d2Jsj5Q2liABanHH7ShuD7QhSUmnWz62yvS8WiA= X-Google-Smtp-Source: ABdhPJyQYdEzQ87d4q8Gjh5OGWc3XIzYeTLsfNGD+TMt1AWgMT8WjUJws7odP2IIw+RmtCkRDyil2IHyZbu6KAbZAGY= 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" Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of geertuytterhoeven@gmail.com designates 209.85.217.46 as permitted sender) smtp.mailfrom=geertuytterhoeven@gmail.com; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B35795003D60 X-Stat-Signature: ardppdfsfut4edxny3ceec5ip7fmomeq X-HE-Tag: 1628669506-575708 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 7A4ADC4338F for ; Wed, 11 Aug 2021 08:14:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E35B560EB5 for ; Wed, 11 Aug 2021 08:14:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E35B560EB5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc: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=zfbrym/KSxAhpeD53nwdc3yyUN2ZaOiVAs27MJMn20I=; b=pUyZIi5aLXLk+D 9k2MRMjSe0CBtWp5L5wfNhhbjAzpHq81BskUq+jf3p2AIUsUdK8hnIIgThF8aJ7BsltMvPTexM/JH 4clxoryHW6+iiJy5MHlwQ23y3gG8qCs7cGWxwBDDQEshQEsknQLKebzIoEGOu8ymctSUDDLHai/An AgGgS6XYGVdXsG7IMI0swd1jMxrD4eJc7raEq58VMHr22PIDiFob3ct6KMdkTU5iROKnRdIpEu39j SCNDfmHyLku4dhZifv1SkgwfzsVj8nUrPqLZDbmhn31XylzUmwyNP13/jtAz3nOxjlKEqKr0HO341 Ajom/lyDSPfzqKiFmtXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDjLA-0060Bd-Fz; Wed, 11 Aug 2021 08:11:56 +0000 Received: from mail-vs1-f41.google.com ([209.85.217.41]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDjL1-006087-NV; Wed, 11 Aug 2021 08:11:49 +0000 Received: by mail-vs1-f41.google.com with SMTP id f6so974230vso.5; 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=dbwxQVhwg+bRmjrvhBft1rifFLUEn0eVqg+EKj6OoyxqXvWg/p1vjs+XFVB9oth2vM qrtNTD9bKl6RXFTgBtvmq81HhVhMp3CUEHoW+rtdij1d6Aj/ktyGfOMqPS7JpxKv/RKX /283SrDndemRp7rCQwy9od+msQPzryZS4RjgPvuV/IDUrgU5FkEhg/XG4JquSClGWHei XFX8d42cZ+xjdkmPUwhyrWpLGLG1Z6GAIYBUT7mbxedrEIfTjQfMnIx0drKdc0KNn45d /O+/VD37pda+xCv4+6nVmwV/bZeverIU08V/ZQinqHRI3fSHnxCIHoET31+nzcIJ7SZ3 ztPw== X-Gm-Message-State: AOAM530vEK/qCITqjkePp3B89yidsyqSutQMxwA4h5Ai4bp6iYlZtDuA 4hZY0gLel0H+m74DEAhN9QziQhn4DzePwyHIxRU= X-Google-Smtp-Source: ABdhPJyQYdEzQ87d4q8Gjh5OGWc3XIzYeTLsfNGD+TMt1AWgMT8WjUJws7odP2IIw+RmtCkRDyil2IHyZbu6KAbZAGY= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_011147_811209_DF04A6C8 X-CRM114-Status: GOOD ( 32.70 ) 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 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 _______________________________________________ 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 Return-path: 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org 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 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 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec