From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH 21/27] arm64/sve: KVM: Prevent guests from using SVE Date: Wed, 16 Aug 2017 12:22:47 +0100 Message-ID: <98593c20-12f6-c738-cd92-c94804941b36@arm.com> References: <1502280338-23002-1-git-send-email-Dave.Martin@arm.com> <1502280338-23002-22-git-send-email-Dave.Martin@arm.com> <0f5b14a8-4d04-61e4-05e8-92cd55c8bee9@arm.com> <20170816105013.GZ6321@e103592.cambridge.arm.com> <3cb51836-9677-5eb5-cc07-361eee674806@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751196AbdHPLWv (ORCPT ); Wed, 16 Aug 2017 07:22:51 -0400 In-Reply-To: <3cb51836-9677-5eb5-cc07-361eee674806@arm.com> Content-Language: en-GB Sender: linux-arch-owner@vger.kernel.org List-ID: To: Dave Martin , g@e103592.cambridge.arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, Ard Biesheuvel , Szabolcs Nagy , Catalin Marinas , Will Deacon , Richard Sandiford , kvmarm@lists.cs.columbia.edu, Christoffer Dall On 16/08/17 12:20, Marc Zyngier wrote: > On 16/08/17 11:50, Dave Martin wrote: >> On Tue, Aug 15, 2017 at 05:33:15PM +0100, Marc Zyngier wrote: >>> On 09/08/17 13:05, Dave Martin wrote: >>>> Until KVM has full SVE support, guests must not be allowed to >>>> execute SVE instructions. >>>> >>>> This patch enables the necessary traps, and also ensures that the >>>> traps are disabled again on exit from the guest so that the host >>>> can still use SVE if it wants to. >>>> >>>> Signed-off-by: Dave Martin >>>> --- >>>> arch/arm64/include/asm/kvm_arm.h | 3 ++- >>>> arch/arm64/kvm/hyp/switch.c | 6 +++--- >>>> 2 files changed, 5 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h >>>> index dbf0537..8a19651 100644 >>>> --- a/arch/arm64/include/asm/kvm_arm.h >>>> +++ b/arch/arm64/include/asm/kvm_arm.h >>>> @@ -186,7 +186,7 @@ >>>> #define CPTR_EL2_TTA (1 << 20) >>>> #define CPTR_EL2_TFP (1 << CPTR_EL2_TFP_SHIFT) >>>> #define CPTR_EL2_TZ (1 << 8) >>>> -#define CPTR_EL2_DEFAULT 0x000033ff >>>> +#define CPTR_EL2_DEFAULT (0x000033ff & ~CPTR_EL2_TZ) >>> >>> I must say I'm not overly fond of this construct. I'd rather introduce a >>> RES1 field that matches the v8.2 description, instead of this ugly >>> constant and something that clears it. >> >> Sorry, I don't get your meaning here. v8.2 neither immediately predates >> or postdates SVE. > > The ARMv8 ARM (DDI406B_a, D7.2.19) says otherwise. This bit is only Of course, the days of the ARMv7 ARM are still haunting me. This should read DDI487B_a. Apologies for the confusion. M. -- Jazz is not dead. It just smells funny...