[edk2-devel] [PATCH v3 3/5] Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line"
Laszlo Ersek
lersek at redhat.com
Tue Jun 29 10:23:34 UTC 2021
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 <lersek at redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Cc: James Bottomley <jejb at linux.ibm.com>
> Cc: Tobin Feldman-Fitzthum <tobin at linux.ibm.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457
> Signed-off-by: Dov Murik <dovmurik at linux.ibm.com>
> Reviewed-by: Laszlo Ersek <lersek at redhat.com>
> ---
> 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 <lersek at redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77263): https://edk2.groups.io/g/devel/message/77263
Mute This Topic: https://groups.io/mt/83841917/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list