From patchwork Wed Aug 20 11:23:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 59 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=1755689051; bh=P0QHDu8b7ldjK7VoUNvESk4Gf9QeEVOqsNjKZsEykGc=; 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=qJezZtY31yURFWwgjT2XhRz3NDeQuMmG/dMrck2McUYNwA3Ks7qrNZP2pNmtB93d2 7T0JBAiLJj+idUKcKRZuW+ZNvvwG9qU4qxJYy0/XT+A5rcIPoCJPYQpaHyH5rRtTYm jpI6h0fWNcnA5zhubmezArYTuW3XPXuHJ7j+44uak8oHaH7uRdG17Rm8myjFtp9rZS 52J5LW8eAvy7puBA95OmVRvQ3PPTyMSNooSu+WblPU5tStfSW3P7BJFXXf8Ty2jK30 k+j9+CwzWVbQtt2UXNdDDMXR4LY78Y8cOhIGwiwGCXHR0JVTK+pUa7O6cTyRJ3LBan OtzQSrU76S5Zg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 600916768B for ; Wed, 20 Aug 2025 05:24: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 vUe-X_8lFKl8 for ; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689050; bh=P0QHDu8b7ldjK7VoUNvESk4Gf9QeEVOqsNjKZsEykGc=; 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=W2oYktaCxKb7iK9hczFHoRsT7SgikkDoPTnKIztUusstv9fuImosoQW7oy46hF+Ti lDwlKMHPQfKoUsd6EQpiIGr6F/RaJj1sVE/zRcT2pkAasNVStXDNXaAaKOdlXNcVaf fDON7NPjpzEFLDFVzsbq92cVo0/bsiPNgYalxmvk2nFxDQgmM+QvpdVudO65qRe7tP IiPX1Ypu1R/v4Oq6DJ138iO6yM7EyrXxZVTzqg4GdfrPi2ljHfA87Q0HWT3eCEbmBZ 2GF/BhhrhIWgrnrJB8v0xrGjrSjORTKIA86d1QCcaqeNbhtNiA4nsSyFPCBR5MNTGo ToqaEWJv49HcQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 133086765F for ; Wed, 20 Aug 2025 05:24:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=BYsYss3COU9kdIFx6Ov/dHEqrgke2HqEbR37LxYmoDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ng3b2Svo6PTtEUThoPtMcz/M/gYl2ZjpxlOjlbvF/M/7DbF4l/p5QBaSbQe/HyKMH m0AF5yIHCb49dd4zTkOr/REHFSsi5o+Q/kDqjfhi8lZ1Mw1u7wEDlc8ucdOLLK+hsW ILt4jaqjWNi9tcLQU6uMHQs2erTMI7MmKMak0eJqWybaOrKKjRuNBR7r9P+MKskyfV j0xGOnHNmJt5a3xkhzFTBWAAMgVyLn9+VgFNIYnh32qFY4f4lTIrpzrWp5/oVpdxEd 75JGDcZ+uRz6bWxigONSb8sJVWEsp+ci+QVBErWic6+seaImKDEhvm8Y9L68sjTmmk RFhKX5wbT4MMQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 839056744B; Wed, 20 Aug 2025 05:24:07 -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 p8NAS9adZuzd; Wed, 20 Aug 2025 05:24:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=qVRx+ATiMIxH4AevfUqidg7Ec4kKdacS9Y+glWFJn58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AA2kVJ7vqe6EWM+XypfCTIIJwx2pdmc0GJRBff7bLtd2pMofSiPYDkzCruQd/ALTX NxJvSw41owwFhCY6HcTtIuMHVvD7hOXpHn9+MMlcNJP3++ufj0j83oVLwJ/S3Wqwlh gCH+F6yU0LYzhVXx5RLZPI/8mk9ObZ+emZFaUFijSYqaaS04vT3vE25kZs2Xa2ArZp WDRHRQbjPPLF9VmawOGqHl+lVNdRUXz6krYWaTmoJi7miBYw7XDzR9avbwvx03JT1U bYkUjSJ3GXC9FgPOKMz5UZKfZPppg/cgf8Mv0v3plVPR70buq9eHKxXHw3b/svzJ5N eajpJRjCO2CvA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0C5EA67666; Wed, 20 Aug 2025 05:24:06 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:15 -0600 Message-ID: <20250820112340.147082-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 66QYTNDWG43NZXU7HRN4R5YAAMT2ZAPU X-Message-ID-Hash: 66QYTNDWG43NZXU7HRN4R5YAAMT2ZAPU 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 v2 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 --- (no changes since v1) 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);