From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 77357D800EA for ; Tue, 21 Nov 2023 01:52:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kGr2F2jSlbbIXS19GVl5eLHNYGXei56P8MQjOfqNAyU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700531549; v=1; b=KLCXLdnftNhzqjaZs/CSjvZtVXFiWB8WNphLyGHXyoyd1887QVnF6ZmBo7bo5Ho3dA0xfK8K YjwuF3wepbcpui1WNGYvZswTyLCj0eBB12ntlXHwYIrCXl3k3hB2ns461DUrIBaXcj1Ml1m+q9N d2R0VNMg1US27knhDtWne/wc= X-Received: by 127.0.0.2 with SMTP id XLmjYY7687511xZpSXAe4jGV; Mon, 20 Nov 2023 17:52:29 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.70]) by mx.groups.io with SMTP id smtpd.web11.25302.1700531548214916236 for ; Mon, 20 Nov 2023 17:52:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RpzHaYRwt6ndwMIRd8xkg9la3TPfwn+gVvZ2ABbY4R67DtNBLPoJwZRERkZX9m9zCOOdwm1U4eJkuyWj/I2vbqiYuZfVOpUXZRYenhVMV1SalPNucogxwD/S2XTX0ru0Y5JIgrMIkBvIT8GMt0IdUJQvxNmVRjxXeHSbSqDtGFE7F1czLQjDfgqtqCDBA9caIcsAG+05WjhUvOsDY/rF6Rv0kUbXKinjt/U0sjdng8ilbVNN/xPNpVl2VAhihI0EiULDtfBZQLXF53EVId7Onr0910a6vd3WUkWYbNYZzPFqgdH8nWvoSbrNAQ0PSsiWLM49p3Rsm/PM2oiwP0ob8g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2yC+I0Sy0xJT01BEZsDYQT98Cxpk8WjEfi1VgyNhJdA=; b=IBvxK+HQOdxewh7CuvkL49ctwtt5ZrXuqgN7QK9MnOoiL1KaRGRB24pr2buxakHe3DspWrAl/N51DxPsbuM0CHlpiLr0B4CUBLb1i5akLR2nzwwmKmihRdQlZ1W6+Jtl80QF29Qm4WLiAAUcVGpSfSQrlUXA/O72QFM74wV5NDFmVHhq5R9b21mkK12iVhCzWZ2Q62umKtjgPuBr/tmVnz8zkVyWG52TJmEm4N8xgj3h9z5KnnZg6lM4v+DkquIM5OYmBbXr9sAjRvos51iIzT1FtK9q2Bs7SUp93VPqZ6327mSVDelwoyNt6GUOB7mGdPMUDtdiMapwc8Eagd1Ngw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by IA1PR12MB7709.namprd12.prod.outlook.com (2603:10b6:208:423::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.27; Tue, 21 Nov 2023 01:52:24 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%4]) with mapi id 15.20.7002.027; Tue, 21 Nov 2023 01:52:23 +0000 From: "Chang, Abner via groups.io" To: Ashish Singhal , "devel@edk2.groups.io" , "quic_llindhol@quicinc.com" , "ardb+tianocore@kernel.org" , "git@danielschaefer.me" , Jeff Brasen Subject: Re: [edk2-devel] [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel command line Thread-Topic: [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel command line Thread-Index: AQHaF3GYZ+tR9dsPD0OOnIsCWS44GrCDKm3ggABR1wCAAI7ucA== Date: Tue, 21 Nov 2023 01:52:23 +0000 Message-ID: References: <3ab879ada6d9f2b01496ecc05102510564888044.1700008662.git.ashishsingha@nvidia.com> <888db180ae77070619a13ec4e6d6356a97a03176.1700008662.git.ashishsingha@nvidia.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=6341a878-0281-45d6-ad22-c6b8e4b9edfb;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-11-20T12:25:33Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|IA1PR12MB7709:EE_ x-ms-office365-filtering-correlation-id: 11a57120-3e57-41ff-b798-08dbea34817e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: qGQIZCtAX3zH8Ds1S6L+7cQaRHd+9TewsPyM/Fn0MdA3+274pulWgcAeYxqBKKmNpubozIGOK0GaLLlBFEFd+BdbhuzWZ7FCDle+qsWvwIfb+7fxu95tKcpM28jwD12Wzz5+epWygG2gPjB8cQ46Uv7NAxp1DMd99oq49w5tPEImJm/cHNNBoX61KjBOgxmfMZrwEm0c1c1v5gh6FsjmyptrskkYBIM2BI82NNliz+v+GPXHlYic2YSg2iFeXIbZdnBXiD16T8VHWcSTDBtl301/wgPwqPT5RNNYU+unzVVLeTfBcStykvzjeKhM4QzSsK7J+vzu42IFzJPTZqK12UpO+nMuAYgQvm7YFC8SJcIqbzLghEqMDC2XpLtdz7FiVg+qKezcutif5fTqNKjRVGmdeJGXhvdRXl+IZnw06ZxQtrl0YN97eZ2RQZsOMX+N3efVZUN1sGxRokFHZ0VtASvMIwWjAZkRC3bMuZqjWTxom9b0mF79YGauHpBY3oEc4Je3DwLpu/nnzZ4O57F8LF6YdqSX4SKVtWVEeO+TF0/AtPwwLHTTudVKX/oUmn3vILB587JZMovJISfIzZmL5RS7ZH3Euqqu+6WiisTFXJFOnXpGkhE49rD5P7SWUlfgOBP3pypB1afXcoZkngbSm2og1dC8j5ft+taTjulRyChbXlBdaKDw+GojgWK7l3NI x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?87wKve2zxpUro3Z6uYMuInt2aI7wX2ccO9/OTJ+8bfwFL8WMfC+6PfPYAL?= =?iso-8859-1?Q?7UgNya/VNjiJo/KW9MoGl8D6imq2N8JPYAjv0rXZZtGX6fGYQcGKZIfOl2?= =?iso-8859-1?Q?PHITdIydwc8u6Y+gzeSfltIC3gIwT7KbxNucLBn0R+/ibJ7G5FY1Fyur20?= =?iso-8859-1?Q?EPaZQqHUfHkU1TjK+HBx4PEZpu7/mvt/svc69r4fBWPMmQBZkjJNJsz5m1?= =?iso-8859-1?Q?XqGuWz4doytXOPAPAFzi7YlbnbgII5D2psd1ANKsQ64h+sIY4RHpk1Be5n?= =?iso-8859-1?Q?KBZMhF6h2L5OEl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th6h?= =?iso-8859-1?Q?JYaqIwkTjiQuZyno4U7AEHj1Wv6EJpRsyChO/BUI0UVcNPoL6pp8DmsPtT?= =?iso-8859-1?Q?GZY99LeKw86fOuw8sbb5j2HRU948YbOkh3TVovef3vkVoaH7zVFQtVluvO?= =?iso-8859-1?Q?e/D6bJL/dUrWoATVFJHuZk82TpgOXwAKsaY/9H29x73XHg5j5OEZtUwjuW?= =?iso-8859-1?Q?qhd6Mh5N9oVUtOaeNrN1KxR+vWSMiYM/I2SyzrKojHWW+/tc8PrY6bZwUf?= =?iso-8859-1?Q?Ft1J55AY6J2sVjt89+acGNLd2b8+HtOOJ3ODEHF3fkfOJDMUYVUUlTTDlh?= =?iso-8859-1?Q?wmgCEB0P5LcyAKZ3LnjSC1aHUTinU3sc+BlLpDgZPKnGQPA18kUW4981tS?= =?iso-8859-1?Q?90FlwS14xsch2nqQDgDq83meKRQ4ipnLyb3i611b3cm/Z6mbSioznTIToC?= =?iso-8859-1?Q?GvkJxTatJCCf4=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11a57120-3e57-41ff-b798-08dbea34817e X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2023 01:52:23.4514 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WoyYRvSFVqjUTgvm/AkeI8Na3YvyC63fKIEH9cFwZ6AHqRKOwFD5KpQe4pb5tC77JjSpN5Dc5XEd0CITPPfXHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7709 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Dw4Fp8R3dzKhlNHmcfkVFvWnx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KLCXLdnf; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") [AMD Official Use Only - General] Ok, I got it. Thanks. Reviewed-by: Abner Chang Abner From: Ashish Singhal Sent: Tuesday, November 21, 2023 1:18 AM To: Chang, Abner ; devel@edk2.groups.io; quic_llindhol= @quicinc.com; ardb+tianocore@kernel.org; git@danielschaefer.me; Jeff Brasen= Subject: Re: [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel comman= d line [AMD Official Use Only - General] Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. ________________________________________ From: Chang, Abner Sent: Monday, November 20, 2023 5:30 AM To: Ashish Singhal ; mailto:devel@edk2.grou= ps.io ; mailto:quic_llindhol@quicinc.com ; mailto:ardb+tianocore@kernel.org ; mailto:git@danielschaefer.me ; Jeff Brasen Subject: RE: [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel comman= d line External email: Use caution opening links or attachments [AMD Official Use Only - General] > -----Original Message----- > From: Ashish Singhal > Sent: Wednesday, November 15, 2023 11:12 AM > To: mailto:devel@edk2.groups.io; mailto:quic_llindhol@quicinc.com; > mailto:ardb+tianocore@kernel.org; Chang, Abner ; > mailto:git@danielschaefer.me; mailto:jbrasen@nvidia.com > Cc: Ashish Singhal > Subject: [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel command > line > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > AndroidBootImgLib allows for platforms to append to kernel command > line but does not allow for the overall kernel command line to go > beyond the limit set by the image header. Address this limitation > by adding a pcd where platform can tell how many extra characters > they expect on their platform in addition to what the image header > specifies. > > Signed-off-by: Ashish Singhal > --- > EmbeddedPkg/EmbeddedPkg.dec | 5 +++++ > EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 2 +- > EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf | 3 ++- > 3 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/EmbeddedPkg/EmbeddedPkg.dec > b/EmbeddedPkg/EmbeddedPkg.dec > index 341ef5e6a6..94dc3c9b76 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -183,3 +183,8 @@ > # Selection between DT and ACPI as a default > # > gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x0000059 > + > + # > + # Expected Overflow Android Kernel Command Line Characters > + # > + > gEmbeddedTokenSpaceGuid.PcdAndroidKernelCommandLineOverflow|0|UI > NT32|0x000005C > diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > index f63648e60d..d16929f2bb 100644 > --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > @@ -335,7 +335,7 @@ AndroidBootImgUpdateArgs ( > return Status; > } > > - NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE; > + NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE + PcdGet32 > (PcdAndroidKernelCommandLineOverflow); I don't know the history of ANDROID_BOOTIMG_KERNEL_ARGS_SIZE, however, I am= a little bit confused. Is this PCD introduced for the case the string size may greater than ANDROI= D_BOOTIMG_KERNEL_ARGS_SIZE? If yes, then why don't we just use StrSize (Ima= geKernelArgs) * sizeof(UINT16) as the buffer size? Regards, Abner Android style image header can never have more than ANDROID_BOOTIMG_KERNEL_= ARGS_SIZE bytes. However, a platform may need to add new kernel command lin= e arguments at boot time that may need more buffer space than ANDROID_BOOTI= MG_KERNEL_ARGS_SIZE bytes. To allow for that, we can have a PCD that by def= ault is set to 0 but a user can override that in their platform dsc if they= expect more than ANDROID_BOOTIMG_KERNEL_ARGS_SIZE characters. This is not = a bugfix but a limitation that is being addressed in this patch. Thanks Ashish > *KernelArgs =3D AllocateZeroPool (sizeof (CHAR16) * NewKernelArgS= ize); > if (*KernelArgs =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "Fail to allocate memory\n")); > diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf > b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf > index 8eefeef4f9..9754664df5 100644 > --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf > +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf > @@ -45,5 +45,6 @@ > gEfiAcpiTableGuid > gFdtTableGuid > > -[FeaturePcd] > +[Pcd] > gEmbeddedTokenSpaceGuid.PcdAndroidBootLoadFile2 > + gEmbeddedTokenSpaceGuid.PcdAndroidKernelCommandLineOverflow > -- > 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111494): https://edk2.groups.io/g/devel/message/111494 Mute This Topic: https://groups.io/mt/102598723/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-