public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* 回复: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg
  2021-08-09 15:19 ` [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Etienne Carriere
@ 2021-08-11  1:51   ` gaoliming
  0 siblings, 0 replies; 2+ messages in thread
From: gaoliming @ 2021-08-11  1:51 UTC (permalink / raw)
  To: 'Etienne Carriere', devel, 'Sami Mujawar'
  Cc: 'Achin Gupta', 'Ard Biesheuvel',
	'Jiewen Yao', 'Leif Lindholm',
	'Sughosh Ganu'

Etienne:
  Thanks for your update. This version should pass CI. 

Sami:
  Can you help review the updated patch? So, it can still catch this stable
tag.

Thanks
Liming
> -----邮件原件-----
> 发件人: Etienne Carriere <etienne.carriere@linaro.org>
> 发送时间: 2021年8月9日 23:20
> 收件人: devel@edk2.groups.io
> 抄送: Achin Gupta <achin.gupta@arm.com>; Ard Biesheuvel
> <ardb+tianocore@kernel.org>; Jiewen Yao <jiewen.yao@intel.com>; Leif
> Lindholm <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>;
> Sughosh Ganu <sughosh.ganu@linaro.org>; Liming Gao
> <gaoliming@byosoft.com.cn>; Etienne Carriere <etienne.carriere@linaro.org>
> 主题: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build 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 <etienne.carriere@linaro.org>
> ---
> 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
> => }/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 coherent DMA)
> 
> gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOO
> LEAN|0x00000043
> 
> -[PcdsFeatureFlag.AARCH64]
> +[PcdsFeatureFlag.AARCH64, PcdsFeatureFlag.ARM]
>    ## Used to select method for requesting services from S-EL1.<BR><BR>
>    #   TRUE  - Selects FF-A calls for communication between S-EL0 and
> SPMC.<BR>
>    #   FALSE - Selects SVC calls for communication between S-EL0 and
> SPMC.<BR>
> 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.<BR>
> +  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 ==
> ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64) {
> +    if (SvcArgs->Arg0 == 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 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
> +    SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ;
>      SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID;
>      SvcArgs.Arg2 = 0;
> -    SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64;
> +    SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES;
>      SvcArgs.Arg4 = BaseAddress;
>    } else {
> -    SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64;
> +    SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES;
>      SvcArgs.Arg1 = BaseAddress;
>      SvcArgs.Arg2 = 0;
>      SvcArgs.Arg3 = 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 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
> +    SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ;
>      SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID;
>      SvcArgs.Arg2 = 0;
> -    SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64;
> +    SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES;
>      SvcArgs.Arg4 = BaseAddress;
>      SvcArgs.Arg5 = EFI_SIZE_TO_PAGES (Length);
>      SvcArgs.Arg6 = Permissions;
>    } else {
> -    SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64;
> +    SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES;
>      SvcArgs.Arg1 = BaseAddress;
>      SvcArgs.Arg2 = EFI_SIZE_TO_PAGES (Length);
>      SvcArgs.Arg3 = 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                  = StandaloneMmMmuLib
>    PI_SPECIFICATION_VERSION       = 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 回复: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg
@ 2021-08-16  9:44 Sami Mujawar
  0 siblings, 0 replies; 2+ messages in thread
From: Sami Mujawar @ 2021-08-16  9:44 UTC (permalink / raw)
  To: gaoliming, 'Etienne Carriere', devel@edk2.groups.io
  Cc: Achin Gupta, 'Ard Biesheuvel', 'Jiewen Yao',
	'Leif Lindholm', 'Sughosh Ganu', nd

Hi Liming,

Apologies, I was on vacation last week.

Hi Ard,
Thank you for taking care of this.

Regards,

Sami Mujawar

On 11/08/2021, 02:52, "gaoliming" <gaoliming@byosoft.com.cn> wrote:

    Etienne:
      Thanks for your update. This version should pass CI. 

    Sami:
      Can you help review the updated patch? So, it can still catch this stable
    tag.

    Thanks
    Liming
    > -----邮件原件-----
    > 发件人: Etienne Carriere <etienne.carriere@linaro.org>
    > 发送时间: 2021年8月9日 23:20
    > 收件人: devel@edk2.groups.io
    > 抄送: Achin Gupta <achin.gupta@arm.com>; Ard Biesheuvel
    > <ardb+tianocore@kernel.org>; Jiewen Yao <jiewen.yao@intel.com>; Leif
    > Lindholm <leif@nuviainc.com>; Sami Mujawar <sami.mujawar@arm.com>;
    > Sughosh Ganu <sughosh.ganu@linaro.org>; Liming Gao
    > <gaoliming@byosoft.com.cn>; Etienne Carriere <etienne.carriere@linaro.org>
    > 主题: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build 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 <etienne.carriere@linaro.org>
    > ---
    > 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
    > => }/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 coherent DMA)
    > 
    > gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOO
    > LEAN|0x00000043
    > 
    > -[PcdsFeatureFlag.AARCH64]
    > +[PcdsFeatureFlag.AARCH64, PcdsFeatureFlag.ARM]
    >    ## Used to select method for requesting services from S-EL1.<BR><BR>
    >    #   TRUE  - Selects FF-A calls for communication between S-EL0 and
    > SPMC.<BR>
    >    #   FALSE - Selects SVC calls for communication between S-EL0 and
    > SPMC.<BR>
    > 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.<BR>
    > +  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 ==
    > ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64) {
    > +    if (SvcArgs->Arg0 == 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 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
    > +    SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ;
    >      SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID;
    >      SvcArgs.Arg2 = 0;
    > -    SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64;
    > +    SvcArgs.Arg3 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES;
    >      SvcArgs.Arg4 = BaseAddress;
    >    } else {
    > -    SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64;
    > +    SvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES;
    >      SvcArgs.Arg1 = BaseAddress;
    >      SvcArgs.Arg2 = 0;
    >      SvcArgs.Arg3 = 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 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
    > +    SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ;
    >      SvcArgs.Arg1 = ARM_FFA_DESTINATION_ENDPOINT_ID;
    >      SvcArgs.Arg2 = 0;
    > -    SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64;
    > +    SvcArgs.Arg3 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES;
    >      SvcArgs.Arg4 = BaseAddress;
    >      SvcArgs.Arg5 = EFI_SIZE_TO_PAGES (Length);
    >      SvcArgs.Arg6 = Permissions;
    >    } else {
    > -    SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64;
    > +    SvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES;
    >      SvcArgs.Arg1 = BaseAddress;
    >      SvcArgs.Arg2 = EFI_SIZE_TO_PAGES (Length);
    >      SvcArgs.Arg3 = 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                  = StandaloneMmMmuLib
    >    PI_SPECIFICATION_VERSION       = 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-16  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-16  9:44 回复: [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Sami Mujawar
  -- strict thread matches above, loose matches on Subject: below --
2021-08-09 15:19 [PATCH v5 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A, Mm SVC and Std SMC IDs Etienne Carriere
2021-08-09 15:19 ` [PATCH v5 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Etienne Carriere
2021-08-11  1:51   ` 回复: " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox