Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6245yba; Thu, 11 Apr 2019 20:21:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxk010JJomzq1VyNeV8NFv49mMRApWAPZljwJYgIDr2wFvwAAH/k7uKAieZ7wRvqGXtGOdO X-Received: by 2002:a62:388d:: with SMTP id f135mr53872738pfa.103.1555039315060; Thu, 11 Apr 2019 20:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555039315; cv=none; d=google.com; s=arc-20160816; b=eJHZKGjTvMAg/k0srfdtR7+/u9wBYgFWv/VP2ZRk8+0L67H3PxFnjGGC9xRV9JpARS UsflF5GkjLMXIrG81Y1WHIGDqUnb0XMiCzf/gmev6AK9WzIELiCpv2kkOv+tpON+mzoV TAiAzquL9WDI7Zt43qAVeE4yK4gKXAR+l0y+ZjXyPFKSGpAEzOQaTlyPJBcNeuAor3S+ TyItLJfrhTY+Wy4G/e9GM6Oi6aJWKUoCOrr6SP3MJuHUumsyVy0fO6RBHU0kHbGTx0VR YaVqhuAf/RKGhsIwm27uHvTPaMw7lNtpuq0hjmUpmZ81yzDTHQQtMO5ftN7CDGXsz/Bs iL1A== 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=EikiCzPgas1unpp1u9uWx6jY8ZPG5syQnVgvhj+wzyc=; b=qabnoGn7XlxxwAyi0dEXvO1KKx4OlOPOO85/0Da0cZeZbR2THpCm/WJ0kfztpPfeQw xvw8WTVTYqBJPJUq2cZflfGHaZzkR63T66qPM32B9RLpEh59xKoeCmF2AsYqvdxEmS+M UU4LBqUtl73TML6ThdNHr9DgIovzLMksUrKjMI08HW2es4x5os2QqJFZdtoBMpY68Fk5 clI/5Xs8fBqF4i03RTa85w+XNkj+m8fhWQbd/3hL4HwMA26uERqMkuP82miiH+TVLzg0 twljzfcN9Qqh+GpYkl6LxgXKV4FBiAfyc6DfSI+auJz0qnJRYFcjfd2cr/JvV53flus9 wHnA== 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 b15si31437054pfb.231.2019.04.11.20.21.38; Thu, 11 Apr 2019 20:21:55 -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 S1726789AbfDLDU5 (ORCPT + 99 others); Thu, 11 Apr 2019 23:20:57 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52558 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfDLDU4 (ORCPT ); Thu, 11 Apr 2019 23:20:56 -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 7CD3D15AD; Thu, 11 Apr 2019 20:20:56 -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 40D1D3F59C; Thu, 11 Apr 2019 20:20:52 -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 v9 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest Date: Fri, 12 Apr 2019 08:50:32 +0530 Message-Id: <1555039236-10608-2-git-send-email-amit.kachhap@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555039236-10608-1-git-send-email-amit.kachhap@arm.com> References: <1555039236-10608-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 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. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvmarm@lists.cs.columbia.edu --- Changes since v8: * Added a new per vcpu flag which will store Pointer Authentication enable status instead of checking them again. [Dave Martin] arch/arm64/include/asm/kvm_host.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 9d57cf8..31dbc7c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -355,10 +355,14 @@ 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) \ + ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_PTRAUTH) + #define vcpu_gp_regs(v) (&(v)->arch.ctxt.gp_regs) /* -- 2.7.4