Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp103581rdf; Mon, 20 Nov 2023 18:13:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8bhclYDi+u3xqIuxsjv0qA/MaFWwj1jmh9CUF/2PX2UnzqiZOR51ZRCytw0nJRrqZeAfl X-Received: by 2002:a05:6808:1915:b0:3a7:2d4c:5d4e with SMTP id bf21-20020a056808191500b003a72d4c5d4emr12768417oib.7.1700532780891; Mon, 20 Nov 2023 18:13:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700532780; cv=none; d=google.com; s=arc-20160816; b=o2eI+jD2dUHyR+Mj71wuHJqPJxsE94Wov+s8qO3AYDRQgaB9Cnit+k4BQ1W95vdXts 7qTc2UummNFrTPlZ8/XbNc+VVvYBUx6/teaYzHJWjU39ruoxT07tDQFby335dH2M+FgT oRUA3qHVT/TIKefCU9J78tI4tuSp6WHDMhAzoQtDRXfejyh2ObCebnkPLFjSzMnepb/7 9/rnnDh5jhHvXC5Bsje+R/8EEO9YdtETNDShBCrQ3Ho54c6W89wy0ouav7ijtBGR6Bvc 2ZNOIA0Gb2riWHRg5XLmPkgEovbSTk2XpU62tKgUMdfFl2eKSrMqdN0pqpIwvx87AAhl joiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9oErZSNPpRWj6cWya6fUNKL2baOOgkbfElqn5bDFEVg=; fh=qv4hr+2raX41Ds5D4zdNM4FeCqyongGywxkupETKcXU=; b=AlxSNxEGKkURgOYQf7y5GsPdDd3+NA9dPntsK9qPZmu8F6ka7k880PXQHPodq5t1pP CFS6bBxX0mpdhN5WwN2NgwflOEtWJCo/3h73FJbV0YyIV1ELWHk4d97WgD+YCC4awN6p Rc6Ewr/FBQh2pTZvSaLOnZkdiK6k6Lj8W3hxkwF0+1Z03dwm/23emJX/z6toEhREqVMq O4rHqHN7H7MF/kkhG2z5zzgYLpc/06R50Rg5r1cttXIQGe5xo/tf2TYNdyHtBb/t0ZMO Zjika6ZBM+zKi9UfHsOOIqB5Lam2tNjRIvWY7m09/s99VEND16f1mwfX8GSJEtCKwi97 yOGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hI6HwzSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j4-20020a056a00130400b006bca1246564si9244196pfu.271.2023.11.20.18.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 18:13:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hI6HwzSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0E8D88046476; Mon, 20 Nov 2023 18:12:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjKUCMe (ORCPT + 99 others); Mon, 20 Nov 2023 21:12:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjKUCMd (ORCPT ); Mon, 20 Nov 2023 21:12:33 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F36FFC3 for ; Mon, 20 Nov 2023 18:12:28 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9dd6dc9c00cso691504966b.3 for ; Mon, 20 Nov 2023 18:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700532747; x=1701137547; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9oErZSNPpRWj6cWya6fUNKL2baOOgkbfElqn5bDFEVg=; b=hI6HwzSJqvv1l6eUOdiw8G6El52O7iwrLBNs5BCWCw3HIxV5qzXyVeLVA5LlP2vgKH QJ2z29cqeoRZfx6ilVuPVWLtXoU8Tjcju0ns0MO3zONgI9Ae9PQw/pURSdi1mEaDchcL JkHEClHRNOV3VFWcRzhFtiSQoZuzaPqKzTOsc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700532747; x=1701137547; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9oErZSNPpRWj6cWya6fUNKL2baOOgkbfElqn5bDFEVg=; b=lYFpzxsdznxNxZITGNBJ0o7iS6ypV1r2Vkncj0vkz3dM67vr/6qJhAa6ZfoL3p4uwV VV6FU3yPPOcY9ZJkctuOdexdCk9CGJzhVMqmp8iAfyJwYpIU08joFpYPU3O6UrLlHamV UiyKXrz54mDbAHy/5tlIAZODHbCLB87RV4ylg2TMAR0E0xmE2We5rQ0RUWN2dO7GTe93 J6xzanhL00IkY6Jyu6GNe2CcWadHcZHVEiLyF3i9zKRKDtonVF4V5Bnd9JYzmOQoLxjN sN0DQTGjXKHdpWGUlMsTptPNIe7OVnE+uHOoik3y/UqScXhJOtIWCJjCbmF+KjuGp3/N jyQQ== X-Gm-Message-State: AOJu0YxlTuy+r1Pftt+b2Sa6PtKwfS/0xPqgzc7IYTEB0FkxyvXlyXrf BJRwsdo1rC63MiQ2O9WKqn+J/0aau0QYSOU54i6w0w== X-Received: by 2002:a17:906:224d:b0:9bf:2f84:5de7 with SMTP id 13-20020a170906224d00b009bf2f845de7mr6153971ejr.4.1700532747244; Mon, 20 Nov 2023 18:12:27 -0800 (PST) MIME-Version: 1.0 References: <20230926194242.2732127-1-sjg@chromium.org> <20230926194242.2732127-2-sjg@chromium.org> In-Reply-To: From: Simon Glass Date: Mon, 20 Nov 2023 19:12:15 -0700 Message-ID: Subject: Re: [PATCH v7 2/2] schemas: Add some common reserved-memory usages To: "Chiu, Chasel" Cc: Ard Biesheuvel , "devicetree@vger.kernel.org" , Mark Rutland , Rob Herring , "Tan, Lean Sheng" , lkml , Dhaval Sharma , "Brune, Maximilian" , Yunhui Cui , "Dong, Guo" , Tom Rini , ron minnich , "Guo, Gua" , "linux-acpi@vger.kernel.org" , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 18:12:57 -0800 (PST) Hi, On Mon, 13 Nov 2023 at 11:09, Chiu, Chasel wrote: > > > Hi Ard, > > Please see my reply below inline. > > Thanks, > Chasel > > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: Saturday, November 11, 2023 3:04 AM > > To: Chiu, Chasel > > Cc: Simon Glass ; devicetree@vger.kernel.org; Mark Ru= tland > > ; Rob Herring ; Tan, Lean Sheng > > ; lkml ; Dhaval > > Sharma ; Brune, Maximilian > > ; Yunhui Cui ; > > Dong, Guo ; Tom Rini ; ron minn= ich > > ; Guo, Gua ; linux- > > acpi@vger.kernel.org; U-Boot Mailing List > > Subject: Re: [PATCH v7 2/2] schemas: Add some common reserved-memory > > usages > > > > On Sat, 11 Nov 2023 at 04:20, Chiu, Chasel wrot= e: > > > > > > > > > Just sharing some usage examples from UEFI/EDK2 scenario. > > > To support ACPI S4/Hibernation, memory map must be consistent before > > > entering and after resuming from S4, in this case payload may need to > > > know previous memory map from bootloader (currently generic payload > > > cannot access platform/bootloader specific non-volatile data, thus > > > could not save/restore memory map information) > > > > So how would EDK2 reconstruct the entire EFI memory map from just these > > unannotated /reserved-memory nodes? The EFI memory map contains much > > more information than that, and all of it has to match the pre-hibernat= e situation, > > right? Can you given an example? > > > Here we listed only typically memory types that may change cross differen= t platforms. > Reserved memory type already can be handled by reserved-memory node, and = rest of the types usually no need to change cross platforms thus currently = we could rely on default in generic payload. > In the future if we see a need to add new memory types we will discuss an= d add it to FDT schema. > > > > > > > > Another usage is to support binary model which generic payload is a p= rebuilt > > binary compatible for all platforms/configurations, however the payload= default > > memory map might not always work for all the configurations and we want= to > > allow bootloader to override payload default memory map without recompi= ling. > > > > > > > Agreed. But can you explain how a EDK2 payload might make meaningful us= e of > > 'runtime-code' regions provided via DT by the non-EDK2 platform init? = Can you > > give an example? > > > Runtime-code/data is used by UEFI payload for booting UEFI OS which requi= red UEFI runtime services. > Platform Init will select some regions from the usable memory and assign = it to runtime-code/data for UPL to consume. Or assign same runtime-code/dat= a from previous boot. > If UEFI OS is not supported, PlatformInit may not need to provide runtime= -code/data regions to payload. (always providing runtime-code/data should b= e supported too) > > > > > > > Under below assumption: > > > FDT OS impact has been evaluated and taken care by relevant > > experts/stakeholders. > > > Reviewed-by: Chasel Chiu > > > > > > > I am sorry but I don't know what 'FDT OS impact' means. We are talking = about a > > firmware-to-firmware abstraction that has the potential to leak into th= e OS > > visible interface. > > > > I am a maintainer in the Tianocore project myself, so it would help if = you could > > explain who these relevant experts and stakeholders are. Was this discu= ssed on > > the edk2-devel mailing list? If so, apologies for missing it but I may = not have been > > cc'ed perhaps? > > > > > I'm not familiar with FDT OS, also I do not know if who from edk2-devel w= ere supporting FDT OS, I think Simon might be able to connect FDT OS expert= s/stakeholders. > We are mostly focusing on payload firmware phase implementation in edk2 (= and other payloads too), however, since we have aligned the payload FDT and= OS FDT months ago, I'm assuming FDT OS impact must be there and we need (o= r already done?) FDT OS experts to support it. (again, maybe Simon could sh= are more information about FDT OS) > > In edk2 such FDT schema is UefiPayloadPkg internal usage only and payload= entry will convert FDT into HOB thus we expected the most of the edk2 gene= ric code are no-touch/no impact, that's why we only had small group (UefiPa= yloadPkg) discussion. > Ard, if you are aware of any edk2 code that's for supporting FDT OS, plea= se let us know and we can discuss if those code were impacted or not. We discussed this and just to clarify, 'FDT OS' is not a special OS, it is just Linux. So, with the above, are we all on the same page? Can the patch be applied, perhaps? If not, what other discussion is needed? Regards, Simon > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Simon Glass > > > > Sent: Tuesday, September 26, 2023 12:43 PM > > > > To: devicetree@vger.kernel.org > > > > Cc: Mark Rutland ; Rob Herring > > > > ; Tan, Lean Sheng ; lkml > > > > ; Dhaval Sharma > > > > ; Brune, Maximilian > > > > ; Yunhui Cui > > > > ; Dong, Guo ; Tom Rini > > > > ; ron minnich ; Guo, Gua > > > > ; Chiu, Chasel ; linux- > > > > acpi@vger.kernel.org; U-Boot Mailing List ; > > > > Ard Biesheuvel ; Simon Glass > > > > Subject: [PATCH v7 2/2] schemas: Add some common reserved-memory > > > > usages > > > > > > > > It is common to split firmware into 'Platform Init', which does the > > > > initial hardware setup and a "Payload" which selects the OS to be b= ooted. > > > > Thus an handover interface is required between these two pieces. > > > > > > > > Where UEFI boot-time services are not available, but UEFI firmware > > > > is present on either side of this interface, information about > > > > memory usage and attributes must be presented to the "Payload" in s= ome > > form. > > > > > > > > This aims to provide an small schema addition for the memory mappin= g > > > > needed to keep these two pieces working together well. > > > > > > > > Signed-off-by: Simon Glass > > > > --- > > > > > > > > Changes in v7: > > > > - Rename acpi-reclaim to acpi > > > > - Drop individual mention of when memory can be reclaimed > > > > - Rewrite the item descriptions > > > > - Add back the UEFI text (with trepidation) > > > > > > > > Changes in v6: > > > > - Drop mention of UEFI > > > > - Use compatible strings instead of node names > > > > > > > > Changes in v5: > > > > - Drop the memory-map node (should have done that in v4) > > > > - Tidy up schema a bit > > > > > > > > Changes in v4: > > > > - Make use of the reserved-memory node instead of creating a new on= e > > > > > > > > Changes in v3: > > > > - Reword commit message again > > > > - cc a lot more people, from the FFI patch > > > > - Split out the attributes into the /memory nodes > > > > > > > > Changes in v2: > > > > - Reword commit message > > > > > > > > .../reserved-memory/common-reserved.yaml | 71 +++++++++++++++= ++++ > > > > 1 file changed, 71 insertions(+) > > > > create mode 100644 dtschema/schemas/reserved-memory/common- > > > > reserved.yaml > > > > > > > > diff --git a/dtschema/schemas/reserved-memory/common-reserved.yaml > > > > b/dtschema/schemas/reserved-memory/common-reserved.yaml > > > > new file mode 100644 > > > > index 0000000..f7fbdfd > > > > --- /dev/null > > > > +++ b/dtschema/schemas/reserved-memory/common-reserved.yaml > > > > @@ -0,0 +1,71 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2 > > > > +--- > > > > +$id: > > > > +http://devicetree.org/schemas/reserved-memory/common-reserved.yaml= # > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: Common memory reservations > > > > + > > > > +description: | > > > > + Specifies that the reserved memory region can be used for the > > > > +purpose > > > > + indicated by its compatible string. > > > > + > > > > + Clients may reuse this reserved memory if they understand what i= t > > > > + is for, subject to the notes below. > > > > + > > > > +maintainers: > > > > + - Simon Glass > > > > + > > > > +allOf: > > > > + - $ref: reserved-memory.yaml > > > > + > > > > +properties: > > > > + compatible: > > > > + description: | > > > > + This describes some common memory reservations, with the com= patible > > > > + string indicating what it is used for: > > > > + > > > > + acpi: Advanced Configuration and Power Interface (ACPI) t= ables > > > > + acpi-nvs: ACPI Non-Volatile-Sleeping Memory (NVS). This i= s reserved by > > > > + the firmware for its use and is required to be saved an= d restored > > > > + across an NVS sleep > > > > + boot-code: Contains code used for booting which is not ne= eded by the > > OS > > > > + boot-code: Contains data used for booting which is not ne= eded by the > > OS > > > > + runtime-code: Contains code used for interacting with the= system when > > > > + running the OS > > > > + runtime-data: Contains data used for interacting with the= system when > > > > + running the OS > > > > + > > > > + enum: > > > > + - acpi > > > > + - acpi-nvs > > > > + - boot-code > > > > + - boot-data > > > > + - runtime-code > > > > + - runtime-data > > > > + > > > > + reg: > > > > + description: region of memory that is reserved for the purpose= indicated > > > > + by the compatible string. > > > > + > > > > +required: > > > > + - reg > > > > + > > > > +unevaluatedProperties: false > > > > + > > > > +examples: > > > > + - | > > > > + reserved-memory { > > > > + #address-cells =3D <1>; > > > > + #size-cells =3D <1>; > > > > + > > > > + reserved@12340000 { > > > > + compatible =3D "boot-code"; > > > > + reg =3D <0x12340000 0x00800000>; > > > > + }; > > > > + > > > > + reserved@43210000 { > > > > + compatible =3D "boot-data"; > > > > + reg =3D <0x43210000 0x00800000>; > > > > + }; > > > > + }; > > > > -- > > > > 2.42.0.515.g380fc7ccd1-goog > > >