From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.50]) by mx.groups.io with SMTP id smtpd.web10.112.1626800355587344505 for ; Tue, 20 Jul 2021 09:59:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=g0x74Vn+; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.92.50, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BllpWPwfNRqYAZ9FbEbGN5xZjOax/zu1ag8nHppQd8nTr2mjsX/xrypB9+e25QF96N1nl1x/MT2qZDvO8lsdW4jw+EcfiyY/20oP29akAaGblxqIdzHn4HR/mOu+7H3P//sBXr8VcFqMssjwCBwGueoOLpm0zrtnySv4JAfn+o0IeQEaHCbyk5X0BTS6EA6A1/OA2xojQaWiP/JtGiy5vT2i8W9J0ob3jUp8cif0zo7aexONf9w/a9wv4yYc3YJdxK2ZL0rD0B44W6xZQIA8RKdQzqmWleifwLMJspWOZ5ci8lJYHCh1Is6LIoVUoouDVVUu7FHWQIebPLSTXwQqnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YRonYEQ5ccQsMUKYB1c9nTrSEdjaM/V+5e162HbHpJc=; b=J6Lxfed9GVVrPCUgowjKjy+OO4hLGoUcWFR5PvuLWIZaWDrRw15BQp2puI5hJATrpKlgNs7vYmd66H/6YiA9xAY9W+eewR/VPZQ9HVVs3aWv91paHQaaby3gsED4qzyvvlqyGInkS5EWQYYGmHtE4CFfy3ZHUAFqkZr7CJcNPe+CHTJr/6DPHY26nQkjVEoaQr9wnzcLrGYqiYcRonyQI3LC7AnlPTOmpXWjzGRRui4RiBahIy/1SIh4JsLnZ8vxJhY4Unr39v6NLq5i3FT8ipf/vP0GElQ5ZC7OpTBq+3KskbtbjwBCywlkF7laEyDKjP4r/f2FIeSfc9NpGhg4xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YRonYEQ5ccQsMUKYB1c9nTrSEdjaM/V+5e162HbHpJc=; b=g0x74Vn+JmbXF4gunFUVwUvCCHRwIEQnfY89PrAbxeY0vP3f5wAiKfRaMPsZLaCIc4/2D/wSCRdUKatuIh9WZHKL6AmNWCjbdMjtsx1CbL2KDYTSjDtJSh7a+9r37GwyLy2p+CbtEDckOSfckh4yDuWD8PWleLAm44onhhIIoRB9Lercoz+iZUhp5HfqZamQ7Sstd8Sc+zQ6b+I0wteWJwMvUaB+OtpzWzasthqMXlz0Mor6t8z9Makjqnqfbk+NmZQe9DNxSxIPT0fkqlAEVPRuz/hs2t5z9ZACiUz98HsBV96rXVOkyCPA21sSAGA78znEWUR7xbjHVMmcwArZSw== Received: from DM6PR12MB3340.namprd12.prod.outlook.com (2603:10b6:5:3d::24) by DM5PR12MB2405.namprd12.prod.outlook.com (2603:10b6:4:b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.29; Tue, 20 Jul 2021 16:59:14 +0000 Received: from DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::6476:8298:560:3950]) by DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::6476:8298:560:3950%2]) with mapi id 15.20.4331.034; Tue, 20 Jul 2021 16:59:14 +0000 From: "Jeff Brasen" To: Ard Biesheuvel , "Kinney, Michael D" CC: "devel@edk2.groups.io" , "ardb+tianocore@kernel.org" , "Justen, Jordan L" , "gaoliming@byosoft.com.cn" , "Liu, Zhiguang" , Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID Thread-Topic: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID Thread-Index: AQHXeaRpTUNd1pxiZkq9I+jwTkn0pKtEpekAgAAGJdqAANdngIAAL9cAgAAPsQCABlorCQ== Date: Tue, 20 Jul 2021 16:59:14 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3a500bb-e008-438d-9c14-08d94b9fb3f5 x-ms-traffictypediagnostic: DM5PR12MB2405: x-microsoft-antispam-prvs: x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k7QGIpLK7viErtnkVS8vJkDOrocTRvQJ6gJPJ2qukiR177wFqNOaATD9hgiQH0C92WpMIT+DRyYw5F5WmpAfR6D+y9fIIu2akKYXNlyeZLUB9lTYjto6ZtruW1Kw3IOz9PeU5KKFh3uAe6pxhk0Dz5Fh0TStujQkXYZENxAtiepKrL4y6kTL4OhC+wXLWFYs79lxTdj32MnWxhDWnz1OQ9y4z6sGaGCsMjmo4skFZZliTudrmO4nljjEB/EjhSYSVkNp2jkJYIcrzrIKi103QmW+R6CyJ7Aw03GDsoLSPqdFpIau7UNCbxVUcmb4MZTfTTXvlXmBIv9BpsIe7ZUtHr3H6c956cNtQJOiA7M3+rB+lgX0gcvxHI+79kHlwAx2TmO9VkOLAhFzw1I71p/VN3K76qYzYT+yWIvYjN0F28xq5n64BoPvW1zt4kVB3ca7phHiNABMQu2o+L+CnDGWkxZq8hAZPW7JSiT2YOS/iqczZmyeGks/wZ4BKEW2L1P4jPqL/ztphDJA38ipKcDXl7Ufo/tQlykPnYlacMp6dYdaXvfE1RTbFUmmdN0NpT7uLxII46B8uFu6rdGpeUAg0J/5R4rV9VTEYOqdQAWUeC4TMF/1ow/DBP35dptFOIf3EJetmSgqZq/h/yZXcrs5/9zx2eUaWfEIvtWuFqxetHLNDQqpPlwLUVmJdnNWCUUbSSEM4SyLFuUm7kijH+Uvfw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3340.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(508600001)(5660300002)(55016002)(66556008)(9686003)(316002)(19627405001)(2906002)(4326008)(122000001)(71200400001)(52536014)(38100700002)(8936002)(110136005)(66946007)(66446008)(33656002)(26005)(186003)(54906003)(66476007)(7696005)(8676002)(86362001)(76116006)(53546011)(64756008)(6506007)(38070700004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?x7yFRjhTnlpyOeMiYin3IUMwBp0VSSdNo0tx4BZtOVqNEXd1Oap7spl+GveK?= =?us-ascii?Q?7B1kMXz0qSrWSHb7zqnwj+tQLXE485DI3b0bHM0GSWnuLj+Kv0lvfbEShoTx?= =?us-ascii?Q?tn19y8RJ5AbvhfcKwSgJSs1IXBlUp/BhtZxsTSb1QkMn6ocUfk2AXH2wMUhb?= =?us-ascii?Q?0r3/DqVSczliF8U5Zw0o4hNTF3/d8dWMbWYf51Paknm5aPk1UXOoMa8kj7zl?= =?us-ascii?Q?/LE6Vy+qBBClrYXz2XknMicjKzBsntqStWN3HxBKnY24WiGsCchooKaQPZeQ?= =?us-ascii?Q?Hmn9PGttu4m7Wxvvd/Qa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Lhz?= =?us-ascii?Q?ywHlfSR9G7iG67DpzER5F0CDMp3KW4bmz2p72BLdW5lb+DF1kHDCZS8bpx0j?= =?us-ascii?Q?U1D3/vQMcTJEFQkRQMTlyeOtqnBxDQgKbNNVtY6csr7iu76/bwcqoveOYRX8?= =?us-ascii?Q?lnFGsBjZPLpyPWfpjsA9ogwd?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3340.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3a500bb-e008-438d-9c14-08d94b9fb3f5 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2021 16:59:14.0217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oRJW7RUWQ1ay4HZCib8BTE5tcn2LCpKwQWjh0vN7k55d0Y7+bvcAyJLqDnXYHn7IkIAn7QldmV6ZtPomONtN/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2405 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR12MB33404341FB649A212E6335E8CBE29DM6PR12MB3340namp_" --_000_DM6PR12MB33404341FB649A212E6335E8CBE29DM6PR12MB3340namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable In my opinion MdePkg is where this should be as it is meant to be used by m= ultiple software entities (linux kernel, grub, edk2, coreboot w/ uefi bindi= ng) and probably should be documented in some spec (Although, I am not sure= which one would make sense) I am fine with MdeModulePkg as well though. Thanks, Jeff ________________________________ From: Ard Biesheuvel Sent: Friday, July 16, 2021 9:56 AM To: Kinney, Michael D Cc: Jeff Brasen ; devel@edk2.groups.io ; ardb+tianocore@kernel.org ; Justen, Jord= an L ; gaoliming@byosoft.com.cn ; Liu, Zhiguang ; Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_I= NITRD_MEDIA_GUID External email: Use caution opening links or attachments On Fri, 16 Jul 2021 at 17:00, Kinney, Michael D wrote: > > Hi Ard, > > I see you were involved in the OS side changes. > > Can you explain what is required for the FW <-> OS interface with respect= to Load File Protocol and this media device path node. > > What happens if this media device path node is not present? What breaks? > > Trying to figure out if this is a required interop feature (MdePkg candid= ate) or an EDK II specific extension (MdeModulePkg candidate). > Let me give some context first: Linux distro boot generally relies on an initial ramdisk (initrd) which is provided by the loader, and which contains additional kernel modules (for storage and netwerk, for instance), and the initial user space startup code, ie., the code which brings up the user space side of the entire OS. Before we introduced this media path, the only way for a EFI pre-OS loader (such as GRUB) to provide this initrd was to copy it into DRAM somewhere, and use a arch-specific method of passing the DRAM address and size to the OS (x86 uses struct bootparam, whereas ARM uses device tree). It also requires knowledge on the part of GRUB regarding which parts of DRAM are suitable for holding an initrd image. For measured boot scenarios, it may be an advantage not to have the initrd linger in DRAM for longer that necessary, and we actually intend to measure the initrd loaded via the new method right after it has been loaded this way. To avoid extending this to other architectures such as RISC-V, I decided to introduce a special vendor media path for Linux initrd images, which GRUB et al can implement, which provides the initrd image when the OS loader that consumes it asks for it. So for Linux on x86 or ARM, this is optional, given that support for the old method is not going away any time soon. For RISC-V, I suggested that only the new method be implemented, but I am not sure what the status is there. Note that many embedded style systems don't use GRUB, and may not use initrds to begin with. OTOH, U-Boot also implements support for the Linux initrd vendor media path, and work is ongoing to add measured boot support as well. In any case, I don't have a strong preference where this should live, as long as it is in a generic place where all architectures can use it. -- Ard. --_000_DM6PR12MB33404341FB649A212E6335E8CBE29DM6PR12MB3340namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
In my opinion MdePkg is where this should be as it is meant to be used by m= ultiple software entities (linux kernel, grub, edk2, coreboot w/ uefi bindi= ng) and probably should be documented in some spec (Although, I am not sure= which one would make sense)

