From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.6067.1624962222789967881 for ; Tue, 29 Jun 2021 03:23:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EaHxfUWH; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624962222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XTRnIx9b4sUTTAwGke4Mbu0Nm/pGNyhR40TJ1ae8OZ8=; b=EaHxfUWHM+AfsaNk2OSNHO3klrYCLeNLzrkhwDq7Z3im2RPZq3pfQpk67LVSMSbR5FZEWl /YxH1Ym8VOQgN0xN2UqSgFG2SVIse41ZC4yYumGBjupwnsJbDdK49uqi/Gwros0yYsSAGH CvuWlD429+Iye38ZCDMvdieFfKcVgMc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-f_g1ZAQCPVK2DVy2CLz0bA-1; Tue, 29 Jun 2021 06:23:38 -0400 X-MC-Unique: f_g1ZAQCPVK2DVy2CLz0bA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FCFE80430A; Tue, 29 Jun 2021 10:23:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-158.ams2.redhat.com [10.36.114.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B606410074FC; Tue, 29 Jun 2021 10:23:35 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 3/5] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line" To: devel@edk2.groups.io, dovmurik@linux.ibm.com Cc: Ard Biesheuvel , Jordan Justen , James Bottomley , Tobin Feldman-Fitzthum References: <20210628105110.379951-1-dovmurik@linux.ibm.com> <20210628105110.379951-4-dovmurik@linux.ibm.com> From: "Laszlo Ersek" Message-ID: <6d2e00d0-2518-2bdf-8021-c308c423c4bf@redhat.com> Date: Tue, 29 Jun 2021 12:23:34 +0200 MIME-Version: 1.0 In-Reply-To: <20210628105110.379951-4-dovmurik@linux.ibm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 06/28/21 12:51, Dov Murik wrote: > 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. > > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: James Bottomley > Cc: Tobin Feldman-Fitzthum > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 > Signed-off-by: Dov Murik > Reviewed-by: Laszlo Ersek > --- > OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c > index b09ff6a3590d..c7ddd86f5c75 100644 > --- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c > +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c > @@ -33,6 +33,7 @@ > typedef enum { > KernelBlobTypeKernel, > KernelBlobTypeInitrd, > + KernelBlobTypeCommandLine, > KernelBlobTypeMax > } KERNEL_BLOB_TYPE; > > @@ -59,6 +60,11 @@ STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] = { > { > { QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, }, > } > + }, { > + L"cmdline", > + { > + { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, }, > + } > } > }; > > @@ -948,7 +954,7 @@ FetchBlob ( > // > // Read blob. > // > - Blob->Data = AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size)); > + Blob->Data = AllocatePool (Blob->Size); > if (Blob->Data == NULL) { > DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n", > __FUNCTION__, (INT64)Blob->Size, Blob->Name)); > @@ -1083,8 +1089,7 @@ FreeBlobs: > while (BlobType > 0) { > CurrentBlob = &mKernelBlob[--BlobType]; > if (CurrentBlob->Data != NULL) { > - FreePages (CurrentBlob->Data, > - EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size)); > + FreePool (CurrentBlob->Data); > CurrentBlob->Size = 0; > CurrentBlob->Data = NULL; > } > using an aarch64 guest, Tested-by: Laszlo Ersek