Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1162014img; Tue, 19 Mar 2019 01:34:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+aEZc4oL8e13dB8jb1ceHpyoh9CCphuaLlNRzqdPqZdjVfqSlxqkvrJZJR1WC1qS/n9r9 X-Received: by 2002:aa7:8719:: with SMTP id b25mr849649pfo.90.1552984466034; Tue, 19 Mar 2019 01:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552984466; cv=none; d=google.com; s=arc-20160816; b=degIcLmaEuuzgT9EFJpeYqcbcBq9O5CgIOP1PZ9bFUISTYmqSrhm7kkha2/UIXRthL Q5alfMFyuxf6hgNU0Zt02qv6P5eqpYXxHhat9BIXOpMtAWSxNBpU4NInXHKeQnupGy8E TGse8BEddCfSskeljLQkI76vnluZb0X1LEycpeLwFDUSdPMESn9g9efxy2U1Yd0ztDbb QYj0uw+r/u7Na1ZPI1o+QDsnAr3RjnRQOYPUssoZCQQT7ng1lTn06bFNrDIyW9eIbspV +fZOvRGxSt9Ip+J7WkJZEfCIbMDqUCzEk2cXaFeZPcILDoTjJtcRozjMlrVK34hAHmbT 8h9g== 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=osQQt5UInz1dqoBqa+H17NcsQVhbEtGzgFyNfB7j1PE=; b=JnV1XaHcs0z1AgwbotZPFxqQf+097UcnOod+tf/MM+yxHMp7mAWdt63mDsEvwGsudp oTxasFgw+qDqzJzyftPTWZjeHMqvbTjNzneVYKKSvNr4GzE4ZwqevWpfib8dZGb11Ih+ xOGgUB8EXJEUHVe7qBn/u9ev+pha1jLx49aAr4qkYIQAAcqS6F9ilgK+IWmgxwHsaYkc P4SmKKZgA3gl+ovAEATwK7EygN/RW054j4QtvKjjpXwl4OljM47FxGciZlijsdP4Qs2a O+MRtrldHJyVrN3Y2a/XkLBiui8ArBUHZ/dmY+gGZ/08+jc0fIn0Q+c5NlPGzi2MMT+1 eH2g== 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 e125si10670271pgc.201.2019.03.19.01.34.11; Tue, 19 Mar 2019 01:34:26 -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 S1727692AbfCSIbt (ORCPT + 99 others); Tue, 19 Mar 2019 04:31:49 -0400 Received: from foss.arm.com ([217.140.101.70]:47070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfCSIbs (ORCPT ); Tue, 19 Mar 2019 04:31:48 -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 05050174E; Tue, 19 Mar 2019 01:31:48 -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 C142A3F59C; Tue, 19 Mar 2019 01:31:43 -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 8/10] KVM: arm64: Add capability to advertise ptrauth for guest Date: Tue, 19 Mar 2019 14:00:41 +0530 Message-Id: <1552984243-7689-9-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 patch advertises the capability of pointer authentication when system supports pointer authentication and VHE mode present. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvmarm@lists.cs.columbia.edu --- arch/arm64/kvm/reset.c | 4 ++++ include/uapi/linux/kvm.h | 1 + 2 files changed, 5 insertions(+) diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index 00f0639..a3b269e 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -92,6 +92,10 @@ int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_ARM_VM_IPA_SIZE: r = kvm_ipa_limit; break; + case KVM_CAP_ARM_PTRAUTH: + r = has_vhe() && system_supports_address_auth() && + system_supports_generic_auth(); + break; default: r = 0; } diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 6d4ea4b..a553477 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -988,6 +988,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_ARM_VM_IPA_SIZE 165 #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 #define KVM_CAP_HYPERV_CPUID 167 +#define KVM_CAP_ARM_PTRAUTH 168 #ifdef KVM_CAP_IRQ_ROUTING -- 2.7.4