From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 69745220D4BE9 for ; Thu, 16 Nov 2017 13:38:31 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24828267E3; Thu, 16 Nov 2017 21:42:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-80.rdu2.redhat.com [10.10.120.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A07B46E62; Thu, 16 Nov 2017 21:42:39 +0000 (UTC) To: Ard Biesheuvel , edk2-devel@lists.01.org, leif.lindholm@linaro.org, julien.grall@arm.com References: <20171116165620.30523-1-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: <04b93643-9ba5-b6df-a5c7-20bda35bbd2f@redhat.com> Date: Thu, 16 Nov 2017 22:42:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171116165620.30523-1-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 16 Nov 2017 21:42:41 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg/XenHypercallLib: enable virt extensions for ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 21:38:32 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 > --- > 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 > > .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