summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/QemuKernelLoaderFsDxe
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2020-02-28 22:38:50 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-05 19:45:05 +0000
commitefc52d67e1573ce174d301b52fa1577d552c8441 (patch)
tree9de84f558680f1d86443a991e66ffb480dab0b3c /OvmfPkg/QemuKernelLoaderFsDxe
parent364e0b4cda00f56d3086ded8e67bab458605805e (diff)
downloadedk2-efc52d67e1573ce174d301b52fa1577d552c8441.tar.gz
edk2-efc52d67e1573ce174d301b52fa1577d552c8441.tar.bz2
edk2-efc52d67e1573ce174d301b52fa1577d552c8441.zip
OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line
We have no need for exposing the kernel command line as a file, so remove support for that. Since the remaining blobs (kernel and initrd) are typically much larger than a page, switch to the page based allocator for blobs at the same time. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2566 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/QemuKernelLoaderFsDxe')
-rw-r--r--OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
index e4539ec2fb..dc86a48af3 100644
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
@@ -30,7 +30,6 @@
typedef enum {
KernelBlobTypeKernel,
KernelBlobTypeInitrd,
- KernelBlobTypeCommandLine,
KernelBlobTypeMax
} KERNEL_BLOB_TYPE;
@@ -45,7 +44,6 @@ typedef struct {
STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] = {
{ QemuFwCfgItemKernelSize, QemuFwCfgItemKernelData, L"kernel" },
{ QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, L"initrd" },
- { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, L"cmdline" }
};
STATIC UINT64 mTotalBlobBytes;
@@ -865,7 +863,7 @@ FetchBlob (
//
// Read blob.
//
- Blob->Data = AllocatePool (Blob->Size);
+ Blob->Data = AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size));
if (Blob->Data == NULL) {
DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n",
__FUNCTION__, (INT64)Blob->Size, Blob->Name));
@@ -969,7 +967,8 @@ FreeBlobs:
while (BlobType > 0) {
CurrentBlob = &mKernelBlob[--BlobType];
if (CurrentBlob->Data != NULL) {
- FreePool (CurrentBlob->Data);
+ FreePages (CurrentBlob->Data,
+ EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size));
CurrentBlob->Size = 0;
CurrentBlob->Data = NULL;
}