From patchwork Thu Aug 28 02:07:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 163 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346899; bh=sU0HYOxkpBzYrKAkvBZyzCN8c++I40dcjQQJgceELSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YxDenSvvZ//ahCu0S5atQgn+GJt49sXiq6okGhon8NZMsD0CgI31pVdPBdWdbxXap AJG1eIn7uOUWxTaOHe6y+jHsqCy+/TJbbeoSN98lEHY6aZGSQfFjPYimauEhi9VhWs CnpuIzBF8aMltNOjsiuzvWixDtC3Fs613RhUZY7fp92nfQHDdSU43WOg2TiqBY6Eh7 pjpfk7ICkPOHrX1h7wvAp2KdA1Y65ol0ODzIfNCpVrWLshUgrRVbCr0I8eOs+HmgkJ rWBDQptcRYFFQci/OnBh9cqX02cKkW/rA85AGGcGlJxLWpS3k4abscwE+IHCtsMSIa Z+wPUHUsa++UA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D8D267831 for ; Wed, 27 Aug 2025 20:08:19 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VD9kmr_9yiM6 for ; Wed, 27 Aug 2025 20:08:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346899; bh=sU0HYOxkpBzYrKAkvBZyzCN8c++I40dcjQQJgceELSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YxDenSvvZ//ahCu0S5atQgn+GJt49sXiq6okGhon8NZMsD0CgI31pVdPBdWdbxXap AJG1eIn7uOUWxTaOHe6y+jHsqCy+/TJbbeoSN98lEHY6aZGSQfFjPYimauEhi9VhWs CnpuIzBF8aMltNOjsiuzvWixDtC3Fs613RhUZY7fp92nfQHDdSU43WOg2TiqBY6Eh7 pjpfk7ICkPOHrX1h7wvAp2KdA1Y65ol0ODzIfNCpVrWLshUgrRVbCr0I8eOs+HmgkJ rWBDQptcRYFFQci/OnBh9cqX02cKkW/rA85AGGcGlJxLWpS3k4abscwE+IHCtsMSIa Z+wPUHUsa++UA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0B42F67835 for ; Wed, 27 Aug 2025 20:08:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346894; bh=9e3NVjsC1ZSup1kOZQFyldEeIXWo/3GjG2NN2liEfDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YXrySZ5nTwix54oPMSgF6uPVtrwo7xIrr+oK0hIOev1/7z/SvvsxNz0s3FYd2VzHl bCe7Jbn5Sw90AAvvFpDfMyx5CCe5JOS6srMro/oDity23IdMK/RjnZATdcfXT//LDy O/s9wBkl/Srl9ju7CqIX5xNt8jh3JPxQ0rD2e8KRTiwoD3c4ZFpPYDxp3bCpy2vDkL AdLUoxivRLA14mbnkn1W++/jGBIRC0wdV63a14EW9IlxI582oba/mVeApYHl7tBBdK qaBvsPModd3ELohmbX7oLqzRryyC8nAaswRvW/Fuqw1d02ckZkujsIatIDbH+blY/d Ac745Lsp9vBKw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1EE6677CB; Wed, 27 Aug 2025 20:08:14 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id iMs-CyZs6H8Q; Wed, 27 Aug 2025 20:08:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346893; bh=1z/G2i34GqpI0V7eVaB5PUzOYlpP2Ws6xauyrkBQP8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JqlPaHkTybAz42axh/A89dLfbwGS8WCCmisDFUwr5w+0NjC908mxJ8vFS1rr2aU7E mLw3OdCrykUc+dr7ab9QAo0QgQ0r1PD5Y89m2hr7804D+9lm4KfHPPWIl4BI23HvFJ QlVj3VvlIWa4s7x4j85pBvgTAvr+68AjibSulx/Iv+7CCTj+C/geyEnRvgp99xgfcZ lp1Y7bnqMXBBG1149+MoF7CYj3tUA4M90YqpZCMlhMSarJe93aFAaYawADUiYNztso gSjdrKwgCyOV7tGYI3zKmwutUeOqfgDuHaBFzuvdIIcCxpJgdYY56Ok92hkYJc1LHU S628vNBTpjuSg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D78EB6777E; Wed, 27 Aug 2025 20:08:12 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 27 Aug 2025 20:07:23 -0600 Message-ID: <20250828020732.981415-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828020732.981415-1-sjg@u-boot.org> References: <20250828020732.981415-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: O4ZBDJM5SM7C5DTANDSD3TVWOA2JZM2Y X-Message-ID-Hash: O4ZBDJM5SM7C5DTANDSD3TVWOA2JZM2Y X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/20] efi: app: Sync EFI reserved-memory to the devicetree List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Obtain EFI's view of reserved memory and ensure that everything mentioned there is present in a devicetree reserved-memory node. This ensures that the OS doesn't try to access memory it shouldn't. Signed-off-by: Simon Glass --- lib/efi_client/efi_app.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index 33ed3f2a874..6b8b53fbb41 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -354,6 +354,11 @@ int ft_system_setup(void *fdt, struct bd_info *bd) log_warning("failed to set up simplefb\n"); } + /* Compare EFI memory map with device tree reserved regions */ + ret = efi_mem_reserved_sync(fdt, true); + if (ret) + log_warning("failed to set up reserved memory\n"); + free(map); return 0;