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 5DE82D80F71 for ; Mon, 20 Nov 2023 17:18:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=K1eRrpd+0HoebLyiOntqfdoKzRVoz54lsMk5Jk4qKnI=; 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; s=20140610; t=1700500713; v=1; b=NVHNUfWjJYsC5umXtPQReSRNFsihV8n5Ylz8ICDQ92bwEHzPpoTTeuuFa3Kph/DoFoVWZ2zl poJr6Ud6zbROTamB5wzPA1sGTTIMz08DnzAQza7pY1u7wO3afRzPlYex2x72EjlOrL8l+o6e7u9 e5478ryRQlUdarIhXcEckYTU= X-Received: by 127.0.0.2 with SMTP id 5lrIYY7687511xtF6TZhPTly; Mon, 20 Nov 2023 09:18:33 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.80]) by mx.groups.io with SMTP id smtpd.web11.1847.1700500712222871387 for ; Mon, 20 Nov 2023 09:18:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nF86D8QFjGFTEr0NF/ec5iVIR24182JE69AMG12lJn7IKmt9QSqYHln2cxpRIrFqffK3RrGSG6Iri+J7uvYYyV6gqiEy7OLN8+oJXiinvk9l0oOxmv9+2NTObqLV8kG92a4VIBHwd0z3BdjbocJVuPohtuCFyNC2p5L6wUePQER79lIwXM2M07Csi9iru+T11vs4bcFE6W5gef5SlUE1DNtrL7kRpwhXdt4FLd3KYNV31CVkuGzuLBUVW9yXSfFgoL9dYykLeBc62rvEi/+4ri7F/xW5X50t6YXIWqK7h4Xr554ay4C/1LafNtNzB/tck6CjzhNUAyodU3YkLTRFjg== 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=QMByAd1MePamw0h4DTr2UyH5q4cTjet1duddKnMY3WQ=; b=lWItzzIj1thAXAO619HHxBidUvYo6vlFHsrwsjiZBCuhK3JBmOjmi7AdHAzJtouCdZnXK02csVarP/EPhl7FKQyyPhR1Icb+JvH1hty3ERektwbc1c5LqRsB9F0edKcqNutfUNKjP3v4/huWuttiyBS1JZ45QpHo/KZZL/o1rL6YwfBRqYzNOz82cWp2NoDqbXOjvDjZwm6oE0w1b77xaC5HrKH++CBppv2e/LQDyTy9bDro7SKReM+mBPacD9QMmpg+Oda4s9fCBEjMtagETzRNlPd73oAk74NYk/oBk0upRmEI6fMbbPgA/rNYFiXUezLI2e9zHqtmY3NHK7JibQ== 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 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by CYYPR12MB8749.namprd12.prod.outlook.com (2603:10b6:930:c6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.27; Mon, 20 Nov 2023 17:18:28 +0000 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89%4]) with mapi id 15.20.7002.026; Mon, 20 Nov 2023 17:18:28 +0000 From: "Ashish Singhal via groups.io" To: "Chang, Abner" , "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: AQHaF3GWdCdoDwZ4FEKlVOjwRJkjwbCDK7OAgABPKsU= Date: Mon, 20 Nov 2023 17:18:28 +0000 Message-ID: References: <3ab879ada6d9f2b01496ecc05102510564888044.1700008662.git.ashishsingha@nvidia.com> <888db180ae77070619a13ec4e6d6356a97a03176.1700008662.git.ashishsingha@nvidia.com> In-Reply-To: Accept-Language: en-US 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: BY5PR12MB5544:EE_|CYYPR12MB8749:EE_ x-ms-office365-filtering-correlation-id: 073de54f-a8ca-4d2e-3a5e-08dbe9ecb6a2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: y2ldu29T+wrWzrlKz7QuAt1WPiNqu5oPoRRLedp/5nIlFrxHR/K/C7fBZplZ46fBJHz+C7f89mU1vRTfIdkdlUat4lkSyxwG9B85ecdAK9QMJGTbZIJ0KQJ69rhZDquQwRDIEssJUnLGQfcRupTkUnmnCSpXcjFol16n8l8SQVDjqG3sz5fC4azZySlKf4aY4LE2x6BXMO9kt4MtPRiD9ylQeuma21mbGnYwaeNGhc9E0+AapPLiL6Fw25gp1rP+fm99Zid+ibJA5Uacr4d0//2uetCuuUkzahstuak6cniacMJh+mA/BH5WohSIxFxeo3Uj/HG2Ff8DkxfUmjmP/cGGgvX382jlR5fCc9tTqepvLrEd7SjCPHWEmATgA2rYFjCH5sdtR1J+IDDsCIjcORav7EvAeEkwAnSbf6CQaiTvsJQApTzpKiuRpyHaHYe51oXv/flK2tAS7pUFWvELO8Qn/iFwrpgevwPkWSQ4XF8C0hjdOw7RP++DKxuPJjxj7cEipMCAOxmAAYXWUzfHFl7yV89kvWWC0aeJnKdaAYlk4JO7SOCM26es/xdh+EvahHvW4LDiarrxpDOa+XqzQoaKe4Z+4h7OCSjWsnBc07m8H2hN0FFm/TO2bHJjNIQMiq3iIFNKp2Y2C80n9nYYt2sL915pFhTH906QGfGTM0mLBnXFDSJdO9yMItkf2sxo x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?WUxKBmQeRkFcNJRqXzHuY2JGWSVbAffyzQp6+mZHCWriXb9QrnqEmZDvhy?= =?iso-8859-1?Q?YeBfmiVrdrcRqqgAWfNJyBAiZ/Ndb+AJ9ljpMh8SHDXo3OHIIjce3J3Vj9?= =?iso-8859-1?Q?vAX5xSK/nhk1PCRTaWUGYLphWDXZee7A7nPiSkiyBKq0awTl30mKgi2b1y?= =?iso-8859-1?Q?lOZTcm83HHvd6rTpkHSopYJ3rFvQ6tnfE/uJQ5VAQJiSsEv7oj2tSqED5h?= =?iso-8859-1?Q?eqgL71IyppgMY31BoIna9w84uOF/0GuhmcAXSBywxGkbT59i2snoHwNfyI?= =?iso-8859-1?Q?YuYPw5xz4bAO1btBBX3W2mBXDjkXd0c/ZoW/BCMvrtfaWzf+2ZMmbUknKr?= =?iso-8859-1?Q?Yac896nEjGM2E8PoIMYPL54Fgzv3kow3nvDniP0vIc6PybuI0gsdLvM5M0?= =?iso-8859-1?Q?sU+r2aatWGrVXLF5UMS7jkJpCB5Z9JHItNHpze/yrJB/hR6yEAF7YNA9Ea?= =?iso-8859-1?Q?EDwk1GMSR4YUrAuFwRYCfn/2GdIktqM41ipJd2TNlNy+ze04TlEh+s+q5I?= =?iso-8859-1?Q?BRyc0ndKZC/yZ9W2OzEDa9DKbk/+AvmOo5CXyw/5+Nvp2uD8cAyJlwt0TY?= =?iso-8859-1?Q?LFbRpbF8u6/OgHqvhEPmstbwzA/sptxPYT0CvlCgspGfuXbJKXoFOmMs6l?= =?iso-8859-1?Q?weDkM/XRNx7Vv6dgyVJNzRQIrrEthrtC85TES0HVAmeTIupEM4liA+gyuM?= =?iso-8859-1?Q?QSSyvaXARmHUUEAnHna0ENs4IvzKIOkPI4QdzcxEFItXKvjOc4MKGfzI2R?= =?iso-8859-1?Q?xYDdhgl02+HzKA7Gx9k1nMtBO8pKTYXx3hz+XkBHzCrl/+tsr/uQhPLLkI?= =?iso-8859-1?Q?rj6Q2Wac1pnG8XH4oHA4FlZQfUmLgDunmkfN3ix3cfkwmKciHSS2InRwsO?= =?iso-8859-1?Q?IElMXjhHxxUmlAviFhrxTmg4sD1kYwTDzo+fED1RkJ5Z41KvRNQ37Yw3sj?= =?iso-8859-1?Q?VSSovTmpYvfYowO64gvue2XbzbJUIrsEtR/DMZee92QxQmQ3n9659RlSfr?= =?iso-8859-1?Q?b3efFV1trvfGsxgl+1hL2GzB8mrnf1VGs+qmwV4M4oIYail6SXEf4FQhK5?= =?iso-8859-1?Q?Pwuo7JA0QBNjZAFWhNeAVU1owlqacOpHMkBf+l2ikjmPSKaWcEI6H2owOZ?= =?iso-8859-1?Q?yEF+C4aellCAFjuD6aK6rI2AZfkatekfb+rdeAL6aNwBNGPSGmbaSdbjPY?= =?iso-8859-1?Q?0DKPXprw6J/Y59+HQtzasYULLVVo2CVggdiliw55C0GnPgsu6aR6ekyZyZ?= =?iso-8859-1?Q?r7L58xmetuO2BmeS+pjaS9mP8v4oolI03nO2h6xKUJaELTYQwIwXv+kID3?= =?iso-8859-1?Q?LhR38OSA42zsdFDr/KS0nSjncVObnfmLiJPGRAIDEocPOLxN3rE9WS6M8L?= =?iso-8859-1?Q?APBxuV9O7PUQlDdsQBotC+N4QZYaFlujE1jJrTzVPxsXL0ZyMy3UYEPqYk?= =?iso-8859-1?Q?8nUWWpWIqRPLGdjWjzr1Ztyc1pcefUwfef51aLIwaCktFusHYIBrIjmrlA?= =?iso-8859-1?Q?keZtPo7LpQ0rFJYfMH/9DDtdnyd2fd1lUoNIHWDJ1KjX0y2u+pERsK2rzk?= =?iso-8859-1?Q?00lsKlOCxqnnBxKOxwsxDw7kX1Krw8/hPk5ztUSbm5e9iHJ7CTEDkQppzQ?= =?iso-8859-1?Q?Oxsexo12DWRr6Bslp7J5N90RousKeHd8nd?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB5544.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 073de54f-a8ca-4d2e-3a5e-08dbe9ecb6a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2023 17:18:28.8105 (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: 76MVznY73bsZM+5EFQHbKtX0KsSO7dATK+a4f5bpoCvJVUk+Tj+tnfL0RGQvg2cQB1Wr/6/p7JOL+lkPXMf0aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8749 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,ashishsingha@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LBV6mr3j7DIYb3EA5E2DOcGcx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB554401E3441EC4BAEE0E988EBAB4ABY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=NVHNUfWj; 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}") --_000_BY5PR12MB554401E3441EC4BAEE0E988EBAB4ABY5PR12MB5544namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________ From: Chang, Abner Sent: Monday, November 20, 2023 5:30 AM To: Ashish Singhal ; 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 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: devel@edk2.groups.io; quic_llindhol@quicinc.com; > ardb+tianocore@kernel.org; Chang, Abner ; > git@danielschaefer.me; 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 (#111484): https://edk2.groups.io/g/devel/message/111484 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- --_000_BY5PR12MB554401E3441EC4BAEE0E988EBAB4ABY5PR12MB5544namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable



From: Chang,= Abner <Abner.Chang@amd.com>
Sent: Monday, November 20, 2023 5:30 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.= groups.io <devel@edk2.groups.io>; quic_llindhol@quicinc.com <quic_= llindhol@quicinc.com>; ardb+tianocore@kernel.org <ardb+tianocore@kern= el.org>; git@danielschaefer.me <git@danielschaefer.me>; Jeff Brasen <jbrasen@nvidia.com>
Subject: RE: [PATCH v2 2/2] EmbeddedPkg: Allow longer android k= ernel command line
 
External email: Use caution opening l= inks or attachments


[AMD Official Use Only - General]

> -----Original Message-----
> From: Ashish Singhal <ashishsingha@nvidia.com>
> Sent: Wednesday, November 15, 2023 11:12 AM
> To: devel@edk2.groups.io; quic_llindhol@quicinc.com;
> ardb+tianocore@kernel.org; Chang, Abner <Abner.Chang@amd.com>; > git@danielschaefer.me; jbrasen@nvidia.com
> Cc: Ashish Singhal <ashishsingha@nvidia.com>
> Subject: [PATCH v2 2/2] EmbeddedPkg: Allow longer android kernel comma= nd
> line
>
> Caution: This message originated from an External Source. Use proper c= aution
> 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 <ashishsingha@nvidia.com>
> ---
>  EmbeddedPkg/EmbeddedPkg.dec      &= nbsp;           &nbs= p;            &= nbsp; | 5 +++++
>  EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c &= nbsp; | 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|BOOLEA= N|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 + PcdGet= 32
> (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 styl= e image header can never have more than ANDROID_BOOTIMG_KERNEL_ARGS_SIZE bytes. However, a platform may need to add new kernel command line arguments at b= oot time that may need more buffer space than ANDROID_BOOTIMG_KERNEL_ARGS_SIZE bytes. To allow for that, we can h= ave a PCD that by default 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 patc= h.

Thanks
Ashish

>    *KernelArgs      =3D Alloca= teZeroPool (sizeof (CHAR16) * NewKernelArgSize);
>    if (*KernelArgs =3D=3D NULL) {
>      DEBUG ((DEBUG_ERROR, "Fail to alloc= ate memory\n"));
> diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.i= nf
> 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

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#111484) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB554401E3441EC4BAEE0E988EBAB4ABY5PR12MB5544namp_--