Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A896EB64DC for ; Sat, 1 Jul 2023 15:10:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5D052861DE; Sat, 1 Jul 2023 17:10:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688224229; bh=x0aMyW9epaRt22NR8Rt6dw2+prLqlKCnyldhgn4cioY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=X3lUlJGXLSuXwsSGgSOjDkfSku/Ia2dgeYCuCtXAdbdLuexu3FPpjtxQqsqXym155 M4BRZcCD0f5r/P4cHzsSLoJ7y147At6l/czo5kn41j69F2zS3SLWIJk92J2NoqmfBx dDMzxQ+Zzi9RkjcjnJQskK4Z+E1eYOhd6iuOx4FFWgCTmCSGHtEDLsu3BZhyfaZjxb FZRdm15ky0F5wDyXFBUDUuK24QVDwXKK39Mo5GU4M+B1hSYsedM2/0ZXg8WefeNmzo IWJbhxfdM1iMrV9CFhdqxU/GVK5AnHA0yW79WuiFhZkZKASsETBsm798R8N8ftLDwt L6magRLYfYfUA== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 55B8C861A5; Sat, 1 Jul 2023 17:10:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688224226; bh=x0aMyW9epaRt22NR8Rt6dw2+prLqlKCnyldhgn4cioY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NvpUKn7z+Wi/jCUB/ZHkYrxaz70qPqV2SKlv1MNu+nbQ4NHOtPScIYZf2IdQy0jLj KEC0OtVsI7PvSieqxbVaY6oeiUm39bovtbQicmTbk1FPIbG0/r6GOpRMJFBPabeZ9v J34mt4LKOoq7w3C4tAnU5DLDR2BMHPW/CXzlAliNY4K/69EWobtIu7cSM5WM8+FlQ8 bjQFvKxgCTfbNWRb9rvWF+A33FiWe8aCKvp1CiE7bhstssi3zQENz0p8eAw8+9gkix taDjf2BXP90KIwJHs4ufklHZJeqGrMJ47KYDVf3uNkgMYKWECvy1mFd0z23DeL/Z5u C1JeLWFHEiT+g== Message-ID: Date: Sat, 1 Jul 2023 17:10:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 1/2] ARM: armv7: Add C wrapper for allow_unaligned() To: Heinrich Schuchardt Cc: trini@konsulko.com, Fabio Estevam , Simon Glass , Ilias Apalodimas , u-boot@lists.denx.de References: <20230701130028.214122-1-marex@denx.de> <62c2ccca-4c35-9887-53ed-9a4dc14e0b9d@gmx.de> Content-Language: en-US From: Marek Vasut In-Reply-To: <62c2ccca-4c35-9887-53ed-9a4dc14e0b9d@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 7/1/23 16:57, Heinrich Schuchardt wrote: > On 7/1/23 15:00, Marek Vasut wrote: >> Rename current assembler implementation of allow_unaligned() to >> v7_arch_cp15_allow_unaligned() and add it into armv7.h header, >> then add C wrapper of allow_unaligned(). >> >> This fixes misbehavior when linking U-Boot on ARMv7a i.MX6Q, where the >> CPU specific allow_unaligned() implementation was ignored and instead the >> __weak allow_unaligned() implementation from lib/efi_loader/efi_setup.c >> was used, which led to "data abort" just before booting Linux via tftp, >> in efi_dp_from_file() -> path_to_uefi() -> utf16_put() . >> >> Adding the wrapper fixes the problem. >> >> Fixes: c7c0ca37673 ("efi_loader: fix efi_dp_from_file()") > > Hello Marek, > > Thank you for investigating this issue. > > Looking at > https://lore.kernel.org/u-boot/20230320171335.1368308-1-ilias.apalodimas@linaro.org/ > the problem predates c7c0ca37673. So this fixes line seems wrong. That commit does trigger the error however . Maybe this was broken ever since allow_unaligned() was introduced ? > Your series has a fix for armv7 but misses arm11. That's exactly what 2/2 in this series does ? > So we would be better > of with Ilias patch. Somehow Ilias never followed up on my questions and > we lost track. > > Could you, please, test Ilias patch. That patch corrupts r0 register in both cases in the asm volatile(), since it does not push r0 on stack or use %0 temporary or whatever .