public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
@ 2017-11-16 16:56 Ard Biesheuvel
  2017-11-16 17:18 ` Ard Biesheuvel
  2017-11-16 21:42 ` Laszlo Ersek
  0 siblings, 2 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 16:56 UTC (permalink / raw)
  To: edk2-devel, leif.lindholm, lersek, julien.grall; +Cc: Ard Biesheuvel

XenHypercallLib uses the 'hvc' instruction, which is not implemented
on all ARMv7 CPUs, and so we need to explicitly specify a CPU that
has the virtualization extensions.

This override used to be set at the platform level, but this was removed
in commit 0d36a219c7bdbb27d775b50837823b2a9928147c
('ArmPlatformPkg/PL031RealTimeClockLib: drop ArmPlatformSysConfigLib
reference), under the assumption that all users of the 'hvc' instruction
had already been fixed.

So fix this for GNU binutils by adding the 'virt' arch extension
directive, and for RVCT by setting the --cpu command line option to a
CPU that is virt capable.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S     | 2 ++
 OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
index c12c8658b729..0adf65840a2f 100644
--- a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
+++ b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
@@ -16,6 +16,8 @@
 #include <IndustryStandard/Xen/arch-arm/xen.h>
 
   .text
+  .arch_extension virt
+
 GCC_ASM_EXPORT(XenHypercall2)
 
 ASM_PFX(XenHypercall2):
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
index f4503a4b01f4..d268e540feca 100644
--- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
+++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
@@ -64,3 +64,6 @@ [LibraryClasses.IA32, LibraryClasses.X64]
 
 [Guids.IA32, Guids.X64]
   gEfiXenInfoGuid
+
+[BuildOptions.ARM]
+  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
-- 
2.11.0



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

* Re: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
  2017-11-16 16:56 [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM Ard Biesheuvel
@ 2017-11-16 17:18 ` Ard Biesheuvel
  2017-11-16 21:42 ` Laszlo Ersek
  1 sibling, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 17:18 UTC (permalink / raw)
  To: edk2-devel@lists.01.org, Leif Lindholm, Laszlo Ersek,
	Julien Grall
  Cc: Ard Biesheuvel

Forward to Julien at his @linaro.org address.



---------- Forwarded message ----------
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date: 16 November 2017 at 16:56
Subject: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
To: edk2-devel@lists.01.org, leif.lindholm@linaro.org,
lersek@redhat.com, julien.grall@arm.com
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>


XenHypercallLib uses the 'hvc' instruction, which is not implemented
on all ARMv7 CPUs, and so we need to explicitly specify a CPU that
has the virtualization extensions.

This override used to be set at the platform level, but this was removed
in commit 0d36a219c7bdbb27d775b50837823b2a9928147c
('ArmPlatformPkg/PL031RealTimeClockLib: drop ArmPlatformSysConfigLib
reference), under the assumption that all users of the 'hvc' instruction
had already been fixed.

So fix this for GNU binutils by adding the 'virt' arch extension
directive, and for RVCT by setting the --cpu command line option to a
CPU that is virt capable.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S     | 2 ++
 OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
index c12c8658b729..0adf65840a2f 100644
--- a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
+++ b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
@@ -16,6 +16,8 @@
 #include <IndustryStandard/Xen/arch-arm/xen.h>

   .text
+  .arch_extension virt
+
 GCC_ASM_EXPORT(XenHypercall2)

 ASM_PFX(XenHypercall2):
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
index f4503a4b01f4..d268e540feca 100644
--- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
+++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
@@ -64,3 +64,6 @@ [LibraryClasses.IA32, LibraryClasses.X64]

 [Guids.IA32, Guids.X64]
   gEfiXenInfoGuid
+
+[BuildOptions.ARM]
+  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
--
2.11.0


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

* Re: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
  2017-11-16 16:56 [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM Ard Biesheuvel
  2017-11-16 17:18 ` Ard Biesheuvel
@ 2017-11-16 21:42 ` Laszlo Ersek
  2017-11-17 10:06   ` Ard Biesheuvel
  1 sibling, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2017-11-16 21:42 UTC (permalink / raw)
  To: Ard Biesheuvel, edk2-devel, leif.lindholm, julien.grall

On 11/16/17 17:56, Ard Biesheuvel wrote:
> XenHypercallLib uses the 'hvc' instruction, which is not implemented
> on all ARMv7 CPUs, and so we need to explicitly specify a CPU that
> has the virtualization extensions.
> 
> This override used to be set at the platform level, but this was removed
> in commit 0d36a219c7bdbb27d775b50837823b2a9928147c
> ('ArmPlatformPkg/PL031RealTimeClockLib: drop ArmPlatformSysConfigLib
> reference), under the assumption that all users of the 'hvc' instruction
> had already been fixed.
> 
> So fix this for GNU binutils by adding the 'virt' arch extension
> directive, and for RVCT by setting the --cpu command line option to a
> CPU that is virt capable.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S     | 2 ++
>  OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
> index c12c8658b729..0adf65840a2f 100644
> --- a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
> +++ b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
> @@ -16,6 +16,8 @@
>  #include <IndustryStandard/Xen/arch-arm/xen.h>
>  
>    .text
> +  .arch_extension virt
> +
>  GCC_ASM_EXPORT(XenHypercall2)
>  
>  ASM_PFX(XenHypercall2):
> diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
> index f4503a4b01f4..d268e540feca 100644
> --- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
> +++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
> @@ -64,3 +64,6 @@ [LibraryClasses.IA32, LibraryClasses.X64]
>  
>  [Guids.IA32, Guids.X64]
>    gEfiXenInfoGuid
> +
> +[BuildOptions.ARM]
> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
> 

Acked-by: Laszlo Ersek <lersek@redhat.com>



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

* Re: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
  2017-11-16 21:42 ` Laszlo Ersek
@ 2017-11-17 10:06   ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-11-17 10:06 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: edk2-devel@lists.01.org, Leif Lindholm, Julien Grall

On 16 November 2017 at 21:42, Laszlo Ersek <lersek@redhat.com> wrote:
> On 11/16/17 17:56, Ard Biesheuvel wrote:
>> XenHypercallLib uses the 'hvc' instruction, which is not implemented
>> on all ARMv7 CPUs, and so we need to explicitly specify a CPU that
>> has the virtualization extensions.
>>
>> This override used to be set at the platform level, but this was removed
>> in commit 0d36a219c7bdbb27d775b50837823b2a9928147c
>> ('ArmPlatformPkg/PL031RealTimeClockLib: drop ArmPlatformSysConfigLib
>> reference), under the assumption that all users of the 'hvc' instruction
>> had already been fixed.
>>
>> So fix this for GNU binutils by adding the 'virt' arch extension
>> directive, and for RVCT by setting the --cpu command line option to a
>> CPU that is virt capable.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S     | 2 ++
>>  OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf | 3 +++
>>  2 files changed, 5 insertions(+)
>>
>> diff --git a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
>> index c12c8658b729..0adf65840a2f 100644
>> --- a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
>> +++ b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
>> @@ -16,6 +16,8 @@
>>  #include <IndustryStandard/Xen/arch-arm/xen.h>
>>
>>    .text
>> +  .arch_extension virt
>> +
>>  GCC_ASM_EXPORT(XenHypercall2)
>>
>>  ASM_PFX(XenHypercall2):
>> diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
>> index f4503a4b01f4..d268e540feca 100644
>> --- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
>> +++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
>> @@ -64,3 +64,6 @@ [LibraryClasses.IA32, LibraryClasses.X64]
>>
>>  [Guids.IA32, Guids.X64]
>>    gEfiXenInfoGuid
>> +
>> +[BuildOptions.ARM]
>> +  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15
>>
>
> Acked-by: Laszlo Ersek <lersek@redhat.com>
>

Pushed as 12c6484058a8c5a8751c51eb24e9bb95497649c6


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

end of thread, other threads:[~2017-11-17 10:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16 16:56 [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM Ard Biesheuvel
2017-11-16 17:18 ` Ard Biesheuvel
2017-11-16 21:42 ` Laszlo Ersek
2017-11-17 10:06   ` Ard Biesheuvel

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