From 12c6484058a8c5a8751c51eb24e9bb95497649c6 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 16 Nov 2017 16:51:49 +0000 Subject: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM 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 Acked-by: Laszlo Ersek --- 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 c12c8658b7..0adf65840a 100644 --- a/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S +++ b/OvmfPkg/Library/XenHypercallLib/Arm/Hypercall.S @@ -16,6 +16,8 @@ #include .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 f4503a4b01..d268e540fe 100644 --- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf +++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf @@ -64,3 +64,6 @@ [Guids.IA32, Guids.X64] gEfiXenInfoGuid + +[BuildOptions.ARM] + RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -- 2.39.2