Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp410830pxv; Wed, 14 Jul 2021 06:53:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUVkySKzgkfPNVFyjfpS0ghPHNEU4EqsytIGWgb/OB7BTPDLNHEhTJ3UNhRo7v5gJuapug X-Received: by 2002:a92:c083:: with SMTP id h3mr7013542ile.73.1626270779928; Wed, 14 Jul 2021 06:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626270779; cv=none; d=google.com; s=arc-20160816; b=jndDOv8LKUmG0KTMiT73TL+5PYVS1LLx79tiK6H+Ci7pmSlj7S0ZrClamPGbskm4zY V0rOz/9UpQ4T5DjswfZ8g/iZrUkC+IdeQqebSMqZoLvLbmcqkFXnCsgSF+ij2GpOCFEG qd98rvPsbIpSSQ97SY94xnop2SSs6R4yKfPjvxmzjSQu+D9Q/CxW2cOxGj5lshQYOGms zVW9Q20DiQuHv3vyxA/fQ7Da+r8z6eY7RuOk6nFdHpHaaVUFJ0EChivzOqRYYKly33gC PfryLa9nOeWsCtccrjIqPEYhEW1zP0YOrqUDFpilW6eDx8a5i+emQG0qJMxzs09PDBUo LDNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=50++kkpNpej8/NTD9q8DshcKL4G56n58bwfZ59/K0OU=; b=zmgKCcGoINEsTqlxDBdf37IW+jXPaMTG0N9RTBn/1SQPVNfd3AGVM/j1HY9Zizi/1h xTtw6RQ+LJluO6VF8OIw6lfw7IkwrX272tPF6MetxlO0ZguFxwa7RP2HEZXN9stRQCFU /VZwP+cxTO4rra0rOw+1A59schxtvsMds7OOO39meH4NOGNM1EPaYQocynIeYO4vdVYD drUSvRxj0s5opIL1qKSjcEJKP7Opx23vwjrLdRkIEr3T0C4GGCixAGAX2vd9PEuMAFFw LHqDGwWp0axaQ02B5iQop8SNZ0bv3MEgXl7DZMxQeAPu7mZRgnydCZoDptVENSRVXhGG SkMw== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si3463113iow.87.2021.07.14.06.52.46; Wed, 14 Jul 2021 06:52:59 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231815AbhGNNx6 (ORCPT + 99 others); Wed, 14 Jul 2021 09:53:58 -0400 Received: from mail-io1-f42.google.com ([209.85.166.42]:36748 "EHLO mail-io1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231478AbhGNNx6 (ORCPT ); Wed, 14 Jul 2021 09:53:58 -0400 Received: by mail-io1-f42.google.com with SMTP id u7so2157452ion.3; Wed, 14 Jul 2021 06:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=50++kkpNpej8/NTD9q8DshcKL4G56n58bwfZ59/K0OU=; b=GX3mMdEKxQV1DYNgjzcnv9mWui8dFHR6+5ZKd0ZfPz8RSjmWnWhw+cI3Gue3hoTgYS 13sZA7QAWbx819BCMBFonHvTW85FZb1YX+lk7lczQvYQ7egEe6ry5VVUYhGPjMVdGApu vD94vFMCv4iw5Pb9EqdZvFkdTnEsJpQQ24z0rn76SLk1qSZf0MDfZavPZxjD8g36a6Mf OnkaVUL2AfN80o/FmySEVgoJ4ZL99CdrMG8zvlJhAtBG4bUT6DVJmYQwzgxlS3k9zLyG xhfGQYwj0KDWsKg5SorLVdfkmwPJqto0LCLdKRP1JtcMBEg9FYowmJrfBgh6OSyQAvQr tI2w== X-Gm-Message-State: AOAM530CEAeT6v7HfV0AJ+rSvUO9imIR9KYEeKy1MczsVD5hv409g/RK 7Rz1K1KxzAJETGNT92iwjw== X-Received: by 2002:a02:7093:: with SMTP id f141mr8988326jac.24.1626270666077; Wed, 14 Jul 2021 06:51:06 -0700 (PDT) Received: from robh.at.kernel.org ([64.188.179.248]) by smtp.gmail.com with ESMTPSA id s2sm1323967ilq.45.2021.07.14.06.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 06:51:05 -0700 (PDT) Received: (nullmailer pid 2459772 invoked by uid 1000); Wed, 14 Jul 2021 13:51:01 -0000 Date: Wed, 14 Jul 2021 07:51:01 -0600 From: Rob Herring To: Geert Uytterhoeven 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 , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, linux-mm@kvack.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 02/10] memblock: Add variables for usable memory limitation Message-ID: <20210714135101.GB2441138@robh.at.kernel.org> References: <04c4d231fb03a3810d72a45c8a5bc2272c5975f3.1626266516.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04c4d231fb03a3810d72a45c8a5bc2272c5975f3.1626266516.git.geert+renesas@glider.be> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Rob