Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1161357img; Tue, 19 Mar 2019 01:33:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4VX0bKo5VIMRwwDG3oHVOR38vmknyeMthnyK9JOmQ65ir3nk0LZkS5JQqlUTBUhmaYpmP X-Received: by 2002:a63:2b82:: with SMTP id r124mr704832pgr.214.1552984402836; Tue, 19 Mar 2019 01:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552984402; cv=none; d=google.com; s=arc-20160816; b=EQVoXURS+vfhDxPfkGUhOOsJ1QGVG9fQnqW1vn+TTDrxWXietO+Jczh01tq7uwYFYk ECwMZCOn86MnRGrphdh0AVXE+Ty2drkXoH0MksN5GY1DXSzIriEoM/MR0iozcCR1rnHH rNhHlnhSCFjHXqlbxo0QcBh3olztDDxlXqVhkGoAmgIA/4bin160QnPQk39DJjJ8dJeI 20vx1uYSWyTMcOBgBoROaHBhMrYVJdFC2haAm1PUvEyn1/ziXJQFaSvc0u7hQR9w1kYK VwlWBMccAv5p6oax19FEaMXW3/o5e5XWj2QhgH8T77BzBE/lOzagrZPiCmsSD+cz3Bm1 C4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=sqKBCEJVEfjVTPqTGkyMUmWK/zT4l39ErNcZ3bf5H0k=; b=C+m7pMAb0mpzUkUSGULvDNEnf2nsRyPNrqTyEz9mPe8K2+Lp5JzCVUeYPCK5zznv4z PEZp2DF4CxELfk02ySSaZTPzIWSmle8klDgFkFV6ksE+5WfIwgXDJjjPfa/vdS/RSvEP sTNu5nrnpziRsugZ5pzxVrdexnEDCwWVKX+C810h+Zr7y4Ugt+vUl6atFE6q3u4H102T ceLsTgpBhdJKjq3KgkuYzlGuu/5G1yXyxiytK2Hc3VP11xmPo4BxvLo2/oBhLDDR+oTY fa2QcqXzkc1Xdlp/Y304pkHdxgvWdX4n2rohtmDbEdTkSG7eZwbHemTNsXqt+GP0rL6V Q1TA== 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 bi12si11215529plb.205.2019.03.19.01.33.07; Tue, 19 Mar 2019 01:33:22 -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 S1727707AbfCSIby (ORCPT + 99 others); Tue, 19 Mar 2019 04:31:54 -0400 Received: from foss.arm.com ([217.140.101.70]:47092 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfCSIbx (ORCPT ); Tue, 19 Mar 2019 04:31:53 -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 AF30619BF; Tue, 19 Mar 2019 01:31:52 -0700 (PDT) Received: from a075553-lin.blr.arm.com (a075553-lin.blr.arm.com [10.162.0.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 770C63F59C; Tue, 19 Mar 2019 01:31:48 -0700 (PDT) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org Cc: Christoffer Dall , Marc Zyngier , Catalin Marinas , Will Deacon , Andrew Jones , Dave Martin , Ramana Radhakrishnan , kvmarm@lists.cs.columbia.edu, Kristina Martsenko , linux-kernel@vger.kernel.org, Amit Daniel Kachhap , Mark Rutland , James Morse , Julien Thierry Subject: [PATCH v7 9/10] KVM: arm64: docs: document KVM support of pointer authentication Date: Tue, 19 Mar 2019 14:00:42 +0530 Message-Id: <1552984243-7689-10-git-send-email-amit.kachhap@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1552984243-7689-1-git-send-email-amit.kachhap@arm.com> References: <1552984243-7689-1-git-send-email-amit.kachhap@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds sections for KVM API extension for pointer authentication. A brief description about usage of pointer authentication for KVM guests is added in the arm64 documentations. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- Documentation/arm64/pointer-authentication.txt | 15 +++++++++++---- Documentation/virtual/kvm/api.txt | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Documentation/arm64/pointer-authentication.txt b/Documentation/arm64/pointer-authentication.txt index 5baca42..4b769e6 100644 --- a/Documentation/arm64/pointer-authentication.txt +++ b/Documentation/arm64/pointer-authentication.txt @@ -87,7 +87,14 @@ used to get and set the keys for a thread. Virtualization -------------- -Pointer authentication is not currently supported in KVM guests. KVM -will mask the feature bits from ID_AA64ISAR1_EL1, and attempted use of -the feature will result in an UNDEFINED exception being injected into -the guest. +Pointer authentication is enabled in KVM guest when each virtual cpu is +initialised by passing flags KVM_ARM_VCPU_PTRAUTH_[ADDRESS/GENERIC] and +requesting this feature to be enabled. Without this flag, pointer +authentication is not enabled in KVM guests and attempted use of the +feature will result in an UNDEFINED exception being injected into the +guest. + +Additionally, when these vcpu feature flags are not set then KVM will +filter out the Pointer Authentication system key registers from +KVM_GET/SET_REG_* ioctls and mask those features from cpufeature ID +register. diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 7de9eee..b5c66bc 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2659,6 +2659,12 @@ Possible features: Depends on KVM_CAP_ARM_PSCI_0_2. - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU. Depends on KVM_CAP_ARM_PMU_V3. + - KVM_ARM_VCPU_PTRAUTH_ADDRESS: + - KVM_ARM_VCPU_PTRAUTH_GENERIC: + Enables Pointer authentication for the CPU. + Depends on KVM_CAP_ARM_PTRAUTH and only on arm64 architecture. If + set, then the KVM guest allows the execution of pointer authentication + instructions. Otherwise, KVM treats these instructions as undefined. 4.83 KVM_ARM_PREFERRED_TARGET -- 2.7.4