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 71E36C63797 for ; Tue, 17 Jan 2023 07:55:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 265E5854C0; Tue, 17 Jan 2023 08:55:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=gmx.de header.i=@gmx.de header.b="rQ1uMLJQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F60D84FBF; Tue, 17 Jan 2023 08:54:59 +0100 (CET) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D385B854C0 for ; Tue, 17 Jan 2023 08:54:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ml.lawnick@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1673942093; bh=ejiX1+XPYnYv1zAUuKSGbxPa59QRQnb6bpjFC7yN8Pc=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=rQ1uMLJQkP81gShyr1zhVj2Ir9o3koTflCOldCRJUMiUojG/fhKuAgghe1OocAX1g 34IIwv9IDShobgNjvGyRVSHZ/AuuFNKzOCaoHG6QUNy1FouV5zQ4UYppWaGlZit+ER IhvCnb9KTuNcdInudzNbauNxIt9PG6V3QHao++Mbkv9Zq4/0K2PW8IqdHddNCDQMPG w7NTZ0A0P2UBNNxDGDHC/2xjuGjsxS9V7SmrCu38io3Av8FgLoMqUMt3RJoOW+qcgc pXu2oWlq7v4RElt4jDSNE+FqfavS7OdzXU3yGpaVnlObglRUAIBhuQI15yhDcD6h63 hvlCRBsBlEVbA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [172.30.9.9] ([131.228.32.169]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDhhN-1pP9CN3TBX-00Ao9q; Tue, 17 Jan 2023 08:54:52 +0100 Message-ID: <0a5b2112-0c4e-902a-36eb-d7de50224e50@gmx.de> Date: Tue, 17 Jan 2023 08:54:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Help needed: EFI debug To: Heinrich Schuchardt Cc: Ilias Apalodimas , u-boot@lists.denx.de References: <8d3f11d1-98ec-5dc6-d908-b6bb650a32e7@gmx.de> <4a9c01d0-bc77-6f2e-7da6-a7da458e74dc@gmx.de> Content-Language: en-US From: Michael Lawnick In-Reply-To: <4a9c01d0-bc77-6f2e-7da6-a7da458e74dc@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Tt0MMKDIir26TVgFQ+mHL+nLFPePK6X3Qwx62HWQ3lzsVyZuS+9 aeZNyoEAXhue0XMgvvwYa2E5aDSyOUq8cgkf/022yzdfG0cgG0t+njIc1za+E/m6qZ+mDRK TXmekZcOF/mY2lI0RPymO+zOPn86JkVRBEc/tQTx6kDEAFnkhWoUtrSPi/NV8oFnoxo4yXq PoI91AmXMbRAXbQx3GjKQ== UI-OutboundReport: notjunk:1;M01:P0:PLBzxPsl3xA=;9NY7jrR+oVmJCVx40C77t62oLKP 1BPzLV4lxrnjh5FaB2ymaEvPfSJIG9BQUw7Ofsa83cF3vN7cbx0W3N8aWIKmMvlsKMtc7p80A k1eukrnPrxdwyvx9NaK6IrqzLefm1xXp/tmUqrBO+CzKngVCWWEmnBCISabRUtFlE1brdsSuH XrUdo8aI1bYd4wyPko1tWHYBXrDTIqcDV1ZS4MRLRbztWWBWzws+hR8Kh/D8J8wMvgZIAeVab 4TIRTv7F3eNakQNY+8hQC18Qp67fHXIhn3OHXX11JljVUQEvElaCyzoXx4ggZWuW1HqTAPzGj XeLO3CRk5TTDooiXtK25ufgnrDU/+WtjQ4ju/Hg6Rp6ZgxS0pt1JhzHvDIn/tWp/7BPC+MNJO IIn65WQmlSEwQ91wlaKEyPVglTfQ2uvxDo5qJmMmaEBmg2CV+uEoz2m+mb3gUDjstXPpgC1W8 u7RMkRUnI9yV15N/z7XwQS6InsQFyDUgJsLpWI4SAr0yKBV7BNZEJXvp60cQQT3qjpeGju59Z tTNJdCbn2XEhbXWp+wVCPoWkbRZNMjXwFEv2f3tX/zIO/pepzKEGNFClqvwPssK6LrE8rcoeY t87p2iDEpSNNYiItB/ABaihs++HKUpdP9t3JkbQTPq7vE4DDABz0ZzBphaKkHGSHSnQY+ChRC zyXxBi4nl1pwvnPXDY8kjvJtyo72EvFi/2Xbme02yVCfma8UAXeJK4VzA+gg8aeJ4CaNS8aXp EQOPeDKknL1r0owRfmMW6bGcWCB/7AlHEYgLeu6fSc0FXOL/8TnrZ/80peXM4/Rd9/c+WDtwT uh/87CIVqzz5zq/JgBMjrSbzmmSOVPPFTOs5MbQae+9F9MnmTWqNVecnMEYkJcG/nBOWC7JkW MjgO4ySC7dD3PyLycDoQJfNSB+u+wp55S2P2z/hZZHzXa5IwTp+aL2zVinXlon2AEO5zxHXcf 51PCc8q6OGZnN+ijXczY7UFBp7I= 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.6 at phobos.denx.de X-Virus-Status: Clean Am 13.01.2023 um 15:52 schrieb Heinrich Schuchardt: > On 1/13/23 14:47, Michael Lawnick wrote: >> Hi, >> >> I am trying to printf-debug EFI execution triggered by Linux call. >> Specifically I remove a persistent variable via Linux console and want >> to follow execution. Without any printf() this works fine. I need this > > Hello Michael, > > U-Boot does not implement SetVariable() at runtime yet. > Hi Heinrich, seems we got this by our SoC Vendor who provides us with U-Boot with EFI support. >> to refine existing implementation of saving variables to SPI flash. >> >> While printf() works in U-Boot startup context it leads to crash when >> EFI function was called from Linux. Same for putc(). >> Next I tried efi_st_printf() but this already crashes in U-Boot startup >> context. >> How do you achieve printf() debugging in this scenario? >> Which initialization steps are required to get efi_st_printf() working >> outside self_test context? >> >> TIA & KR >> Michael > > U-Boots print functions can only be used before ExitBootServices(). > Don't use any library function that is not declared __efi_runtime after > this point. that was my problem. > At UEFI runtime you might be able to invoke a Linux syscall. I never > tried it. Meanwhile I found out that the SPI write is moved into ATF from where I have much less restrictions. As such my problem is solved for now. > Or move the debug output into a different UEFI variable using > > * efi_var_mem_del() to delete the existing instance > * efi_var_mem_ins() to create the new instance > > Both calls are needed. Nice ugly idea :-) THX Michael