{"id":2229004,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229004/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260427150530.3156000-1-harsimransingh.tungal@arm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260427150530.3156000-1-harsimransingh.tungal@arm.com>","date":"2026-04-27T15:05:30","name":"efi_loader: fix AllocatePages overlap status","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"4b96f2e999047ec4766e208571cb709367f407e4","submitter":{"id":88701,"url":"http://patchwork.ozlabs.org/api/1.1/people/88701/?format=json","name":"Harsimran Singh Tungal","email":"harsimransingh.tungal@arm.com"},"delegate":{"id":68728,"url":"http://patchwork.ozlabs.org/api/1.1/users/68728/?format=json","username":"xypron","first_name":"Heinrich","last_name":"Schuchardt","email":"xypron.glpk@gmx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260427150530.3156000-1-harsimransingh.tungal@arm.com/mbox/","series":[{"id":501683,"url":"http://patchwork.ozlabs.org/api/1.1/series/501683/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501683","date":"2026-04-27T15:05:30","name":"efi_loader: fix AllocatePages overlap status","version":1,"mbox":"http://patchwork.ozlabs.org/series/501683/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229004/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229004/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256\n header.s=foss header.b=fmLosnJE;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.b=\"fmLosnJE\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=harsimransingh.tungal@arm.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g47b56pgNz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 02:01:05 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 89A4083BC4;\n\tMon, 27 Apr 2026 18:01:01 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 8F43683C14; Mon, 27 Apr 2026 17:05:54 +0200 (CEST)","from foss.arm.com (foss.arm.com [217.140.110.172])\n by phobos.denx.de (Postfix) with ESMTP id EE2B283693\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 17:05:51 +0200 (CEST)","from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B39DD1FC7;\n Mon, 27 Apr 2026 08:05:45 -0700 (PDT)","from e132995.arm.com (unknown [10.57.64.144])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2EDC3F7B4;\n Mon, 27 Apr 2026 08:05:49 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;\n t=1777302351; bh=DAcO3uAehutEJzwAc13cS+6/KYa2iX49VyeA+E7STs4=;\n h=From:To:Cc:Subject:Date:From;\n b=fmLosnJEk+FEbPSa6dtn2S+e78JNL1AKTjCrBujd8SqfSUiUvQ7s9vEGoEd7iOrYl\n HSbYUVshfjxnYdIUFeszB1JXAlaiIAVrqdyFGwwZ6vPPoCk0t1YF3nbxWkjf6novfv\n DVWWTwNvaMsGyLILMwHFM3wh2SK0aE7RLwzt0B9I=","From":"Harsimran Singh Tungal <harsimransingh.tungal@arm.com>","To":"u-boot@lists.denx.de","Cc":"trini@konsulko.com, ilias.apalodimas@linaro.org, xypron.glpk@gmx.de,\n Harsimran Singh Tungal <harsimransingh.tungal@arm.com>","Subject":"[PATCH] efi_loader: fix AllocatePages overlap status","Date":"Mon, 27 Apr 2026 16:05:30 +0100","Message-Id":"<20260427150530.3156000-1-harsimransingh.tungal@arm.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Mon, 27 Apr 2026 18:01:00 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Return EFI_NOT_FOUND for EFI_ALLOCATE_ADDRESS overlap\n\nWhen efi_allocate_pages() is called with EFI_ALLOCATE_ADDRESS, UEFI\nexpects EFI_NOT_FOUND if the requested address range is already\nallocated or unavailable. U-Boot currently returns\nEFI_OUT_OF_RESOURCES when efi_update_memory_map() detects an overlap\nafter a successful lmb_alloc_mem(), which does not match\nEFI_ALLOCATE_ADDRESS semantics.\n\nReturn EFI_NOT_FOUND for EFI_ALLOCATE_ADDRESS requests that fail due\nto an overlapping EFI memory descriptor, while keeping\nEFI_OUT_OF_RESOURCES for other allocation types.\n\nThe UEFI specification [1] specifies that\nEFI_BOOT_SERVICES.AllocatePages must return EFI_NOT_FOUND when the\nrequested address range is unavailable or already allocated;\nEFI_OUT_OF_RESOURCES applies to non‑address‑specific allocation\nfailures.\n\n[1] https://uefi.org/specs/UEFI/2.10_A/07_Services_Boot_Services.html\n\nSigned-off-by: Harsimran Singh Tungal <harsimransingh.tungal@arm.com>\n---\n lib/efi_loader/efi_memory.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\nindex b77c2f980cc..63cf1a7277f 100644\n--- a/lib/efi_loader/efi_memory.c\n+++ b/lib/efi_loader/efi_memory.c\n@@ -510,7 +510,9 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type,\n \t\t/* Map would overlap, bail out */\n \t\tlmb_free(addr, (u64)pages << EFI_PAGE_SHIFT, flags);\n \t\tunmap_sysmem((void *)(uintptr_t)efi_addr);\n-\t\treturn  EFI_OUT_OF_RESOURCES;\n+\t\tif (type == EFI_ALLOCATE_ADDRESS)\n+\t\t\treturn EFI_NOT_FOUND;\n+\t\treturn EFI_OUT_OF_RESOURCES;\n \t}\n \n \t*memory = efi_addr;\n","prefixes":[]}