public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmPkg: move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib
@ 2017-11-16 14:35 Ard Biesheuvel
  2017-11-16 15:44 ` Leif Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 14:35 UTC (permalink / raw)
  To: edk2-devel, leif.lindholm; +Cc: lersek, Ard Biesheuvel

Currently, each ARM platform built with RVCT that uses ArmHvcLib
or ArmSmcLib needs to specify a CPU target that implements both the
security and virtualization extensions, so that the assembler does
not choke on the 'hvc' and 'smc' instructions in ArmHvcLib/ArmSvcLib.
Let's move these overrides into the module .INFs so we can lift this
requirement at the platform side.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/ArmPkg.dsc                      | 2 --
 ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf | 3 +++
 ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 382e99868453..622720ab2aef 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -33,8 +33,6 @@ [Defines]
 [BuildOptions]
   XCODE:*_*_ARM_PLATFORM_FLAGS  == -arch armv7
   GCC:*_*_ARM_PLATFORM_FLAGS    == -march=armv7-a -mfpu=neon
-  # We use A15 to get the Secure and Virtualization extensions
-  RVCT:*_*_ARM_PLATFORM_FLAGS  == --cpu Cortex-A15
 
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
   *_*_*_CC_FLAGS  = -DDISABLE_NEW_DEPRECATED_INTERFACES
diff --git a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
index 92efac5741c8..d046ef3ba253 100644
--- a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
+++ b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
@@ -30,3 +30,6 @@ [Sources.AARCH64]
 [Packages]
   MdePkg/MdePkg.dec
   ArmPkg/ArmPkg.dec
+
+[BuildOptions]
+  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
index 9f9ba729967c..0aa64d467129 100644
--- a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
+++ b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
@@ -29,3 +29,6 @@ [Sources.AARCH64]
 [Packages]
   MdePkg/MdePkg.dec
   ArmPkg/ArmPkg.dec
+
+[BuildOptions]
+  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
-- 
2.11.0



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

* Re: [PATCH] ArmPkg: move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib
  2017-11-16 14:35 [PATCH] ArmPkg: move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib Ard Biesheuvel
@ 2017-11-16 15:44 ` Leif Lindholm
  2017-11-16 16:03   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2017-11-16 15:44 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel, lersek

On Thu, Nov 16, 2017 at 02:35:46PM +0000, Ard Biesheuvel wrote:
> Currently, each ARM platform built with RVCT that uses ArmHvcLib
> or ArmSmcLib needs to specify a CPU target that implements both the
> security and virtualization extensions, so that the assembler does
> not choke on the 'hvc' and 'smc' instructions in ArmHvcLib/ArmSvcLib.
> Let's move these overrides into the module .INFs so we can lift this
> requirement at the platform side.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/ArmPkg.dsc                      | 2 --
>  ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf | 3 +++
>  ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf | 3 +++
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> index 382e99868453..622720ab2aef 100644
> --- a/ArmPkg/ArmPkg.dsc
> +++ b/ArmPkg/ArmPkg.dsc
> @@ -33,8 +33,6 @@ [Defines]
>  [BuildOptions]
>    XCODE:*_*_ARM_PLATFORM_FLAGS  == -arch armv7
>    GCC:*_*_ARM_PLATFORM_FLAGS    == -march=armv7-a -mfpu=neon
> -  # We use A15 to get the Secure and Virtualization extensions
> -  RVCT:*_*_ARM_PLATFORM_FLAGS  == --cpu Cortex-A15
>  
>    RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
>    *_*_*_CC_FLAGS  = -DDISABLE_NEW_DEPRECATED_INTERFACES
> diff --git a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
> index 92efac5741c8..d046ef3ba253 100644
> --- a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
> +++ b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
> @@ -30,3 +30,6 @@ [Sources.AARCH64]
>  [Packages]
>    MdePkg/MdePkg.dec
>    ArmPkg/ArmPkg.dec
> +
> +[BuildOptions]
> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
> diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
> index 9f9ba729967c..0aa64d467129 100644
> --- a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
> +++ b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
> @@ -29,3 +29,6 @@ [Sources.AARCH64]
>  [Packages]
>    MdePkg/MdePkg.dec
>    ArmPkg/ArmPkg.dec
> +
> +[BuildOptions]
> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15

For this one, you should be able to get away with --cpu 7-A.security
rather than listing a random CPU that happens to implement the
required extension.

This on the surface minor cleanup makes me unreasonably happy - thanks.
So if you can fold that in:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

For whatever reason, a --cpu 7-A.virtualization never seems to have
been implemented...

/
    Leif


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

* Re: [PATCH] ArmPkg: move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib
  2017-11-16 15:44 ` Leif Lindholm
@ 2017-11-16 16:03   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 16:03 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel@lists.01.org, Laszlo Ersek

On 16 November 2017 at 15:44, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Nov 16, 2017 at 02:35:46PM +0000, Ard Biesheuvel wrote:
>> Currently, each ARM platform built with RVCT that uses ArmHvcLib
>> or ArmSmcLib needs to specify a CPU target that implements both the
>> security and virtualization extensions, so that the assembler does
>> not choke on the 'hvc' and 'smc' instructions in ArmHvcLib/ArmSvcLib.
>> Let's move these overrides into the module .INFs so we can lift this
>> requirement at the platform side.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  ArmPkg/ArmPkg.dsc                      | 2 --
>>  ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf | 3 +++
>>  ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf | 3 +++
>>  3 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
>> index 382e99868453..622720ab2aef 100644
>> --- a/ArmPkg/ArmPkg.dsc
>> +++ b/ArmPkg/ArmPkg.dsc
>> @@ -33,8 +33,6 @@ [Defines]
>>  [BuildOptions]
>>    XCODE:*_*_ARM_PLATFORM_FLAGS  == -arch armv7
>>    GCC:*_*_ARM_PLATFORM_FLAGS    == -march=armv7-a -mfpu=neon
>> -  # We use A15 to get the Secure and Virtualization extensions
>> -  RVCT:*_*_ARM_PLATFORM_FLAGS  == --cpu Cortex-A15
>>
>>    RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
>>    *_*_*_CC_FLAGS  = -DDISABLE_NEW_DEPRECATED_INTERFACES
>> diff --git a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
>> index 92efac5741c8..d046ef3ba253 100644
>> --- a/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
>> +++ b/ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
>> @@ -30,3 +30,6 @@ [Sources.AARCH64]
>>  [Packages]
>>    MdePkg/MdePkg.dec
>>    ArmPkg/ArmPkg.dec
>> +
>> +[BuildOptions]
>> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
>> diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
>> index 9f9ba729967c..0aa64d467129 100644
>> --- a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
>> +++ b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
>> @@ -29,3 +29,6 @@ [Sources.AARCH64]
>>  [Packages]
>>    MdePkg/MdePkg.dec
>>    ArmPkg/ArmPkg.dec
>> +
>> +[BuildOptions]
>> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
>
> For this one, you should be able to get away with --cpu 7-A.security
> rather than listing a random CPU that happens to implement the
> required extension.
>
> This on the surface minor cleanup makes me unreasonably happy - thanks.
> So if you can fold that in:
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
> For whatever reason, a --cpu 7-A.virtualization never seems to have
> been implemented...
>

Thanks

Pushed as 302e8eda3b2f848e54bd21d0a8b2e5d8b891bffd


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

end of thread, other threads:[~2017-11-16 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16 14:35 [PATCH] ArmPkg: move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib Ard Biesheuvel
2017-11-16 15:44 ` Leif Lindholm
2017-11-16 16:03   ` Ard Biesheuvel

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