I am fine with MdeModulePkg as well though.

Thanks,

Jeff


From: Ard Biesheuvel <ar= db@kernel.org>
Sent: Friday, July 16, 2021 9:56 AM
To: Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Jeff Brasen <jbrasen@nvidia.com>; devel@edk2.groups.io <= ;devel@edk2.groups.io>; ardb+tianocore@kernel.org <ardb+tianocore@ker= nel.org>; Justen, Jordan L <jordan.l.justen@intel.com>; gaoliming@= byosoft.com.cn <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahm= oud@arm.com>
Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINU= X_EFI_INITRD_MEDIA_GUID
 
External email: Use caution opening links or attac= hments


On Fri, 16 Jul 2021 at 17:00, Kinney, Michael D
<michael.d.kinney@intel.com> wrote:
>
> Hi Ard,
>
> I see you were involved in the OS side changes.
>
> Can you explain what is required for the FW <-> OS interface wit= h respect to Load File Protocol and this media device path node.
>
> What happens if this media device path node is not present?  What= breaks?
>
> Trying to figure out if this is a required interop feature (MdePkg can= didate) or an EDK II specific extension (MdeModulePkg candidate).
>

Let me give some context first:

Linux distro boot generally relies on an initial ramdisk (initrd)
which is provided by the loader, and which contains additional kernel
modules (for storage and netwerk, for instance), and the initial user
space startup code, ie., the code which brings up the user space side
of the entire OS.

