[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] EFI: refine cfgfile buffer allocation
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
- Date: Mon, 28 Sep 2026 09:37:34 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hbkghGTwQ5VphXkcF8TahHFgXhR/bRVR4myxPUPxe0g=; b=Lb3uhpbq4xO141+M41/o8U0UrrHsI5dFsuPoMHqNicaEv20i9QEjrBHwCp0d38oceKf3faMY0mP2/Z5OE6Q9apBbQ6Dgm8sm2tDI0uHNXGtNADl93PQ0TaR99r0jSKMwRdH0SaEGia/a0NzxUHAs2YerCYD1mFG2tqDtdowZBn0Qhw8zSviY2TJYD+B3PltBkGdHFgI2ZO6L6vDKkrQq8wTEsoDAdgRPJdFH+T5yXbZ63ni/aPAGxbYnhF7hQ61bEFq5l0friMwy6zWkVy+TdHn0bog97Nq4zOmgSjVmfAfyKJLBZELVxp9p4w0mpQf674IvYFX14NTTg6v15Sjkug==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L0Q0ah+CsbkZ2owpq92EiISpmqt1tdmbdmQPvQTicX4tOABXnYAwn1BaszipsQfzWyDd7TYIWfezScCJRFBrW0HM0fyRrU4ksfmzou76213zHBNq4Gbo9XJ69qhzfGjo710mwjEuwwxioDiMkG4ZNoQ7/1cjKso4VYaHzlyTaZ7/shiZ8O6AjvS3c/eSB5MyebGVSIjuSweXKjBKnZYbbVURjLo2UFYhWOmPRIJPPbcA2uU1/Gc2eymSPPM2cx5fbPYYbMsAkd7AVMYh/NqapLSrOgYY7d1r9frECCa5myHeoAPA7kLnvbultE18WzZk5x5l4QJqtcGQ/wxI29S1HQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 28 Sep 2026 08:37:52 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 9/28/26 7:15 AM, Jan Beulich wrote:
On 25.09.2026 17:56, Ross Lagerwall wrote:
On 9/21/26 10:09 AM, Jan Beulich wrote:
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -878,8 +878,13 @@ static bool __init read_file(EFI_FILE_HA
what = L"Allocation";
file->addr = min(1UL << (32 + PAGE_SHIFT),
HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
- /* For config files allocate an extra byte to put a NUL there. */
- ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
+ /*
+ * For config files allocate an extra byte to put a NUL there. There's
+ * also no constraint on addresses for them.
+ */
+ ret = efi_bs->AllocatePages(file != &cfg ? AllocateMaxAddress
+ : AllocateAnyPages,
You could avoid the negation here, unless it was intentional?
Use of != was intentional, but that's not a "negation", so I'm not quite
sure I understand what you're referring to.
Sorry, I meant !=.
For the cfgfile, I don't think you need to allocate whole pages so it might be
better to use AllocatePool/FreePool for those allocations.
Ross
|