{"id":2218881,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2218881/?format=json","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.0/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":"<20260402001410.3736815-4-rs@ti.com>","date":"2026-04-02T00:14:07","name":"[3/6] efi_selftest_memory: check for duplicates first","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"da0f9363d32d580d85e2574334ebbd352fbde8ac","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/1.0/people/88727/?format=json","name":"Randolph Sapp","email":"rs@ti.com"},"delegate":{"id":68728,"url":"http://patchwork.ozlabs.org/api/1.0/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/20260402001410.3736815-4-rs@ti.com/mbox/","series":[{"id":498412,"url":"http://patchwork.ozlabs.org/api/1.0/series/498412/?format=json","date":"2026-04-02T00:14:04","name":"various memory related fixups","version":1,"mbox":"http://patchwork.ozlabs.org/series/498412/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2218881/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=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=selector1 header.b=eRj+8SuD;\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=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"eRj+8SuD\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de; spf=pass smtp.mailfrom=rs@ti.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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmMmg4fPRz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 11:14:43 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 643FA840B0;\n\tThu,  2 Apr 2026 02:14:32 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id C401683CE3; Thu,  2 Apr 2026 02:14:30 +0200 (CEST)","from BL0PR03CU003.outbound.protection.outlook.com\n (mail-eastusazlp170120007.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c101::7])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 763DC80212\n for <u-boot@lists.denx.de>; Thu,  2 Apr 2026 02:14:26 +0200 (CEST)","from DS7PR03CA0267.namprd03.prod.outlook.com (2603:10b6:5:3b3::32)\n by LV3PR10MB8060.namprd10.prod.outlook.com (2603:10b6:408:288::9) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.16; Thu, 2 Apr\n 2026 00:14:22 +0000","from DS1PEPF00017096.namprd05.prod.outlook.com\n (2603:10b6:5:3b3:cafe::55) by DS7PR03CA0267.outlook.office365.com\n (2603:10b6:5:3b3::32) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.29 via Frontend Transport; Thu,\n 2 Apr 2026 00:14:22 +0000","from lewvzet201.ext.ti.com (198.47.23.195) by\n DS1PEPF00017096.mail.protection.outlook.com (10.167.18.100) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9769.17 via Frontend Transport; Thu, 2 Apr 2026 00:14:22 +0000","from DLEE214.ent.ti.com (157.170.170.117) by lewvzet201.ext.ti.com\n (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Wed, 1 Apr\n 2026 19:14:21 -0500","from DLEE200.ent.ti.com (157.170.170.75) by DLEE214.ent.ti.com\n (157.170.170.117) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Wed, 1 Apr\n 2026 19:14:20 -0500","from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE200.ent.ti.com\n (157.170.170.75) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Wed, 1 Apr 2026 19:14:20 -0500","from rs-desk.dhcp.ti.com (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6320EKsD1004385;\n Wed, 1 Apr 2026 19:14:20 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=IHEyBAAnFEUBMiCnYi0IxMCblhQjNlG7IGPG+DSg9ZPNzWCKUnDhCoIypy510M59ZnsCfyZwO+jvK/YXtMn83uvDIQjIPqy4SnK8ZoBfUs/inXCE9wzQuIRcDAENDVsNoOY5fh2tZJRE9tzQnXAkFqpOSzPqtf+jDtF+1+nCnJOcbQyBwVa+Wqy5OOacDgU0+fymgkWyjZWHi+10Lz1bKJqLf3bGbkJzgleT9wnBxDShpPN3nq6IZSbK3WhZ4wS7Hl+woOQEAdffXdO3LX+8d++aOAjPXUrYtT0hWz5G3ymCaXHBIQJQ95XmngmBUomBw21HdWvpZL/TOqfry3yJ5w==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=Eq+tB3bgbR8TKICMNQRm6vnQICrwF0l75XD9ToSuq+o=;\n b=EbG1n8Xw3qtpjyyWNOitRD16I53ulop0IlmlSBAg0/+s0zaWKqRlp53/HsBl9ZM+ZO8V2zTjohUxOSYI77E8/nSY6U/0/1pG+QUF+lTou1q3SPkmM9ws5s87HzW9BXm5dqDA9tinb8W6JcfkdQEQg14Vq6xUVwcjsb+nisFHft0VEDMn1JUkXbHcRqYH96Y98lGLSPpytd4K5ZDbmM34V2Gg0criwsbkd5zf+7jGPPf48JYz4to+fSeFkOSY/dSb8yWqoASW0dLz2p2GrRK/9twdUPn2h2hBq4RP3Ipy6/7Sy/+2DRexv2PirG68jWzXqdTVDw5+Lo5oTMDeTIgV0A==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.23.195) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=ti.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;\n dkim=none (message not signed); arc=none (0)","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Eq+tB3bgbR8TKICMNQRm6vnQICrwF0l75XD9ToSuq+o=;\n b=eRj+8SuDiDROK7Gpb5i2QwEIn0PdFhvbV5WLTSRqhiRinjV8zL1cHOdMBMRE9XQxPmiOOIh8fU4Kslb2/2y+j8ATAB28APFA6wgynN8U4iA1nhLNSnLFhe+YmQg9Rr+VBNVQ9Z7j5Anw7ubxFi9XnpFj4m/Mlq8Z1GgftAeitXc=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.23.195)\n smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;\n dmarc=pass\n action=none header.from=ti.com;","Received-SPF":"Pass (protection.outlook.com: domain of ti.com designates\n 198.47.23.195 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C","From":"<rs@ti.com>","To":"<robertcnelson@gmail.com>, <ayush@beagleboard.org>,\n <Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,\n <trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,\n <ilias.apalodimas@linaro.org>","CC":"<u-boot@lists.denx.de>","Subject":"[PATCH 3/6] efi_selftest_memory: check for duplicates first","Date":"Wed, 1 Apr 2026 19:14:07 -0500","Message-ID":"<20260402001410.3736815-4-rs@ti.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260402001410.3736815-1-rs@ti.com>","References":"<20260402001410.3736815-1-rs@ti.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"DS1PEPF00017096:EE_|LV3PR10MB8060:EE_","X-MS-Office365-Filtering-Correlation-Id":"162f2fe5-f08c-447b-f018-08de904cca6d","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|1800799024|82310400026|376014|36860700016|56012099003|22082099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n ux51+Fc848HJtDqlTxCBaJbad6+UmP0teKL+vVAQLSxjIHwofcz6O68GN2PThdWCzMMHNQRrpdOdeak5G7dE3872lywMthDax7BcTVwvulBRfzr1rC6/fF5QMsELXbhiovtuvLELKxxaawJRzzBpGdZVyc73hd97ahqi/5zoBf2LIKa8xypob4E/0NQ+PKM4FEHcxIh1UXuL9lp37iefe7HAhiPgUAsHX/YOvOOO7hVAgIXn1FjjSC5AYVSuWBf5RuUB6GY1oM/aCjy3cm/B6Cct209xG41eWeoOGrVgRrNAlAGVVowIgRF3O0PNHsUkjm4PdZ0cXJAFaeGe10NjK29SW2h4vmMak93q53kmTLS79lJiPz2IVU0+guJWmtIquBgE0rq9T65Tk8DtPwscf//hEzfaCxnSdmgqNDlRxAeeEypN8oJ8kufoB7JLvRRcGYw7PZzuo9Qto8uXVZdJSHO+KU3K9sSnzY4kpj8YjMpBftmKIxAl8q4gOg628zgmTte3lbaUO9H+GTyXI826oCQus4YmbhF5gkjJTldYuB7shGic4xkfrXekqGoSHdCFSrRXiZzJEjkt6T1d6tBGwdMPWn8qDuPj1Z4s4Uvms4A4r/fh2aXKhx81ZMO82tS8clrEZPkpCGLJHvIXBHQkEBGwbjmtPOLzpUN5A1Kn9YchDD7EJX2Chs9XVfUW8frFyWpQJIJrgfsucewLh7ifVovySAonjyGc1qoUYIZXpLzZ/1mdVFdd1zT4OvjNR8FbZQw10Ns6vXi6VzAOIxQgCQ==","X-Forefront-Antispam-Report":"CIP:198.47.23.195; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:lewvzet201.ext.ti.com; PTR:InfoDomainNonexistent;\n CAT:NONE;\n SFS:(13230040)(1800799024)(82310400026)(376014)(36860700016)(56012099003)(22082099003)(18002099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n zEnRBotQDm8wbxsmyGawpHsEkB95TH1CRJQM5yki+OOP3e3MoLcFctcIIv3yy7rGzwl0GV06ieVlFiT97+/fCr64Gm1XQogJdS3vQ6r63Vk2V5JZcRKLd+0pUtV8Wq6/XobnLVrsVLy0DsCH4Ntb3olnbFyy5OigZ4Lcn69F2shDTgtPKginvCn4SemmQ/Fq3fqOGX0Nvwgg1Q59HZ7/3unhG/+c7H/HivdvT4aosJsGM8qmKkSUelmaSQE2J12lz771IeR3chLRcnSPZsKX2LrnDzZM8F093yH9GmVoCAxD7dJsAtegIIc49gDeF3tLoyza9LRiOpwUkXMwGYMsLqnPiafBH+oGPXnf3s3huRrIQre1jQN3qdaBBamxy+iW/nFEXLUATPmqa/HBinUQIV/11nCZNvBOl42k2ukmhwMpsLrGwaItvo3jINzEYVeH","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"02 Apr 2026 00:14:22.0321 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 162f2fe5-f08c-447b-f018-08de904cca6d","X-MS-Exchange-CrossTenant-Id":"e5b49634-450b-4709-8abb-1e2b19b982b7","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"\n TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7; Ip=[198.47.23.195];\n Helo=[lewvzet201.ext.ti.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n DS1PEPF00017096.namprd05.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"LV3PR10MB8060","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":"From: Randolph Sapp <rs@ti.com>\n\nCheck for duplicate memory mappings before reporting any incorrect\nattributes. Could be that second allocation has the correct type while\nthe first doesn't. Knowing there is a duplicate in this scenario is\nmore helpful than just reporting the first mismatch.\n\nSigned-off-by: Randolph Sapp <rs@ti.com>\n---\n lib/efi_selftest/efi_selftest_memory.c | 21 ++++++++++-----------\n 1 file changed, 10 insertions(+), 11 deletions(-)","diff":"diff --git a/lib/efi_selftest/efi_selftest_memory.c b/lib/efi_selftest/efi_selftest_memory.c\nindex 4d32a280061..7320964c129 100644\n--- a/lib/efi_selftest/efi_selftest_memory.c\n+++ b/lib/efi_selftest/efi_selftest_memory.c\n@@ -60,7 +60,7 @@ static int find_in_memory_map(efi_uintn_t map_size,\n \t\t\t      u64 addr, int memory_type)\n {\n \tefi_uintn_t i;\n-\tbool found = false;\n+\tstruct efi_mem_desc *match = NULL;\n \n \tfor (i = 0; map_size; ++i, map_size -= desc_size) {\n \t\tstruct efi_mem_desc *entry = &memory_map[i];\n@@ -72,24 +72,23 @@ static int find_in_memory_map(efi_uintn_t map_size,\n \n \t\tif (addr >= entry->physical_start &&\n \t\t    addr < entry->physical_start +\n-\t\t\t    (entry->num_pages << EFI_PAGE_SHIFT)) {\n-\t\t\tif (found) {\n+\t\t\t\t    (entry->num_pages << EFI_PAGE_SHIFT)) {\n+\t\t\tif (match) {\n \t\t\t\tefi_st_error(\"Duplicate memory map entry\\n\");\n \t\t\t\treturn EFI_ST_FAILURE;\n \t\t\t}\n-\t\t\tfound = true;\n-\t\t\tif (memory_type != entry->type) {\n-\t\t\t\tefi_st_error\n-\t\t\t\t\t(\"Wrong memory type %d, expected %d\\n\",\n-\t\t\t\t\t entry->type, memory_type);\n-\t\t\t\treturn EFI_ST_FAILURE;\n-\t\t\t}\n+\t\t\tmatch = entry;\n \t\t}\n \t}\n-\tif (!found) {\n+\tif (!match) {\n \t\tefi_st_error(\"Missing memory map entry\\n\");\n \t\treturn EFI_ST_FAILURE;\n \t}\n+\tif (memory_type != match->type) {\n+\t\tefi_st_error(\"Wrong memory type %d, expected %d\\n\", match->type,\n+\t\t\t     memory_type);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n \treturn EFI_ST_SUCCESS;\n }\n \n","prefixes":["3/6"]}