From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6AE2421B00DC1 for ; Thu, 16 Nov 2017 09:14:39 -0800 (PST) Received: by mail-it0-x244.google.com with SMTP id y15so867575ita.4 for ; Thu, 16 Nov 2017 09:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7SI/0sYQrRB1zBP54Fer5DH4+5GFhksoGfnu+aNNQm0=; b=MavJiJoBnNv0VDFrAq2JCQyOn89vyeQtyHcCdQl/Rmfdtl2AcABj2BQdNT91YLNj4+ aogRWY4WSIMvasy4nEd83BFG/thgi71dlGjyhUCcUYJoMqi8UlRC9lV8ndlYt3f3T2D1 KfJ1v15+/ERMkAa9ZxHuDCe848LJINM+W9Bic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7SI/0sYQrRB1zBP54Fer5DH4+5GFhksoGfnu+aNNQm0=; b=D/waWB8yZHxij1FX+0v5/gLlVZtrMDU8Vv/yWeLJrZ6MLNNljXNDx396DSb1wiNXcU ffwy2esrnHea590pigdD+uFdhWiv1FhSY3Lt6EuOB6Fd3ZhyRnqYtgnXYlAT4lRE8kkF oiAOxKV36Q3++RIz45lPrH7FQPpYm/4aP/GATzH34BA2mXuMSRdtRAmmFXQs/ksIKGT+ Pf3tDeqhGojkMPPESRdOyj/lRSRG4ed0b1tkdPrFr/0eVsHeLhIn6okIluvYuXCnbrBc gQkBCL5BmhxkUkdKjVWnU9ZkgYbt+cbBXuEYm6eYAc36xojcFABmO9RVq+R5EV/xSFl4 B7qQ== X-Gm-Message-State: AJaThX7gQ5arbNkBu6oX/C32sdz82aZdPbvj9kYHy+d1ppo2ODdy9Uou KGEQXpXjdLB0zhxVcn6BfgA28lZ46RXNbjHPDEV0y8sb X-Google-Smtp-Source: AGs4zMZSD+B77XvcAzHqlkg++SEg0QIbRH/RRh5Jz6NHWJAeDw85wimvExJKLh3EByTQEHLvRihDhg1Ufy875vMRWLE= X-Received: by 10.36.210.198 with SMTP id z189mr2995582itf.65.1510852728364; Thu, 16 Nov 2017 09:18:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.3 with HTTP; Thu, 16 Nov 2017 09:18:47 -0800 (PST) In-Reply-To: <20171116165620.30523-1-ard.biesheuvel@linaro.org> References: <20171116165620.30523-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Thu, 16 Nov 2017 17:18:47 +0000 Message-ID: To: "edk2-devel@lists.01.org" , Leif Lindholm , Laszlo Ersek , Julien Grall Cc: Ard Biesheuvel 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 17:14:39 -0000 Content-Type: text/plain; charset="UTF-8" Forward to Julien at his @linaro.org address. ---------- Forwarded message ---------- From: Ard Biesheuvel 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 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 -- 2.11.0