public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: devel@edk2.groups.io
Subject: Re: [PATCH 2/2] ArmPlatformPkg/PrePeiCore: enable VFP at startup
Date: Tue, 14 Jan 2020 17:33:45 +0000	[thread overview]
Message-ID: <20200114173345.GC20629@bivouac.eciton.net> (raw)
In-Reply-To: <20200107092215.3271-3-ard.biesheuvel@linaro.org>

On Tue, Jan 07, 2020 at 10:22:15 +0100, Ard Biesheuvel wrote:
> While the alternative PEI-less SEC implementation in PrePi already
> takes the EnableVFP PCD into account, the PrePeiCore code does not,
> and so we may end up triggering synchronous exception when code
> attempts to use FP or SIMD registers, which is permitted by the spec.

If you insert "on AARCH64" in an appropriate place in the above line:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> 
> So enable the VFP as early as feasible.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  | 1 +
>  ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 1 +
>  ArmPlatformPkg/PrePeiCore/PrePeiCore.c          | 5 +++++
>  3 files changed, 7 insertions(+)
> 
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> index f2ac45d171bc..104c7da53317 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> @@ -62,6 +62,7 @@ [FeaturePcd]
>  [FixedPcd]
>    gArmTokenSpaceGuid.PcdFvBaseAddress
>    gArmTokenSpaceGuid.PcdFvSize
> +  gArmTokenSpaceGuid.PcdVFPEnabled
>  
>    gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
>    gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> index 84c319c3679b..ceb173d34f5d 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> @@ -60,6 +60,7 @@ [FeaturePcd]
>  [FixedPcd]
>    gArmTokenSpaceGuid.PcdFvBaseAddress
>    gArmTokenSpaceGuid.PcdFvSize
> +  gArmTokenSpaceGuid.PcdVFPEnabled
>  
>    gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
>    gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> index 4911f67577a2..4f691d62cf3b 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> @@ -77,6 +77,11 @@ CEntryPoint (
>    ASSERT (((UINTN)PeiVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);
>    ArmWriteVBar ((UINTN)PeiVectorTable);
>  
> +  // Enable Floating Point
> +  if (FixedPcdGet32 (PcdVFPEnabled)) {
> +    ArmEnableVFP ();
> +  }
> +
>    //Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.
>  
>    // If not primary Jump to Secondary Main
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-01-14 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  9:22 [PATCH 0/2] some ARM fixes Ard Biesheuvel
2020-01-07  9:22 ` [PATCH 1/2] ArmPkg/ArmSmcPsciResetSystemLib: remove EnterS3WithImmediateWake () Ard Biesheuvel
2020-01-14 17:18   ` Leif Lindholm
2020-01-14 17:42     ` Ard Biesheuvel
2020-01-07  9:22 ` [PATCH 2/2] ArmPlatformPkg/PrePeiCore: enable VFP at startup Ard Biesheuvel
2020-01-14 17:33   ` Leif Lindholm [this message]
2020-01-14 16:43 ` [PATCH 0/2] some ARM fixes Ard Biesheuvel
2020-01-14 22:15   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200114173345.GC20629@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox