From patchwork Wed Aug 20 00:40:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 41 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=1755650471; bh=h1GUHgVsPQBeZazMiUmaLBN4BQNM+THibYVnPZFRa+w=; 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=cQbw+Fo2OtNbnZjSjyuPDCdm4YGETI7vu3eZZjI1qg/TogZCwnzvVKD7J3wfgKlKw AYeWFdAL/QKgsM9yLrXCuKODDH8tZn0+8FRskJn2A/5NgDXsI4jbkAk0nEhapT8kvq fJFr4lXFFkgDMTNeRjee0BLXDlvQvi84nT1rKPEsO7VqvfDYE90sjUeMxgHHEmgB0w qhJybA4lW5kypIFvX4b4ddwskQqMdmh2e+2umjYGuOX3MR8CcXvGIQelqbVGBUQx5S QZYwSxwc23KVzRUeOn1+4UETajwyQROcwqpVsmdFP2YkPzoxNcxuQ+Mxh7tA1VnFwB L086SikljWKJg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E2F45675DE for ; Tue, 19 Aug 2025 18:41:11 -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 mkmq2pEYhgRk for ; Tue, 19 Aug 2025 18:41:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650471; bh=h1GUHgVsPQBeZazMiUmaLBN4BQNM+THibYVnPZFRa+w=; 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=cQbw+Fo2OtNbnZjSjyuPDCdm4YGETI7vu3eZZjI1qg/TogZCwnzvVKD7J3wfgKlKw AYeWFdAL/QKgsM9yLrXCuKODDH8tZn0+8FRskJn2A/5NgDXsI4jbkAk0nEhapT8kvq fJFr4lXFFkgDMTNeRjee0BLXDlvQvi84nT1rKPEsO7VqvfDYE90sjUeMxgHHEmgB0w qhJybA4lW5kypIFvX4b4ddwskQqMdmh2e+2umjYGuOX3MR8CcXvGIQelqbVGBUQx5S QZYwSxwc23KVzRUeOn1+4UETajwyQROcwqpVsmdFP2YkPzoxNcxuQ+Mxh7tA1VnFwB L086SikljWKJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFC4F6749C for ; Tue, 19 Aug 2025 18:41:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650469; bh=FcUWud7iZGklGReNoHQRumyMdXlgCu9tJxEc14yEwkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alsRVhn2RlDcvID8SPHM4j2eEZV0U+TJbsSX1NLiYu5vH+WxOKec0WH9QsrywPXtF UNKegsjiKqDYSG5wFO8W4KkcwUXHeUcPTjZeyDHz3PqP5vKnDT14IbFKImf1fm7Dfn CZDWKZRIbaAQT/W/5BD6APjt+gSvU2E7g9OFdVFqnNU9DwfUTRjT74OWzWvFyVKkZ/ lPKy0AT1Ek8KmiPT5c9JRwN1BV9PyIk6Eh8SnfThzarBZyb/S4pucPKg2fBGRc7A2x 0sBy9U51teslwG09NqI/FNrNJNjWkXRvNww8yf039oE+pzBEzzEU2pH6047Fox6KGQ 86T/PDHF5r9SQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69CBB6749C; Tue, 19 Aug 2025 18:41:09 -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 fEhrqqyW0PXi; Tue, 19 Aug 2025 18:41:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650467; bh=1CSCtZcn92TnM+DJ8mGjTKYzX3LWeXCBXnuENsZ9AtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rej3tY0UfO3ea13EWiI3AA/UVSMT/3TFPgSK8MyewpzAnjWbrshWBjeh5s2jsRu3N yEPx2Uiwd66GZ7nmbu8wYeSTlCi6pHTxPW6mBtRxYfu6wB3Tux48VLvqT3PEQGE/7x lA0Ohf9L2rokj1V5LOYeNuzxrgt/7VpludjBnx050Y+SOU4H/8Slz6yTPbV7fnbyqX RqAhXkYoIyeHo7qAFAVeq9Z2B1xVxq7Yw847WuGIfl+lfcz/liTo3aYHy9k7w71kEL yNMCWU2Z17QgtS6n7KXeIja2xjIMaSNBmzEQJEZmW6qEzQT8lWJ2juxL84V2KezaMT xIwn5HxlkYqYQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 211D5675C0; Tue, 19 Aug 2025 18:41:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:17 -0600 Message-ID: <20250820004039.3920254-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820004039.3920254-1-sjg@u-boot.org> References: <20250820004039.3920254-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YCUE7USIFQ47ONOFCV4EYP7X4GK23CDT X-Message-ID-Hash: YCUE7USIFQ47ONOFCV4EYP7X4GK23CDT 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 03/18] efi: Update path_uefi() to avoid allowed_unaligned() 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 This call seems to have been added in an unrelated commit, likely to fix a bug: 046fe7b5074 ("efi_loader: efi_dp_from_file() expect UTF-8 path") With standard boot we don't need to call efi_set_bootdev(). Also this function is not available in the EFI app. So for now, add a condition, to avoid a build error in the x86 app when CONFIG_EFI_BINARY_EXEC is enabled. Signed-off-by: Simon Glass --- lib/efi/device_path.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index 0926b51e987..fb6653b23a3 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -741,12 +741,14 @@ static void path_to_uefi(void *uefi, const char *src) { u16 *pos = uefi; - /* - * efi_set_bootdev() calls this routine indirectly before the UEFI - * subsystem is initialized. So we cannot assume unaligned access to be - * enabled. - */ - allow_unaligned(); + if (!IS_ENABLED(CONFIG_EFI_APP)) { + /* + * efi_set_bootdev() calls this routine indirectly before the + * UEFI subsystem is initialized. So we cannot assume unaligned + * access to be enabled. + */ + allow_unaligned(); + } while (*src) { s32 code = utf8_get(&src);