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 374CCC4332F for ; Thu, 3 Nov 2022 16:57:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD32E851AB; Thu, 3 Nov 2022 17:57:28 +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="LPmbTx2c"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 23644851A2; Thu, 3 Nov 2022 17:57:25 +0100 (CET) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 2820E850E0 for ; Thu, 3 Nov 2022 17:57:20 +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-x833.google.com with SMTP id cg5so1581870qtb.12 for ; Thu, 03 Nov 2022 09:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; 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=IW6Xlnz5wo+5Cl5YyNW6UM6NzwyDtJbBuhCSKRh2hBk=; b=LPmbTx2c1Sij1iGOnJ3yJvVj9LxQg3j09WJN2NlI+6mQzXcX1Lg1xRnmWkcg2z3XOF ZkKMOntjTSY44Hy5r14vJkQjaTafZoFFluo3ndO3oWhKwY89rvaziv9ItmYAs8i0Owjm HSLqMqe9LajhFoy1EfyGqDg65v08uzpcOIa5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IW6Xlnz5wo+5Cl5YyNW6UM6NzwyDtJbBuhCSKRh2hBk=; b=VzZbPF2WG1/4uSFmfZJUHaWcudZLqBTmtuKH0YPpRUWZhtG4wh0ndzcttFOQ3BQgyt 6kyojmdvxeef72aPy8adiIhLUf4nBiZpRTwrouT6gzDTE+YNbEOidFLfxVnAuR/nh+xW O+A2OnCmDvt2ZOAN5ofeqsgIIoNN/pZzAhI9LnuaDwCkeNQyJW5RKVwF3qeqMC+c4VLt DWr356dBSOtq8dRlWFjkJ7rAa8BhQnejizQhMixhe6aytqCRZZ8g4GJ8vwSxm3I8VIyC GqaCgW/O5VzQeohN9B4XrRKBf93z3MR7DRvd4sJVqbSbcnMPnI72wkLhXJ5w/olfd55j BeIQ== X-Gm-Message-State: ACrzQf2ECHBcwBF7eSbYZ0gmW5TVsgfz3gwoJeuz1EvIOk+Fv1RszWop cWGwL9sRLPsXXQZVFSvic+RGSJ7kWo/viw== X-Google-Smtp-Source: AMsMyM5OwE9UjiLZvxBysYfe+SPP4DTL/blbRPtWXPqTBlpLLzc06iNdV8jDBB9sV8KkFn0U10s6Nw== X-Received: by 2002:a05:622a:42:b0:3a5:62:af70 with SMTP id y2-20020a05622a004200b003a50062af70mr25791847qtw.106.1667494637991; Thu, 03 Nov 2022 09:57:17 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-994c-dfba-30d0-8ee5.res6.spectrum.com. [2603:6081:7b00:6400:994c:dfba:30d0:8ee5]) by smtp.gmail.com with ESMTPSA id ge26-20020a05622a5c9a00b003a50c9993e1sm816706qtb.16.2022.11.03.09.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 09:57:17 -0700 (PDT) Date: Thu, 3 Nov 2022 12:57:15 -0400 From: Tom Rini To: Andre Przywara Cc: Sean Anderson , u-boot@lists.denx.de Subject: Re: [PATCH 2/3] arm: smh: Make semihosting trap calls more robust Message-ID: <20221103165715.GC2116612@bill-the-cat> References: <20221005163849.3205046-1-andre.przywara@arm.com> <20221005163849.3205046-3-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9uDGw67+9J53IzxX" Content-Disposition: inline In-Reply-To: <20221005163849.3205046-3-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.6 at phobos.denx.de X-Virus-Status: Clean --9uDGw67+9J53IzxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 05, 2022 at 05:38:48PM +0100, Andre Przywara wrote: > Commit f4b540e25c5c("arm: smh: Fix uninitialized parameters with newer > GCCs") added a memory clobber to the semihosting inline assembly trap > calls, to avoid too eager GCC optimisation: when passing a pointer, newer > compilers couldn't be bothered to actually fill in the structure that it > pointed to, as this data would seemingly never be used (at least from the > compiler's point of view). > But instead of the memory clobber we need to tell the compiler that we are > passing an *array* instead of some generic pointer, this forces the > compiler to actually populate the data structure. > This involves some rather hideous cast, which is best hidden in a macro. >=20 > But regardless of that, we actually need the memory clobber, but for two > different reasons: explain them in comments. >=20 > Signed-off-by: Andre Przywara Applied to u-boot/master, thanks! --=20 Tom --9uDGw67+9J53IzxX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmNj8usACgkQFHw5/5Y0 tyy4aQv/ZFe4huX3JPOb7REL9iJNsWIijYw6oQTOgyMP6KvpZuev2q0kNxc0OXv6 Lzmf42ue8YXbPkzpNJGOU0tzZL+UZphmN28sp8im9hlAACYjD8Kziijlj6QVsAQY g0zDw7Obc3tMGzuoW7J+N+SFmRDkyptdqwSH2SENnA/XfLS5abmHDy/9S45D4ipL xeVLnIRzpx6GFE1fxb7u3TlQjYnEubmwN2c2vpJNGNPeG4oypAW99IZ0dDYmhScZ Omn9kNHNBEDAymNfpcwMdxeRcuNSbwy6yFjMTDj+0zE6si4lY73/wbWp5WcMzGf7 qfvfor3iLMWKzM/K/tcx/jRALHS289XVVvFzZUVYwj1v60pGJb6GOrKsy7Oi5qai FtZdsy25RMqk4sk6LKHiHLlpmeRXpVz9QdlL0Ag/eD0sTwWbdb7zps/6tDlJQ6aZ Hz12hBy0ZgXO2WkHgUSPVM2BSgUE8Nn25H23GqIul3Qq2djN+M5xoRrXT6kc6DFT zEiqNTsI =oVsa -----END PGP SIGNATURE----- --9uDGw67+9J53IzxX--