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::243; helo=mail-it0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 6E9C720356886 for ; Fri, 17 Nov 2017 02:01:51 -0800 (PST) Received: by mail-it0-x243.google.com with SMTP id y15so3451505ita.4 for ; Fri, 17 Nov 2017 02:06:01 -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=0U0KO0S+argTvRro+z/1IoUV1x2XVq0cX/A5sjULq+s=; b=HDZgc9zuFqJOlJoNc1dGJ7KaCpjFluv4cXmvag57Aoy0x7SmsguBnCClYaGwl6CnWk 9RFVkkPDaxTdnakmtHOswxxEz3MVa9DxmfgMUvrMc7rXIHq+2uCdfYUXiEFohCZ0kS84 1mNz9c74UyYKNOg3WBKJBIu0Qm4Vrao6OFA9c= 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=0U0KO0S+argTvRro+z/1IoUV1x2XVq0cX/A5sjULq+s=; b=dKtFA6AobyWvIwPtDctHszMHbs5DdkQR+GMEFHwqicg/ByGBqJnarJvRZIgdmUWrPb zJcg3xoZAoltIaxJzEgugfSQ7RZmlXshpLM6b8Qmob8K7nJ6xn0ZNZIoSnRBhmZmAiO6 r4TFtsjX+fEQJI/+6RdugrK9ePT5ijIYr44hZsJjHqFDwG9zmuY+guq4u38iXFkIGTH4 mAYsNKVVV2KcLUnyA1w8rrEK0zjxV5CqPkLEnr1U1BGz4vKhk/wCBGlVzcDVdf1Mn9xj +sX+zPx/poUfPGTjA3+JoPXXGASXPFrgObvxffNGhKYIXU6Su3TvIilTnbFSShDfa2ww WKtw== X-Gm-Message-State: AJaThX6Tf0ziU5cWMrsZoLNOcsfVlTLtTeaLP3XXh0+hD2il+yagYPhM KoG4UVHMIlnxcI8K6q79b7+otT9fYoPeWpcihhJ3Eg== X-Google-Smtp-Source: AGs4zMb59COB0MvydK3OnlJGMfCqKWTU+I/+htWmkQLjm16785942DwjqFfk7KW16wPYc5tFHTbNUd8hRYAlJjV2drk= X-Received: by 10.36.145.203 with SMTP id i194mr5951111ite.73.1510913160977; Fri, 17 Nov 2017 02:06:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.3 with HTTP; Fri, 17 Nov 2017 02:06:00 -0800 (PST) In-Reply-To: <04b93643-9ba5-b6df-a5c7-20bda35bbd2f@redhat.com> References: <20171116165620.30523-1-ard.biesheuvel@linaro.org> <04b93643-9ba5-b6df-a5c7-20bda35bbd2f@redhat.com> From: Ard Biesheuvel Date: Fri, 17 Nov 2017 10:06:00 +0000 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Julien Grall 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: Fri, 17 Nov 2017 10:01:51 -0000 Content-Type: text/plain; charset="UTF-8" On 16 November 2017 at 21:42, Laszlo Ersek wrote: > 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 > Pushed as 12c6484058a8c5a8751c51eb24e9bb95497649c6