From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web11.5098.1623921178241544412 for ; Thu, 17 Jun 2021 02:12:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=g2cH0jZ2; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: dovmurik@linux.ibm.com) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15H92qPA095760 for ; Thu, 17 Jun 2021 05:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=yJVFYWphQ6gVPQLKpckqI87mwO8qliHhSsH8UUsYl6c=; b=g2cH0jZ2Ix6Y85BERKS3dDjMd9WY05dPKZgbaobA6cnWidLPXKkmjdTiKpjgShna5T+O lAo/4NcaWHxrS7tB3AxkX3a6kHVvsiNCpogAL311mLq5VVrTMWDDtfj1UK918aDmKpiE 1qM/wbkrZyKZ4ZmemjyiUgU8T5XGDZm7SAOGycjMF3jP5It21Lu/4tW6kVP2HZ7lX9Qa 3amqWjEOOhTU+BaoMuRJJ/a9xlVWyWythaqGPGeMkXBI2bkP2gVMmqPae+AHKfmZ7PUw kMBE8676plG+vqoF/iUFmbarXsBtlU7r0xY57Bux3sBGkFucye385rKegQFcnjhN9TGl hQ== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 39828mtqmd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 Jun 2021 05:12:57 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15H98CUe011017 for ; Thu, 17 Jun 2021 09:12:57 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02wdc.us.ibm.com with ESMTP id 394mja7fwh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 Jun 2021 09:12:56 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15H9Ct5D25624980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Jun 2021 09:12:55 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CB3FBE051; Thu, 17 Jun 2021 09:12:55 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59BF0BE05B; Thu, 17 Jun 2021 09:12:55 +0000 (GMT) Received: from localhost.localdomain (unknown [9.2.130.16]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 17 Jun 2021 09:12:55 +0000 (GMT) From: "Dov Murik" To: devel@edk2.groups.io Cc: Dov Murik Subject: [PATCH v2 1/3] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" Date: Thu, 17 Jun 2021 09:12:42 +0000 Message-Id: <20210617091244.2667569-2-dovmurik@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617091244.2667569-1-dovmurik@linux.ibm.com> References: <20210617091244.2667569-1-dovmurik@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: mfsjXmSU22Wjl1iHUq-rjEBiLYEYUl8q X-Proofpoint-GUID: mfsjXmSU22Wjl1iHUq-rjEBiLYEYUl8q X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-17_05:2021-06-15,2021-06-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 suspectscore=0 bulkscore=0 impostorscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106170063 Content-Transfer-Encoding: quoted-printable This reverts commit efc52d67e1573ce174d301b52fa1577d552c8441. Manually fixed conflicts in: OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c Note that besides re-exposing the kernel command line as a file in the synthetic filesystem, we also revert back to AllocatePool instead of AllocatePages. Signed-off-by: Dov Murik --- OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPk= g/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c index b09ff6a3590d..c7ddd86f5c75 100644 --- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c @@ -33,6 +33,7 @@ typedef enum {=0D KernelBlobTypeKernel,=0D KernelBlobTypeInitrd,=0D + KernelBlobTypeCommandLine,=0D KernelBlobTypeMax=0D } KERNEL_BLOB_TYPE;=0D =0D @@ -59,6 +60,11 @@ STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] =3D { {=0D { QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, },=0D }=0D + }, {=0D + L"cmdline",=0D + {=0D + { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, },=0D + }=0D }=0D };=0D =0D @@ -948,7 +954,7 @@ FetchBlob ( //=0D // Read blob.=0D //=0D - Blob->Data =3D AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size));=0D + Blob->Data =3D AllocatePool (Blob->Size);=0D if (Blob->Data =3D=3D NULL) {=0D DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n",= =0D __FUNCTION__, (INT64)Blob->Size, Blob->Name));=0D @@ -1083,8 +1089,7 @@ FreeBlobs: while (BlobType > 0) {=0D CurrentBlob =3D &mKernelBlob[--BlobType];=0D if (CurrentBlob->Data !=3D NULL) {=0D - FreePages (CurrentBlob->Data,=0D - EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size));=0D + FreePool (CurrentBlob->Data);=0D CurrentBlob->Size =3D 0;=0D CurrentBlob->Data =3D NULL;=0D }=0D --=20 2.25.1