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 26F26C0015E for ; Tue, 1 Aug 2023 15:01:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0E1AC867C3; Tue, 1 Aug 2023 17:01:05 +0200 (CEST) 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="RQ+KMaEv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12E1A8679C; Tue, 1 Aug 2023 17:01:04 +0200 (CEST) Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) (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 52BC98679C for ; Tue, 1 Aug 2023 17:01:01 +0200 (CEST) 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-oi1-x231.google.com with SMTP id 5614622812f47-3a43cbb432aso4214895b6e.3 for ; Tue, 01 Aug 2023 08:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1690902060; x=1691506860; 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=zDXOw9PI+yqKkF6W0YSbse9jFNWhmiOW5F8zxJzaC/o=; b=RQ+KMaEvtGC9XvW7fM9n0WbJCHTEck18+OSHbERJiwUbaiiIOfGdqCh+L4IvqLjsIB 7a6wzAlpjJMwI73rj2YgGSORrQQCzIGt+nm4+ugzgFi5dy+i047nd6o3w3KW3siIPRiQ MjnXTKHEtjWzpkvUXX177bNZ+zYmlH+dx1pwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690902060; x=1691506860; 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=zDXOw9PI+yqKkF6W0YSbse9jFNWhmiOW5F8zxJzaC/o=; b=RGQYIUsGmdId5tJdR2z1u4FGCJbmisrY9WDD1yBfA7d3rdexq9zn6i69SI7w6Lm4LY wkW0mmb+sqYVnfBH37YbPi521ytxg5or2wEtD2C7eFodb83Ka6DY6FSTqFD58DOSJXZQ hOArVQp/HMXIJqPVdcYTa2sD4JytRnvBg1r6lsWQGk1fbavkstDlr95vZrrujel+tQfq KyBZL6UqY2DkeXFfLljx9haGkUlhUqoL9M71z1dpKxD17w0NXW6eXvDzqRI1cxLSJrPz waRzbPVTmRr/zsgr1YNrcxGYWobxykg6xcHCmTkAmbfplSd5pk2wRV7FCZTrVt2TEY5q onwA== X-Gm-Message-State: ABy/qLZAK2UkRBQLRIQpMYLSQsqE0uWs10LLBtAklEomHjOI9KO54war 8nfUV4rWo7OEFf+csfOAj4ytcg== X-Google-Smtp-Source: APBJJlFOpwBQkcvgxOvsUMxMDqgNW8YnR2u+SVLjsqP9etBvb9JCIJVbzezIykfYGhmljybDQF+YAw== X-Received: by 2002:a05:6808:1987:b0:3a7:2524:6d46 with SMTP id bj7-20020a056808198700b003a725246d46mr7404521oib.59.1690902059685; Tue, 01 Aug 2023 08:00:59 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-383c-c9ce-d23d-78ae.res6.spectrum.com. [2603:6081:7b00:6400:383c:c9ce:d23d:78ae]) by smtp.gmail.com with ESMTPSA id y15-20020a2586cf000000b00d0538bab61asm2931133ybm.65.2023.08.01.08.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 08:00:59 -0700 (PDT) Date: Tue, 1 Aug 2023 11:00:57 -0400 From: Tom Rini To: Ilias Apalodimas Cc: Abdellatif El Khlifi , sjg@chromium.org, nd@arm.com, u-boot@lists.denx.de, achin.gupta@arm.com Subject: Re: [PATCH v17 09/10] arm_ffa: efi: introduce FF-A MM communication Message-ID: <20230801150057.GO3630934@bill-the-cat> References: <20230726160635.GS3630934@bill-the-cat> <20230727160712.81477-1-abdellatif.elkhlifi@arm.com> <20230727160712.81477-10-abdellatif.elkhlifi@arm.com> <20230727164345.GH3630934@bill-the-cat> <20230728135415.GU3630934@bill-the-cat> <20230731114628.GA112180@e130802.arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/vDnV64Ox7IPNfHc" Content-Disposition: inline In-Reply-To: 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 --/vDnV64Ox7IPNfHc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 01, 2023 at 11:24:46AM +0300, Ilias Apalodimas wrote: > Hi Abdellatif >=20 > On Mon, 31 Jul 2023 at 14:46, Abdellatif El Khlifi > wrote: > > > > Hi Ilias, > > > > On Mon, Jul 31, 2023 at 12:38:16PM +0300, Ilias Apalodimas wrote: > > > > > > > ... > > > > > > > Changelog: > > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > > > > > > > > > v17: > > > > > > > > > > > > > > * show a debug message rather than an error when FF-A is not = detected > > > > > > [snip] > > > > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig > > > > > > > index c5835e6ef6..8fbadb9201 100644 > > > > > > > --- a/lib/efi_loader/Kconfig > > > > > > > +++ b/lib/efi_loader/Kconfig > > > > > > > @@ -55,13 +55,53 @@ config EFI_VARIABLE_FILE_STORE > > > > > > > stored as file /ubootefi.var on the EFI system partit= ion. > > > > > > > > > > > > > > config EFI_MM_COMM_TEE > > > > > > > - bool "UEFI variables storage service via OP-TEE" > > > > > > > - depends on OPTEE > > > > > > > + bool "UEFI variables storage service via the trusted wo= rld" > > > > > > > + depends on OPTEE && ARM_FFA_TRANSPORT > > > > > > > > > > > > You didn't get my changes in here however. If you can do EFI_MM= _COMM_TEE > > > > > > without ARM_FFA_TRANSPORT (as lx2160ardb_tfa_stmm_defconfig doe= s) then > > > > > > you don't make this option depend on . If FF-A is only > > > > > > for use here, you make FF-A depend on this, and the FF-A specif= ic > > > > > > variable depend on ARM_FFA_TRANSPORT. > > > > > > > > > > Abdellatif hinted at what's going on here. When I added this Kco= nfig > > > > > option to lx2160 FF-A wasn't implemented yet. > > > > > > > > The defconfig has existed since May 2020, which is when you added > > > > EFI_MM_COMM_TEE itself too. So I think it's that no one did the ch= eck I > > > > did until now and saw this series was disabling what was on the oth= er > > > > platform. > > > > > > > > > Since FF-A isn't a new > > > > > communication mechanism but builds upon the existing SMCs to buil= d an > > > > > easier API, I asked Abdellatif to hide this complexity. > > > > > We had two options, either make Kconfig options for either FF-A o= r the > > > > > traditional SMCs and remove the dependencies, or piggyback on FF= -As > > > > > discovery mechanism and make the choice at runtime. The latter h= as a > > > > > small impact on code size, but imho makes developers' life a lot > > > > > easier. > > > > > > > > I'm not sure how much you can do a run-time option here since you're > > > > setting a bunch of default values for FF-A to 0 in Kconfig. If we'= re > > > > supposed to be able to get them at run time, we shouldn't need a Kc= onfig > > > > option at all. I'm also not sure how valid a use case it is where = we > > > > won't know at build time what the rest of the firmware stack suppor= ts > > > > here. > > > > > > > > > > That's a fair point. FF-A in theory has APIs to discover memory. > > > Abdellatif, why do we need the Kconfigs for shared memory on FF-A? > > > > The statically carved out MM shared buffer address, size and offset can= not be discovered by FF-A ABIs. > > The MM communication driver in U-Boot could allocate the buffer and sha= re it with the MM SP but > > we do not implement that support currently in either U-Boot or UEFI. >=20 > Ok, that's a bit unfortunate, but Tom is right. Having the FF-A > addresses show up is as confusing as having Kconfig options for > discrete options. The whole point of my suggestion was to make users' > lives easier. Apologies for the confusion but can you bring back the > ifdefs? Looking at the patch this should be minimal just use > ifdef ARM_FFA_TRANSPORT and ifndef ARM_FFA_TRANSPORT. >=20 > Tom you prefer that as well? Pending an answer to Jens' feedback, yes, going back to #ifdef's is fine, especially since default values of 0 are nonsense in this case (and as Heinrich's patch re SYS_MALLOC_LEN shows, dangerous since 0 !=3D 0x0 once we do string comparisons). --=20 Tom --/vDnV64Ox7IPNfHc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTJHiIACgkQFHw5/5Y0 tyzlJQwAj08deM+RGStBW7n1dPWgDYH2b3iVQeUoLEyNkCp29wTJmycFuwxe8zE5 PMG2cTEjNyLVpaDCPqGmv2R0YGBs2klzTa+bZFcDdK35k1JGCS6UDbaR1FiDcsHb m6rTBgdaEtfu2uCxOSL29/OyhUtttYgCwy0KhCfu9JkRG8eAFAkvrC5VC4Jqeas6 T5Npke7H3yOrmW2K+6nu5ebCZrl+VUGbmFbkhQ8flHJCprfVWst5GZCQe4ReC9Ox CZ03OSxHKikAflQjlq45Za4B37lkiNLKUK2Wz4hDN8Q/+0jNlo+qDcrYghSxxIYT EZxFWz1QWLALwgEz8thdIuohGvJNUN4QR18xFTFgLDc+mkADvTlgeNswpj/A1EuK UwZANsAN54h/ntG/uFUOH61fsh0oGvZaWlu24akyJAFXCwIcK5SPEiXU/5tDYy0o j0uv6vuP7pETtw0gqEZAY1CjhDxmBa5yxYEW3xLfNW5hdLODVd+J2aM/ZSRbn/xb PgXoVJgv =Gl76 -----END PGP SIGNATURE----- --/vDnV64Ox7IPNfHc--