From patchwork Tue Aug 20 10:03:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13769837 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 E754DC531DF for ; Tue, 20 Aug 2024 10:16:01 +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=kBvcgymZy1HjuEnLdSv4C+tpXsBq86gUgAxVYxGbzXY=; b=YK19VdkGMTFL6tWJbBQCKSKUjv vjKHqtvs4SKsM1YlA9oTbUIQAi8pNRSxxIbeet4eDJOTt7wbF7n+/z+uGvxzuiSA+Eus0PZI/OOaC KvWMr0LP4b7ZyuNaJpFJKB0xdC45CgZcdECidOV7G90Z2Zg8vCihllSd/FZpYDcYNDq+L1RygQOrN JiZuGc9TKCMsRt3W35IeigGma/m6WngEahh9L4YA1+gCSnpqcpn+M9untrfjjOkQylgZpWHgg0aXO Fr2hj0fPz5axRswaeJjDpqLnwH0RMKsbN1Mfc5SES0WhITnTSPp/rnTUcchZ0SwqPiAotpf7tZj6g qBO/PfAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLu5-00000004l9d-0AXL; Tue, 20 Aug 2024 10:15:53 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLks-00000004iN6-0XV4 for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Aug 2024 10:06:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=kBvcgymZy1HjuEnLdSv4C+tpXsBq86gUgAxVYxGbzXY=; b=nKZMgt2rHGx4UC7iI1uAUlALYu 4Mw5PH79+3tSkNrf2fU3x9NUSmsu+BhHl7uCP1NSbp7NNOKZjjLnWlUxswmiZO9T04UE8EmShpUmv g0CVNcqFwf1dD/jTj2Maar62hNyoLAeNjIzYitSocJG0MB2S2OsiY4zN5Ib6aKh9sfs5iKOX64bOD LO+Jl/ke1iSy+M+pVSWyApRBjBx+lfgkecvCfZQi1iEEepNdMz97wnAGE2BXn4xWoFUZp4jD1Xs1r BP9DStfAHidhJ13INJ/f/ssNxIrkoWCOn4q6Wh4CE/DlLhqTR/M2Ja2ad+S2l7/x59PSDR3pV1sVj PzHLYpng==; Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLko-00000009JIT-1P4m for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 10:06:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 455C560DF8; Tue, 20 Aug 2024 10:06:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13B08C4AF10; Tue, 20 Aug 2024 10:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724148374; bh=qHwFNQ8dKApmlAFsslahYxWMFTOJcOgUzm2R88iPdFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxODEaQflJmqd5mLJ9uPBiR6V7mTn4FtVUMWalpsJ3wmpwOSI4MOUBiOdX/N8CRx6 0DWmaHFucUXg7GaRZxpCUpyeuGshSlLTGb9sfVilsxArXa8PVhTl27q0TQQi29svGH 38rTJPF3sDl2s5yoH5NYFF21XdI6DeKsssQHOrTx4E66JMYxjRO4mMVRYuleJpwh4a EraJYY4hzwW1sFCb4Q+SmEMPe404MTakZ4H2HDdPr/XeDxoIPivPRV9wrLabmnic2F H/JoD0UDK0bhIzNQRlr1C/jXHcAOkLHxGOlXdkGVlxAT+vD4LnMA8xzYJGHWn5B1NW q2dFkQifTWeiw== 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 1sgLki-005Dk2-B6; Tue, 20 Aug 2024 11:06:12 +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 07/12] KVM: arm64: Add ICH_HCR_EL2 to the vcpu state Date: Tue, 20 Aug 2024 11:03:44 +0100 Message-Id: <20240820100349.3544850-8-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240820100349.3544850-1-maz@kernel.org> References: <20240820100349.3544850-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-20240820_110618_610776_7DCC2DA2 X-CRM114-Status: GOOD ( 10.64 ) 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 7d00d7e359e1..c14fea3abc1b 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),