Before we introduced this media path, the only way for a EFI pre-OS
loader (such as GRUB) to provide this initrd was to copy it into DRAM
somewhere, and use a arch-specific method of passing the DRAM address
and size to the OS (x86 uses struct bootparam, whereas ARM uses device
tree). It also requires knowledge on the part of GRUB regarding which
parts of DRAM are suitable for holding an initrd image. For measured
boot scenarios, it may be an advantage not to have the initrd linger
in DRAM for longer that necessary, and we actually intend to measure
the initrd loaded via the new method right after it has been loaded
this way.

To avoid extending this to other architectures such as RISC-V, I
decided to introduce a special vendor media path for Linux initrd
images, which GRUB et al can implement, which provides the initrd
image when the OS loader that consumes it asks for it.

So for Linux on x86 or ARM, this is optional, given that support for
the old method is not going away any time soon. For RISC-V, I
suggested that only the new method be implemented, but I am not sure
what the status is there. Note that many embedded style systems don't
use GRUB, and may not use initrds to begin with. OTOH, U-Boot also
implements support for the Linux initrd vendor media path, and work is
ongoing to add measured boot support as well.

In any case, I don't have a strong preference where this should live,
as long as it is in a generic place where all architectures can use
it.

--
Ard.
--_000_DM6PR12MB33404341FB649A212E6335E8CBE29DM6PR12MB3340namp_--