From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web10.11204.1583134190931675799 for ; Sun, 01 Mar 2020 23:29:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=WBHUrAC8; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f65.google.com with SMTP id z15so11190427wrl.1 for ; Sun, 01 Mar 2020 23:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SjN/Oopip1+dNGOv66DmBlgsOVLOQ/ywLFssknMTxMY=; b=WBHUrAC86+GrKK7OVA1uYR69ewl0URG6EnCS2T5sY7NmoyJcUjMrEOYCKHM2XFV8tB jgJojsq3sUc/RRD/iReZ30hMdqgffC/1nVUWyuHd9egIKPwz4fhHciP0Ty2JZqt+gygg ZQzslrzp2J+Z7nuGLjIGlQWqzbz9hEq4P8Wb7mK11qCbTM6282v1apcHaWvU0V4HwhC6 r6pA9P70GVwByVYCyhpQB6IVhfd/ji+r20862SpV81IBrVt+cyG/8MBGB9HJ0ljk3fYr swPKToJU04TuIEh6ABICgjaPqpijUhWsOHbtBG8VWWaxx0sChoKuHpwkri22f19qEXm5 jhvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SjN/Oopip1+dNGOv66DmBlgsOVLOQ/ywLFssknMTxMY=; b=bX/6rFmDeo2u6Khhcv0n/2ULDH4ys18zpW5hhHQKLautuyph2epnrWT2wp3k/ranOh 5mrI9ObOoK9tcb688COKfClBO9dnRqfKuvKh6Qlv/j+kZTqVgwNEZhlDtv7cc3sg5RM/ ztDyVZ7p5bx/80y3bUdufo97TWDL/0Q2bYTRMLiryNZr2NCsnA48r61pK9zvt0lkkLI3 C2WTzrTqP/8ZQjgoK8qOoOL4kddMz/DUUB6ofuPZsncoPn4BnIYEaLYT6LMjMpDAZ97n Xdz+4R+ZPGROaucl+4JBKjXht4hbBPqikJoEARgC7qih4LQin8flr8nqrCaycG3rhlC+ rs6A== X-Gm-Message-State: APjAAAUt1x2zGvBbFCW2HbB0W6DpAG3fD7nvLUO6sVjphpdMq7HA4dtn 0RO9HdRjzAGS1SI357ST8WHg/2UX8nI4aw== X-Google-Smtp-Source: APXvYqz9ZOedV2ZvJZllqgQQiDtvK1k2pnMcwI8vXMGtpXbVRbuOCDNdFSObllYTchFqEqWCnYuYtA== X-Received: by 2002:a05:6000:ca:: with SMTP id q10mr20382123wrx.78.1583134189100; Sun, 01 Mar 2020 23:29:49 -0800 (PST) Return-Path: Received: from e123331-lin.home ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id z131sm6347153wmg.25.2020.03.01.23.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 23:29:48 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [PATCH 07/13] OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line Date: Mon, 2 Mar 2020 08:29:30 +0100 Message-Id: <20200302072936.29221-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200302072936.29221-1-ard.biesheuvel@linaro.org> References: <20200302072936.29221-1-ard.biesheuvel@linaro.org> 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 --- OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c index efecbd817da1..b8d64e2781fc 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 (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,7 @@ QemuKernelLoaderFsDxeEntrypoint ( while (BlobType > 0) { CurrentBlob = &mKernelBlob[--BlobType]; if (CurrentBlob->Data != NULL) { - FreePool (CurrentBlob->Data); + FreePages (CurrentBlob->Data, EFI_SIZE_TO_PAGES (CurrentBlob->Size)); CurrentBlob->Size = 0; CurrentBlob->Data = NULL; } -- 2.17.1