Message ID | 20240219092014.783809-8-maz@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 31541C48260 for <linux-arm-kernel@archiver.kernel.org>; Mon, 19 Feb 2024 09:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a0qcyI4zE0OqjQDyVdzHlSc9zJ+eZU7hP0XB+FfGMGk=; b=pelDKuU9mg9mBB ICoujbIkJcxBTz0tW4domZtkIiZKordytw3Amh3FlpGYtGGYtzy8DY0U/Atp+iVWo63iZULy52vWP K5DcUZDjSmKBbL1KSaci7iaXT34a/7IhAscpH/Ub73OJ7nqdq4bNTiaST/eU2LxV+fididwupCW7c SfWAslryHfMwKv2w/MNjXqtgf6BUQrM7lPIBJY4OIsMvCiqIgXLYqhSdZ/TECXMFl476bgCtKvBAu V9tmBG2Nmj2x+G5GKhXgL0fS3xQkBpDVQrR12bvXu5gKn95anYnVpdMa8op65HDdAQwmzVs1fWFIw EYF9l+rrkn1gI7Z6TZYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbzpc-00000009mIK-1bWb; Mon, 19 Feb 2024 09:21:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbzp4-00000009lxi-3VJn for linux-arm-kernel@lists.infradead.org; Mon, 19 Feb 2024 09:20:28 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F1FF560C4A; Mon, 19 Feb 2024 09:20:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF517C433F1; Mon, 19 Feb 2024 09:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708334424; bh=4kAZSZwBw7KrpIGu7/Ra/W9TXJ5J7n34iChEeNy2XZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tL0BZ/FnfSxi9h9WPq2TR8n8MgilFmZVyGO/koI7YmnjPTAWdN9sBim2tF4cZ/Iq0 WACkUXskbbAS5TSP1NEnMfZA3JhUhMEw3RZjyUbXEDQOT7FWtmgeMYAXOwhkGwIlAL Tag+CRt2pbMJowxSAO7+5by7b/EbOL0OmVv8m4IpRAHoraOF9K0ToP3v9e0diGeMKO s9XaxTZUlqQ6o/JwgBZz0nvs5YCbemUeorVfmjt8lIR/26961Xe09AzSbTV8B85YC5 VZcaHUuqmMSMKwqye3yNQwKWBx5f3RliBs/yvq/Gwy2iI4RSf09MAwH3LOCalLOBCT t7E5dfaUydzjw== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <maz@kernel.org>) id 1rbzp0-004WBZ-Ot; Mon, 19 Feb 2024 09:20:22 +0000 From: Marc Zyngier <maz@kernel.org> To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Zenghui Yu <yuzenghui@huawei.com>, Will Deacon <will@kernel.org>, Catalin Marinas <catalin.marinas@arm.com> Subject: [PATCH 07/13] KVM: arm64: nv: Honor HFGITR_EL2.ERET being set Date: Mon, 19 Feb 2024 09:20:08 +0000 Message-Id: <20240219092014.783809-8-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219092014.783809-1-maz@kernel.org> References: <20240219092014.783809-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, will@kernel.org, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240219_012027_003604_5BC785CA X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM/arm64: Add NV support for ERET and PAuth
|
expand
|
diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 0c175516d114..a6c61d2ffc35 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -219,7 +219,8 @@ static bool kvm_hyp_handle_eret(struct kvm_vcpu *vcpu, u64 *exit_code) * Unless the trap has to be forwarded further down the line, * of course... */ - if (__vcpu_sys_reg(vcpu, HCR_EL2) & HCR_NV) + if ((__vcpu_sys_reg(vcpu, HCR_EL2) & HCR_NV) || + (__vcpu_sys_reg(vcpu, HFGITR_EL2) & HFGITR_EL2_ERET)) return false; spsr = read_sysreg_el1(SYS_SPSR);
If the L1 hypervisor decides to trap ERETs while running L2, make sure we don't try to emulate it, just like we wouldn't if it had its NV bit set. The exception will be reinjected from the core handler. Signed-off-by: Marc Zyngier <maz@kernel.org> --- arch/arm64/kvm/hyp/vhe/switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)