From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 030DEC10F11 for ; Wed, 24 Apr 2019 13:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3D5F218DA for ; Wed, 24 Apr 2019 13:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730558AbfDXNm1 (ORCPT ); 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF893C10F11 for ; Wed, 24 Apr 2019 13:42:31 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 436132089F for ; Wed, 24 Apr 2019 13:42:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 436132089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D077F4A48D; Wed, 24 Apr 2019 09:42:30 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id my+M3p+VhEyc; Wed, 24 Apr 2019 09:42:29 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AE2A24A46F; Wed, 24 Apr 2019 09:42:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 680554A46F for ; Wed, 24 Apr 2019 09:42:28 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f+4wPHXSnbCG for ; Wed, 24 Apr 2019 09:42:27 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 07D914A3B4 for ; Wed, 24 Apr 2019 09:42:27 -0400 (EDT) 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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 X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Message-ID: <20190424134222.QzoXxmfFrn_efbM_RHm3DBxU_6GQ8fmYScr8qMtJqfc@z> 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949EDC10F11 for ; Wed, 24 Apr 2019 13:42:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 641292089F for ; Wed, 24 Apr 2019 13:42:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dA4erVCB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 641292089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lEpZHVRNDHTZA7zlvYYjK2fg717eh0h3BE9KR08X7cI=; b=dA4erVCBdT18dR NALhREdPH3GubqGxRjUhB930GmaN8is3N05muW6aGw62SJdNHvgW3htZNV/iS9flUwn30hsckqQ0K OrIP70+bEl0Z2H57ORG2Kk27Nt8wYhEf+9Bxb2EqS0WcyKAMtSRxcS+rvGm21mRYwityBGfi3Pz4R NHn99ZR4D7usgbGn9VtSY4leuIb/0BrZGOriIp4AN0MuhsZqBKE3CRDJvaOrxTsX4I2vJp519xUzA tXWXwyf4pmRivcLua9zjgOagoRhkr4v5CpTvVcQPOg4ykxy8R43Kr9FtXomJ4a/9Rz9ArKfafsaVE GVGdtHznGP0QZdxSq6jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJIAQ-0002HO-9b; Wed, 24 Apr 2019 13:42:30 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJIAM-0002Gb-T3 for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 13:42:28 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_064226_938411_634CD60D X-CRM114-Status: GOOD ( 19.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel