]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/XenHypercallLib: enable virt extensions for ARM
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 16 Nov 2017 16:51:49 +0000 (16:51 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 17 Nov 2017 09:56:50 +0000 (09:56 +0000)
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>
Acked-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S
OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf

index c12c8658b72902212cf4b73860d39632fe920662..0adf65840a2f8fac217352115794ab9725ea0b97 100644 (file)
@@ -16,6 +16,8 @@
 #include <IndustryStandard/Xen/arch-arm/xen.h>\r
 \r
   .text\r
+  .arch_extension virt\r
+\r
 GCC_ASM_EXPORT(XenHypercall2)\r
 \r
 ASM_PFX(XenHypercall2):\r
index f4503a4b01f4450b73311c049a7ebcde0d5036a4..d268e540feca3f833b1a8c7cc7992e7f54b92d79 100644 (file)
@@ -64,3 +64,6 @@
 \r
 [Guids.IA32, Guids.X64]\r
   gEfiXenInfoGuid\r
+\r
+[BuildOptions.ARM]\r
+  RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15\r