From mboxrd@z Thu Jan 1 00:00:00 1970 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 DEAACC678D5 for ; Tue, 7 Mar 2023 17:52:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E8AC85C2C; Tue, 7 Mar 2023 18:52:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="kQXbkSv5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE10985C0F; Tue, 7 Mar 2023 18:52:20 +0100 (CET) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1A3DE85BFA for ; Tue, 7 Mar 2023 18:52:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82c.google.com with SMTP id r16so13650162qtx.9 for ; Tue, 07 Mar 2023 09:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1678211537; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=V9Tj47e8W1ohyPy8AKyEjk4y1+/+4uV0EHFYRbDI9oE=; b=kQXbkSv5Wt/ME+HQ9YvMBO6xDe3FPlHRHNcEuTg/ltKziWsJu7zCylaB6I1no3db2N VrpwkC6yxkkV7benXVEo6rK/yZaYAZ69DljvPloMKFPDpknZAmhePK5avbMDwxoWHb0L Q6Ugwky/12UST9g5Tr7rsib5otSUsRo2Lwm9M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678211537; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V9Tj47e8W1ohyPy8AKyEjk4y1+/+4uV0EHFYRbDI9oE=; b=k2g+2AJpNU/1qfu9y2p4SDC1RSHKlsWOY6i6NzOzqMa2oAn5IYjzm6wmO15k+Y9ODJ RN4f98bd1keHEUjvrj8uhKfMm/keFT98DxTDa0ZgWYbuDLfcEiZg/DSUQU7wWa2ngjP6 tzA/sJovsT1szly8xvzW3h2pLy6CcUPKjSeZTRnc11GrQ2GMkI1tAH03EslgHNt+sZIe zNQIpPiwX88A4K2Sxz3aVQZkZTE+eWvYsD2Tw8v+YXuB0bsER/jmRml3uDpgrElL55Vq sqGkbq1oQQNqj01aU0jdaAdyQ9hw47ob0wqf+EDqfXPapowBTrkUzdNp/rzXo7iuLAAc sCDQ== X-Gm-Message-State: AO0yUKV3eMbLSjQqCFgLk4IHTEwy65F6XnbQCedE0+dybrPOYfpgCPRu WrOrzX+yBJnAq7Atl1VN1RJ93w== X-Google-Smtp-Source: AK7set/HqCVu76BhUlxh4hFSbVSjpdzqwTvvK9kFjQTbDhmsbjDS2N2okUX3FAsPu+mUXhkEPxdpmQ== X-Received: by 2002:ac8:7d11:0:b0:3bf:d9a0:a33a with SMTP id g17-20020ac87d11000000b003bfd9a0a33amr26459158qtb.27.1678211536813; Tue, 07 Mar 2023 09:52:16 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-0000-0000-0000-036b.res6.spectrum.com. [2603:6081:7b00:6400::36b]) by smtp.gmail.com with ESMTPSA id z24-20020ac84318000000b003c03b33e6f5sm1348067qtm.90.2023.03.07.09.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 09:52:16 -0800 (PST) Date: Tue, 7 Mar 2023 12:52:14 -0500 From: Tom Rini To: Andre Przywara Cc: Sean Anderson , Kautuk Consul , Simon Glass , u-boot@lists.denx.de Subject: Re: [PATCH 1/2] arm: semihosting: replace inline assembly with assembly file Message-ID: <20230307175214.GK968799@bill-the-cat> References: <20230207152105.2167641-1-andre.przywara@arm.com> <20230207152105.2167641-2-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="e5Oh1fioD3mbw0Wt" Content-Disposition: inline In-Reply-To: <20230207152105.2167641-2-andre.przywara@arm.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --e5Oh1fioD3mbw0Wt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2023 at 03:21:04PM +0000, Andre Przywara wrote: > So far we used inline assembly to inject the actual instruction that > triggers the semihosting service. While this sounds elegant, as it's > really only about one instruction, it has some serious downsides: > - We need some barriers in place to force the compiler to issue writes > to a data structure before issuing the trap instruction. > - We need to convince the compiler to actually fill the structures that > we use pointers to. > - We need a memory clobber to avoid the compiler caching the data in > those structures, when semihosting writes data back. > - We need register arguments to make sure the function ID and the > pointer land in the right registers. >=20 > This is all doable, but fragile and somewhat cumbersome. Since we now > have a separate function in an extra file anyway, we can do away with > all the magic and just write that in an actual assembly file. > This is much more readable and robust. >=20 > Signed-off-by: Andre Przywara > Reviewed-by: Sean Anderson Applied to u-boot/next, thanks! --=20 Tom --e5Oh1fioD3mbw0Wt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmQHecgACgkQFHw5/5Y0 tywjfwv+JtVc8rfQgAAeMzjt9JP0ugUNuzrpNGCXaxzeMCYk/iH2uQabdOggyJ6T 65cCRhfh83AcUYG3/7fMR64vLKDkEo8qYEoB4FTmCWnmFt1rkX2VAFISZQQqVDJh m9/b/IcSXk3gJLtITf8EDn2XtsWri6tijR0gYZgl6Ygl5BEwaz2yqgWDCsEtrt5c NpciUrdP2npQ4iqyyMy+vPpS4CATWK43NbHHZ09mfQgd2lfM+OUaSSua+ZSoAle8 fyVm91CfDGGWxih8E0EXy4O7DotDOtfSRVYQrG2JNdALrU7KyhJv0CgySyJKKIWE lOCYf7P3lkbfzU1elxPZ8czIQO8d7uYnZTvSPnp4WTy0SjRBdiNwln8XF56DAh4h gWSEgfq2PAYOuBFUiwnRHCMLhQhiRVXIAAvQJeQeaMCFkUpDt1Ct1nDycTEJsRuH mLn/Xx/ozBtWfxNG7WZWDtmAoBam+j5FTeRxRkJhBF9+Pp49E7eSEnYDAcWQbWBw lonKPGZJ =S3Pb -----END PGP SIGNATURE----- --e5Oh1fioD3mbw0Wt--