From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::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 61E692035A7AB for ; Thu, 16 Nov 2017 08:52:21 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id 4so23444500wrt.0 for ; Thu, 16 Nov 2017 08:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=qzsHWeLjdDa82SwjtaIl3Kt22dMOPXfqxX1tCHy3+MY=; b=HsvnzmZ9mo4NMwjkGIz8/ZksTlfaAP62gDCY7PAhI7nkgUHgc7YnDwRLiIZu+u0yMm rMGmp2HgcQbgfSBF6+NEFLTMPnPmrlhb2pFBmogMMdOJNQJHG4cM2DxuXq2LzU3cxLYh CzEu8aUGB5x8PwPdD98dBOnQzxpMrwXThEn2o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qzsHWeLjdDa82SwjtaIl3Kt22dMOPXfqxX1tCHy3+MY=; b=Y2p9CGL50gD/3BtmSAUaywcGZiVFeiHnfEhkoXdp7qNcGJRB3kqiX0lj/Gvw40BQf8 ciL2yXmAc+AfYmGYVxXnZ+mGgqKlMW690AMaEJURFb5tVHkdEbKty8SZLDzMIfswVThy AgNkjcnU35wWGY41G3BFZYlig/myzmcRRgXGOc+1HPVjgyJTSndq46YD63cNF7wnLFCC uBu7RSKgV29cdac9ducjPmHCl381Y63cfIOcYX0PtNkr8WcG91N+jAkp9NkyZcqDZCku LpDrAA3qv51vJl/UIqUmyay9jl/ZAK8pQdtFwEg9zs0bElcSUmfNfR+gGliTKsQ0g6J6 ydEA== X-Gm-Message-State: AJaThX6hyllJYLEeko9a7AExC6ZpORAuCE5rwF4JfwqX2NiL9sDKwm9F lYPTA0E9ESdWoT4I+jlIrDCobkUBmXk= X-Google-Smtp-Source: AGs4zMaedMvoe27XNPyTYPY/hy3Q5lXh2yWUI/5RlNbCsmy5aTzfJJD9SNYkz7v9Wq4K3MFoEynVyQ== X-Received: by 10.223.138.182 with SMTP id y51mr2164433wry.273.1510851389420; Thu, 16 Nov 2017 08:56:29 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id e71sm3033925wma.13.2017.11.16.08.56.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 08:56:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, lersek@redhat.com, julien.grall@arm.com Cc: Ard Biesheuvel Date: Thu, 16 Nov 2017 16:56:20 +0000 Message-Id: <20171116165620.30523-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [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 16:52:21 -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 --- 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