public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	 Laszlo Ersek <lersek@redhat.com>,
	Julien Grall <julien.grall@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM
Date: Thu, 16 Nov 2017 17:18:47 +0000	[thread overview]
Message-ID: <CAKv+Gu_i15=xQXwsL_26OHKB+uLEK7XKB0FfhbYCPyEvBL2R7Q@mail.gmail.com> (raw)
In-Reply-To: <20171116165620.30523-1-ard.biesheuvel@linaro.org>

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


  reply	other threads:[~2017-11-16 17:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 16:56 [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM Ard Biesheuvel
2017-11-16 17:18 ` Ard Biesheuvel [this message]
2017-11-16 21:42 ` Laszlo Ersek
2017-11-17 10:06   ` 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='CAKv+Gu_i15=xQXwsL_26OHKB+uLEK7XKB0FfhbYCPyEvBL2R7Q@mail.gmail.com' \
    --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