From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.5875.1624959182715482978 for ; Tue, 29 Jun 2021 02:33:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T9b1jhLL; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624959181; 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=f9yl/aShAWW7D2tWUpzR8NEWcdCwcaZQKGYgL8hKwJQ=; b=T9b1jhLLyxAAXmG2qoBfqiR6xhBl6EgPO1TlizKNnEz1N9IWhd92qutV+SybrY6cFwXfhC cOvF5MjVv8kM4vL9bJEAzegnhdzNObqRzgcX6vWahWSzYDG+yc/7DsxPd9BHwCTEGmKylC hmSI+jp7BI2TVwmSIcs30IlmGUCNrGQ= 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-575-JZlVdCKfOcCOGgTTatB1rg-1; Tue, 29 Jun 2021 05:32:56 -0400 X-MC-Unique: JZlVdCKfOcCOGgTTatB1rg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CBBA1923763; Tue, 29 Jun 2021 09:32:55 +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 0DF3060854; Tue, 29 Jun 2021 09:32:53 +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: Date: Tue, 29 Jun 2021 11:32:52 +0200 MIME-Version: 1.0 In-Reply-To: <20210628105110.379951-4-dovmurik@linux.ibm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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; > } > Thanks for the updates.