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 5184F7803CE for ; Mon, 30 Oct 2023 20:25:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nhiJQuNr6Ds22R4Yqr654py//MXX3HU2q6pIwXoXAfk=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:In-Reply-To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1698697505; v=1; b=iyAeoY9t2BbzzDRZuazdBp80RwRJwTZ0QN+Abv+jwbVit7wIGbR3dHsQFKXzteAmb8afuK55 Jh91MRBpdHQcw1laUKlXrGZlHaPS5oRC9BmKfmXSRVruByAXXO6sofmqU8kUbuVTOoTDiX9RcYz lIhStppGqs/5Q2y9QQq8pEXo= X-Received: by 127.0.0.2 with SMTP id qrzVYY7687511xmGh7hUSm9y; Mon, 30 Oct 2023 13:25:05 -0700 X-Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.46]) by mx.groups.io with SMTP id smtpd.web10.169089.1698697504517307090 for ; Mon, 30 Oct 2023 13:25:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QiwgTOnGqvB2MMm8/G0VsUmfTSdokDxYnWaQ0vqIvbkLDwJ6GZqdGQ1ApMlv3redHSfbLw9xziCKpoegKNUcg8FDD7mTPpGHpji8EZVZ47bs37pCLE5+QLkL7APyqjJ/yedPf1aoRP6QYvCCS1dMvOdt9X7QGnMISmBD5QaB6PvucPcYcCZZzfEoqUU6B/EswxXTTFYubBgZW7G5uObHgXIrZtR+H96/euylKOgzpCSgec6SQgUhNS/a3pakwgky/XocxXKbIwRQwWd6cfQaRkVS711+sqyntDrlygrGomby03s+E0mk5Swn5WVokZqXF7PgxV6WOk76KBZUIM7B0A== 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=xm9Gvr2fkGv6u4xsRq0svYRNKB/RBebS1jppm8piPQc=; b=YhfbMU8v0y56y/kRicPl80FuwF0UJKW6RGYpqXwafhGRXOEaC5HTwTVMwq9h+czn26r6AVJPr7zEfQB3BDo8B13AienbM0wzSdpyRz2tcay0xdxqa6w6tj+W7qoiXi41CQH6FcdCINEZBxY5V3ocLdL0jYSLr9KIYBQAJGTv4J217zMm1gUpaMPDNx6NdM95/F03JsbTDTZ/zoRtD8mSJY2JeAheXjyTmpSZZWiYcG0JsvR+sAK6A+rxUigJHRFklmiTxX8e0W2QWOmIMbSb9sX2mdv7p8W6RKBNBuTVT7rlb6PFKamNsRnDVgsoDZvjrEIMV9CFIs+KVjVNPoAUFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) X-Received: from SA0PR11CA0156.namprd11.prod.outlook.com (2603:10b6:806:1bb::11) by DS0PR12MB9057.namprd12.prod.outlook.com (2603:10b6:8:c7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 30 Oct 2023 20:25:02 +0000 X-Received: from SA2PEPF0000150A.namprd04.prod.outlook.com (2603:10b6:806:1bb:cafe::10) by SA0PR11CA0156.outlook.office365.com (2603:10b6:806:1bb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28 via Frontend Transport; Mon, 30 Oct 2023 20:25:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.233) by SA2PEPF0000150A.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.22 via Frontend Transport; Mon, 30 Oct 2023 20:25:01 +0000 X-Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 30 Oct 2023 13:24:48 -0700 X-Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 30 Oct 2023 13:24:48 -0700 X-Received: from ashishsingha-lnx.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 30 Oct 2023 13:24:48 -0700 From: "Ashish Singhal via groups.io" To: , , , , , CC: Ashish Singhal Subject: [edk2-devel] [PATCH 2/2] EmbeddedPkg: Allow longer android kernel command line Date: Mon, 30 Oct 2023 14:24:44 -0600 Message-ID: MIME-Version: 1.0 In-Reply-To: <999da9572bc2ff0bbb8d7a69740256afd6ad5cde.1698697168.git.ashishsingha@nvidia.com> References: <999da9572bc2ff0bbb8d7a69740256afd6ad5cde.1698697168.git.ashishsingha@nvidia.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF0000150A:EE_|DS0PR12MB9057:EE_ X-MS-Office365-Filtering-Correlation-Id: 04779224-eec3-4075-63ec-08dbd9864b94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: wwJ2AzKH5jTU0iee4ZmUFASZFwzTIRnCecQzrrpePWr3ITh/uKTHUEO06GarlEFt9f+1c5IFlntIQWiO5wzLXQtKHnSvs/e3s6NadP3u7VhNEJieFw/0yBF6L+VZmzNpV5Uni+Q69wTLfN05P2LwDb+5d6s8U/0iHzmthost2OU7QeICYkrwkOwlY/5Uj18r/brweGxDNZ9M95qbGL7O4qojfX4yR+lgcbAHHinm8tCv6VA66fi1sjKCK1SjQVXS5VVrt2dG8CHzAWCzW/TIvQFVfT+7OO8Bz07LVJoRk2Eov4FKbflJ8Fob1YfpHZDefWRfMh5xnrc5B8V3wJOlCH02IoxiyRrJT9T1S7pogYMvwGQR12SrXzd8nFlMc64cZr/JRYTHqmsMd2AqqTW050dqfS1bbbR+9J89SSNVvPLOM973k4aJtaRN5QCdg2D0ugdq0nLuOp8jqz1tJjXuwCq/c8OoZWiDw0O9GpCkGd5eJSVWez9E4OKYrN+eav4GnmQ/CGbU5IMHxR1H0tA447IrVTHCUO11VcWu3Z2kibk5/s3TsjVAg/bRrrYSC8RxJkmQM150MdWsFruHwmhTjdi9J/rtGNwUIfVUgw/7EY1dfzFDKpSwYqkNi6UX2RulalSsAhFxS4SP1O1yR9Wp8JaLFfQwS73Qvd6mM21FnPyUtQzIzFt3qpZ9sBrqwnUDNb+GtC3D8AWJsMZTIeoGgDsQ+lVCmEr1Qatf+8YZ5qWCxLuX0PqQ6tt3JsRWVN09P4bIjjnOUzVzU3WLqQTce7v46i3hGvMGQK1uA9jQ8mM= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2023 20:25:01.8512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04779224-eec3-4075-63ec-08dbd9864b94 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF0000150A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9057 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: 3gYOwWD3fBBxF5AfBAXDCvCux7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=iyAeoY9t; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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|UINT32|0x0= 00005C diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c b/Em= beddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c index 02769cd0df..abd3f87d14 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c @@ -643,7 +643,7 @@ AndroidBootImgBoot ( goto Exit; } =20 - NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE; + NewKernelArgSize =3D ANDROID_BOOTIMG_KERNEL_ARGS_SIZE + PcdGet32 (PcdAnd= roidKernelCommandLineOverflow); NewKernelArg =3D AllocateZeroPool (sizeof (CHAR16) * NewKernelArgSiz= e); if (NewKernelArg =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 =20 -[FeaturePcd] +[Pcd] gEmbeddedTokenSpaceGuid.PcdAndroidBootLoadFile2 + gEmbeddedTokenSpaceGuid.PcdAndroidKernelCommandLineOverflow --=20 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 (#110338): https://edk2.groups.io/g/devel/message/110338 Mute This Topic: https://groups.io/mt/102284240/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-