From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web11.6734.1628684483282234829 for ; Wed, 11 Aug 2021 05:21:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RUOUupsT; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id A9D3260FDA for ; Wed, 11 Aug 2021 12:21:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628684482; bh=l702X8tjo3X1AHnmAXgWGem+pEu/gz55XW70RCKCnhQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RUOUupsToVmaQ858YN4odI+KejGLMJTF/T3WxxGsbClGSffjyHUisqGe4SQwWHBZU 9gz5OtOvRRT06SnSZRNI97THunwNvKe8uCTM3nMLqdQnUK7FwNuhk5pnjaLIvW9EUb v7o1yb2CpoWG0+IRRYiG2jqtPI3sREcCLzCJP1aTA93zGPphFVvXJ0js1G6hP34ftf tz4JxP+o7+ZJ/i7bP8CMgAMGtObdlwqEpeEBwi+I+XxiEGE16xQvYn1+LcsR5ZSkg1 v3fGgRTudA8jsa+X2WZyqBFAiOHFccuKQkRbwSDzGBIiYtJoIHJn4pdw4jANc3atCa p2KQLnM5OXWzQ== Received: by mail-ot1-f52.google.com with SMTP id c2-20020a0568303482b029048bcf4c6bd9so3062554otu.8 for ; Wed, 11 Aug 2021 05:21:22 -0700 (PDT) X-Gm-Message-State: AOAM531m7JRCD4SP9EhKuT9VXbYFWqmux2yXdhJ2lbkFhI4CqKMiHO6V JZc5HdTjAQSb6pipmLpXu+CUi8G8XcaeRypRX/8= X-Google-Smtp-Source: ABdhPJyn2emKprUe/p4tS2w38BFfxRSdNhrrgqmD4ccRX1ofF0pkVT81xiv5tuazW+MNzn3oZuGQbMmP1t3tbEgrLeA= X-Received: by 2002:a9d:5cc7:: with SMTP id r7mr8337519oti.108.1628684481927; Wed, 11 Aug 2021 05:21:21 -0700 (PDT) MIME-Version: 1.0 References: <20210809151946.27600-1-etienne.carriere@linaro.org> <20210809151946.27600-2-etienne.carriere@linaro.org> <005401d78e53$77bc0700$67341500$@byosoft.com.cn> In-Reply-To: From: "Ard Biesheuvel" Date: Wed, 11 Aug 2021 14:21:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: =?UTF-8?B?UmU6IFtlZGsyLWRldmVsXSDlm57lpI06IFtQQVRDSCB2NSAyLzVdIEFybVBrZzogcHJlcGFyZSAzMmJpdCBBUk0gYnVpbGQgb2YgU3RhbmRhbG9uZU1tUGtn?= To: Etienne Carriere Cc: edk2-devel-groups-io , "Liming Gao (Byosoft address)" , Sami Mujawar , Achin Gupta , Ard Biesheuvel , Jiewen Yao , Leif Lindholm , Sughosh Ganu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 11 Aug 2021 at 14:12, Etienne Carriere wrote: > > Many thanks to all for the help and patience. > My pleasure! > On Wed, 11 Aug 2021 at 13:37, Ard Biesheuvel wrote: > > > > On Wed, 11 Aug 2021 at 12:46, Ard Biesheuvel wrote: > > > > > > On Wed, 11 Aug 2021 at 03:52, gaoliming wr= ote: > > > > > > > > Etienne: > > > > Thanks for your update. This version should pass CI. > > > > > > > > Sami: > > > > Can you help review the updated patch? So, it can still catch thi= s stable > > > > tag. > > > > > > > > > > I will go ahead and review/submit it if you are ok with that. > > > > > > > Merged as #1894 > > > > Thanks all > > > > > > > > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Etienne Carriere > > > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B48=E6=9C=889=E6= =97=A5 23:20 > > > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > > > > =E6=8A=84=E9=80=81: Achin Gupta ; Ard Bieshe= uvel > > > > > ; Jiewen Yao ; L= eif > > > > > Lindholm ; Sami Mujawar = ; > > > > > Sughosh Ganu ; Liming Gao > > > > > ; Etienne Carriere > > > > > =E4=B8=BB=E9=A2=98: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM buil= d of StandaloneMmPkg > > > > > > > > > > Changes in ArmPkg to prepare building StandaloneMm firmware for > > > > > 32bit Arm architectures. > > > > > > > > > > Adds ArmmmuStandaloneMmLib library to the list of the standard > > > > > components build for ArmPkg on when ARM architectures. > > > > > > > > > > Changes path of source file AArch64/ArmMmuStandaloneMmLib.c > > > > > and compile it for both 32bit and 64bit architectures. > > > > > > > > > > Signed-off-by: Etienne Carriere > > > > > --- > > > > > Changes since v4: > > > > > - Remove changes related to MmCommunicationDxe and ArmMmuPeiLib > > > > > since > > > > > they currently don't need to be built for ARM targets. > > > > > - Remove review tags applied to patch v3. > > > > > > > > > > Changes since v3: > > > > > - Remove Cc tags and apply review tag. > > > > > > > > > > No change since v2 > > > > > No change since v1 > > > > > --- > > > > > ArmPkg/ArmPkg.dec > > > > > | 2 +- > > > > > ArmPkg/ArmPkg.dsc > > > > > | 2 ++ > > > > > ArmPkg/Library/StandaloneMmMmuLib/{AArch64 > > > > > =3D> }/ArmMmuStandaloneMmLib.c | 15 ++++++++------- > > > > > ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > | 6 +++--- > > > > > 4 files changed, 14 insertions(+), 11 deletions(-) > > > > > > > > > > diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec > > > > > index 214b2f5892..6ed51edd03 100644 > > > > > --- a/ArmPkg/ArmPkg.dec > > > > > +++ b/ArmPkg/ArmPkg.dec > > > > > @@ -137,7 +137,7 @@ > > > > > # hardware coherency (i.e., no virtualization or cache coheren= t DMA) > > > > > > > > > > gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOO > > > > > LEAN|0x00000043 > > > > > > > > > > -[PcdsFeatureFlag.AARCH64] > > > > > +[PcdsFeatureFlag.AARCH64, PcdsFeatureFlag.ARM] > > > > > ## Used to select method for requesting services from S-EL1.
> > > > > # TRUE - Selects FF-A calls for communication between S-EL0= and > > > > > SPMC.
> > > > > # FALSE - Selects SVC calls for communication between S-EL0 = and > > > > > SPMC.
> > > > > diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc > > > > > index 926986cf7f..8abe3713c8 100644 > > > > > --- a/ArmPkg/ArmPkg.dsc > > > > > +++ b/ArmPkg/ArmPkg.dsc > > > > > @@ -161,4 +161,6 @@ > > > > > [Components.AARCH64] > > > > > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf > > > > > ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf > > > > > + > > > > > +[Components.AARCH64, Components.ARM] > > > > > ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > diff --git > > > > > a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMm > > > > > Lib.c b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c > > > > > similarity index 92% > > > > > rename from > > > > > ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib > > > > > .c > > > > > rename to > > > > > ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c > > > > > index dd014beec8..20f873e680 100644 > > > > > --- > > > > > a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMm > > > > > Lib.c > > > > > +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c > > > > > @@ -2,6 +2,7 @@ > > > > > File managing the MMU for ARMv8 architecture in S-EL0 > > > > > > > > > > Copyright (c) 2017 - 2021, Arm Limited. All rights reserved. > > > > > + Copyright (c) 2021, Linaro Limited > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > @par Reference(s): > > > > > @@ -62,7 +63,7 @@ SendMemoryPermissionRequest ( > > > > > // for other Direct Request calls which are not atomic > > > > > // We therefore check only for Direct Response by the > > > > > // callee. > > > > > - if (SvcArgs->Arg0 =3D=3D > > > > > ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64) { > > > > > + if (SvcArgs->Arg0 =3D=3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP= ) { > > > > > // A Direct Response means FF-A success > > > > > // Now check the payload for errors > > > > > // The callee sends back the return value > > > > > @@ -164,13 +165,13 @@ GetMemoryPermissions ( > > > > > ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); > > > > > if (FeaturePcdGet (PcdFfaEnable)) { > > > > > // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. > > > > > - SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; > > > > > + SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; > > > > > SvcArgs.Arg1 =3D ARM_FFA_DESTINATION_ENDPOINT_ID; > > > > > SvcArgs.Arg2 =3D 0; > > > > > - SvcArgs.Arg3 =3D ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64; > > > > > + SvcArgs.Arg3 =3D ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES; > > > > > SvcArgs.Arg4 =3D BaseAddress; > > > > > } else { > > > > > - SvcArgs.Arg0 =3D ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64; > > > > > + SvcArgs.Arg0 =3D ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES; > > > > > SvcArgs.Arg1 =3D BaseAddress; > > > > > SvcArgs.Arg2 =3D 0; > > > > > SvcArgs.Arg3 =3D 0; > > > > > @@ -219,15 +220,15 @@ RequestMemoryPermissionChange ( > > > > > ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); > > > > > if (FeaturePcdGet (PcdFfaEnable)) { > > > > > // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. > > > > > - SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; > > > > > + SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; > > > > > SvcArgs.Arg1 =3D ARM_FFA_DESTINATION_ENDPOINT_ID; > > > > > SvcArgs.Arg2 =3D 0; > > > > > - SvcArgs.Arg3 =3D ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64; > > > > > + SvcArgs.Arg3 =3D ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES; > > > > > SvcArgs.Arg4 =3D BaseAddress; > > > > > SvcArgs.Arg5 =3D EFI_SIZE_TO_PAGES (Length); > > > > > SvcArgs.Arg6 =3D Permissions; > > > > > } else { > > > > > - SvcArgs.Arg0 =3D ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64; > > > > > + SvcArgs.Arg0 =3D ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES; > > > > > SvcArgs.Arg1 =3D BaseAddress; > > > > > SvcArgs.Arg2 =3D EFI_SIZE_TO_PAGES (Length); > > > > > SvcArgs.Arg3 =3D Permissions; > > > > > diff --git > > > > > a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > index 6c71fe0023..ff20e58980 100644 > > > > > --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > +++ > > > > > b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > > > > @@ -16,14 +16,14 @@ > > > > > LIBRARY_CLASS =3D StandaloneMmMmuLib > > > > > PI_SPECIFICATION_VERSION =3D 0x00010032 > > > > > > > > > > -[Sources.AARCH64] > > > > > - AArch64/ArmMmuStandaloneMmLib.c > > > > > +[Sources] > > > > > + ArmMmuStandaloneMmLib.c > > > > > > > > > > [Packages] > > > > > ArmPkg/ArmPkg.dec > > > > > MdePkg/MdePkg.dec > > > > > > > > > > -[FeaturePcd.AARCH64] > > > > > +[FeaturePcd.ARM, FeaturePcd.AARCH64] > > > > > gArmTokenSpaceGuid.PcdFfaEnable > > > > > > > > > > [LibraryClasses] > > > > > -- > > > > > 2.17.1 > > > > > > > > > > > > > > > > > > > > > > > >=20 > > > > > > > >