From patchwork Tue Aug 27 15:25:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13779705 Return-Path: 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 79CA2C54731 for ; Tue, 27 Aug 2024 15:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uuUV28f5icaURVSzlgdxqTg0eLdIWfNVe+c3TdDh704=; b=QGfp8zFCzB/OKG4XTfU/4MQn5f niq+wwiWeR/sJylmZDetOqP6qJXsAnYhbCLa5qsXp3nMx23X4j3Y/4gnBn6Iuc/u9+rGfeia3ej+3 TWfwdLp1yNK2B0QY5J1LMyxObPOMvKKdo3JtdgVI9DW9eVjA2fRjteEiukS8fmGcgEUXiL068uLWM wx93PyFUmt8+4KVCayKDnTkg4OYEcCtG4qYCjZz7Pz6qnhPddEtqoziOu3LP2wdiVpAvsVtmSzj2S Dsv6kKhupERNf8FCSi17XOrt4UzUQcFLWdPGYOoTNsFFB3H5N6iZS3TrQ5i7808tKyqj6PIwj9DkQ oTkOkBIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siy6z-0000000BsNt-1aWt; Tue, 27 Aug 2024 15:28:01 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siy4Z-0000000BrWu-1u9A for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 15:25:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B8673A41D34; Tue, 27 Aug 2024 15:25:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C29DC4DDEE; Tue, 27 Aug 2024 15:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724772330; bh=n+uSX4gg1kLlHGEZbM6hDJKdvB/dGQW4+8mseFDNQNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4WskvL7CcZMj0jaJmCy3G/hbUNQOsJrF3jSN+EWN9wJx3moZCIvLBZvR2uWwXigA yYnug44VWNl4Qen933NRgy48WPY5ti3OB68m5kpvy1lJmflxF+c/mJzkX8J0HP+BDH ym9v8VY5Kjlx6EAqEUKNh/LDfib3wGbGgSUCdFsaP1XNFhP8j+k38LADk2T2O/nQaB zciW8s20sfTYtNj6WK0eM2hKKs0JVSMtO4ar5yDKITvci1LPcYPr2DY1CXCBaFTt/D xqjij0VCsUkJtRYJXie0luH9yi5b47NglXGlhb9ZVYQBblHEUJ6La67D/jodW/2TVA F0fLBBSjr4h9A== 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 ) id 1siy4W-007HOs-I4; Tue, 27 Aug 2024 16:25:28 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Alexander Potapenko Subject: [PATCH v2 06/11] KVM: arm64: Add ICH_HCR_EL2 to the vcpu state Date: Tue, 27 Aug 2024 16:25:12 +0100 Message-Id: <20240827152517.3909653-7-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240827152517.3909653-1-maz@kernel.org> References: <20240827152517.3909653-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, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, glider@google.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-20240827_082531_585971_368BBF0D X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As we are about to describe the trap routing for ICH_HCR_EL2, add the register to the vcpu state in its VNCR form, as well as reset Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 2 ++ arch/arm64/kvm/sys_regs.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index a33f5996ca9f..16cd59362b3d 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -530,6 +530,8 @@ enum vcpu_sysreg { VNCR(CNTP_CVAL_EL0), VNCR(CNTP_CTL_EL0), + VNCR(ICH_HCR_EL2), + NR_SYS_REGS /* Nothing after this line! */ }; diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index e9d8e916e3af..a57374de6968 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2797,6 +2797,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { EL2_REG(RVBAR_EL2, access_rw, reset_val, 0), { SYS_DESC(SYS_RMR_EL2), trap_undef }, + EL2_REG_VNCR(ICH_HCR_EL2, reset_val, 0), + EL2_REG(CONTEXTIDR_EL2, access_rw, reset_val, 0), EL2_REG(TPIDR_EL2, access_rw, reset_val, 0),