Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp619045yba; Wed, 24 Apr 2019 07:00:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0L604uX/rdrzjtzTdMrHwjqYb1sb7UyoDrwqyPxWEOUGPxQjqaXoLJ4temBAjpjqzXC5d X-Received: by 2002:a17:902:e485:: with SMTP id cj5mr6253679plb.280.1556114452833; Wed, 24 Apr 2019 07:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556114452; cv=none; d=google.com; s=arc-20160816; b=pwlYU48W7U9qf5/NjcvKm8gPqUhUveO+DoC5puA1cHLR8Ql50EnrO6b6rrJeD+hytm 5B/VfLIwKg980cR9SQYmUEYP17H/zA+P75HIKZ0zXmGl9YnL+V7xw2nPKlsDGM992AdK huwkbVerQnN2NmctlVgZJ19qwdooliCdCHmC7x4HUO7Nle3Fq4Nb0dHTjqlyAyZpJQTb LIcYxnnO1US/2iRjjWYPcXQzWix6KqSTQOlqJVEE1y3+S6q7pbdlAFWyexOJTYRzn6JS k0dB0g2mDP6Jn+uDsp4JhMDGpylle7dSvzbpS9awoZh+IAfKKn9w0mHiZtM5tyCzvkfc GjrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=R6Z7ycwsWtPoT08sAK8qYdORBXgpPkMOAbHRmcRxA6g=; b=CSDIZr0bappPoJTfDd5LNZPBdmU+J42u1/rlnS+SfSNNcrI3WyPik3bGMhdrMn2kUQ 9BJ2JKzI8pmbfdhbpMwLpMBW8Qk4RWgWwN3skAQYZnVFPGFg4R4Ly7XJ4zY9XVrquipN fm/L80324qwxSZVOvrK60GuVIBj125FzbI1hXA05YmXl4V7pzjLg2ZPVFUuZSI8gX0ov SW818LJuL+Qigokf+aRzi41fQkCsF0ErxOykWlEU1vldmzHilOFmUW+x2/rT3e1hC/Pj 8f/+SLk01KuLCZxm6WuChTNQEzqmwxX+d/2En5ucBiobenuVmtfdIlHiQKY00rSLB+O2 eRBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cj5si12961010plb.76.2019.04.24.07.00.37; Wed, 24 Apr 2019 07:00:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730554AbfDXNm1 (ORCPT + 99 others); Wed, 24 Apr 2019 09:42:27 -0400 Received: from foss.arm.com ([217.140.101.70]:43768 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727112AbfDXNm1 (ORCPT ); Wed, 24 Apr 2019 09:42:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C28315A2; Wed, 24 Apr 2019 06:42:26 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C10653F238; Wed, 24 Apr 2019 06:42:24 -0700 (PDT) Date: Wed, 24 Apr 2019 14:42:22 +0100 From: Dave Martin To: Amit Daniel Kachhap Cc: Marc Zyngier , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Kristina Martsenko , Ramana Radhakrishnan , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v10 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest Message-ID: <20190424134221.GX3567@e103592.cambridge.arm.com> References: <1555994558-26349-1-git-send-email-amit.kachhap@arm.com> <1555994558-26349-2-git-send-email-amit.kachhap@arm.com> <20190423154419.GL3567@e103592.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 11:27:50AM +0530, Amit Daniel Kachhap wrote: > Hi, > > On 4/23/19 9:14 PM, Dave Martin wrote: > >On Tue, Apr 23, 2019 at 10:12:34AM +0530, Amit Daniel Kachhap wrote: > >>A per vcpu flag is added to check if pointer authentication is > >>enabled for the vcpu or not. This flag may be enabled according to > >>the necessary user policies and host capabilities. > >> > >>This patch also adds a helper to check the flag. > >> > >>Reviewed-by: Dave Martin > >>Signed-off-by: Amit Daniel Kachhap > >>Cc: Mark Rutland > >>Cc: Marc Zyngier > >>Cc: Christoffer Dall > >>Cc: kvmarm@lists.cs.columbia.edu > >>--- > >>Changes since v9: > >> > >>* Added ptrauth cpufeature static check in vcpu_has_ptrauth [Marc Zyngier]. > >> > >> arch/arm64/include/asm/kvm_host.h | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >>diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > >>index 7a096fd..7ccac42 100644 > >>--- a/arch/arm64/include/asm/kvm_host.h > >>+++ b/arch/arm64/include/asm/kvm_host.h > >>@@ -355,10 +355,15 @@ struct kvm_vcpu_arch { > >> #define KVM_ARM64_HOST_SVE_ENABLED (1 << 4) /* SVE enabled for EL0 */ > >> #define KVM_ARM64_GUEST_HAS_SVE (1 << 5) /* SVE exposed to guest */ > >> #define KVM_ARM64_VCPU_SVE_FINALIZED (1 << 6) /* SVE config completed */ > >>+#define KVM_ARM64_GUEST_HAS_PTRAUTH (1 << 7) /* PTRAUTH exposed to guest */ > >> #define vcpu_has_sve(vcpu) (system_supports_sve() && \ > >> ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_SVE)) > >>+#define vcpu_has_ptrauth(vcpu) ((system_supports_address_auth() || \ > >>+ system_supports_generic_auth()) && \ > > > >Come to think of it, should this be > >system_supports_address_auth() _&&_ system_supports_generic_auth()? > I thought about it and kept it this way so that the implementation > limitation is not introduced in this patch but only in a single place in the > 3rd patch where all the documentation and reasoning is present on doing this > way. OK, I think that's reasonable. Just wanted to check that I wasn't missing some subtle issue here. Cheers ---Dave