From mboxrd@z Thu Jan 1 00:00:00 1970 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 A0973D1D892 for ; Thu, 4 Dec 2025 09:48:42 +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=6k5OQFkjKRhDwo0iXNt1/546+974/zl6x7HWDQ5ZolU=; b=dby8G/eBSD6Ycxe4JQ55HgPjXB 62EhJN9X6TnHXI1fH3LTJpZ+fH8lznz5PjwRG4KQG0plE+QfVN1I3nqwAjWQJtHwf2sX2eXpfwLEK yxZSmL02FnRTQixCDAmrReR2NYU+PGnQlT+J3TbIyTKbzq5kPLCa0xnd1vHaKJt4s56kUZgy5ryfz VT3L/BNcuUCvTEyjfzzBzgbo0hrcqCqPgqoB4i0h8D67ufzJ39t5sjX1tVKXzFC8Ys3NXsAih6PqO t6IK1/haZvZB2Ebv9bjsYpD0wMHSo3uqU4uV4buBOc8yElmzcuG00skpv40kKsifERVESSabec8Jd ITp60+1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR5x0-00000007mqU-3xHq; Thu, 04 Dec 2025 09:48:38 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR5x0-00000007mp0-0zLw for linux-arm-kernel@lists.infradead.org; Thu, 04 Dec 2025 09:48:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C4EE6601E0; Thu, 4 Dec 2025 09:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 726F3C16AAE; Thu, 4 Dec 2025 09:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764841716; bh=lBM9O1xiYp3upt+sE8CBR/zZAFQ7xYSFnh/kkG4Fd4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mt3uTq4Z3eQXVCPXV2/ehrLJtZnB9aiRZFdoW4rNOprmtT35H1R2vXiVHakAjmMjO 7flF5tb0gcaKGv8xC165cGDsZqFP9eqiQ9GKUZ02IHSrdxEIN/8/PfsCWPCKlfbdDf SLZbBCdbXCfc0zkIWHbPEcWzmINHFeVWG5owVIycH1pmoHdnO3Lv2sJ22DH9fvgDRQ uhmUrL8Hj/4QfxpHDJjH8hC+a5vBqfCo7qOcFFQbG5fpC+bplZyYK5LkiciHqhSy0b RhKoD1NM07Y4CHrthr9ID5csnPpdec7gActD5TVKiwhLShW4BULMZphQamKkJGFClL thKqH5t6ad43w== 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.98.2) (envelope-from ) id 1vR5ww-0000000AP90-2bbb; Thu, 04 Dec 2025 09:48:34 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Ben Horgan , Yao Yuan Subject: [PATCH v3 2/9] KVM: arm64: Add trap routing for GMID_EL1 Date: Thu, 4 Dec 2025 09:47:59 +0000 Message-ID: <20251204094806.3846619-3-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204094806.3846619-1-maz@kernel.org> References: <20251204094806.3846619-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com, ben.horgan@arm.com, yaoyuan@linux.alibaba.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 HCR_EL2.TID5 is currently ignored by the trap routing infrastructure. Wire it in the routing table so that GMID_EL1, the sole register trapped by this bit, is correctly handled in the NV case. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/emulate-nested.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c index 834f13fb1fb7d..616eb6ad68701 100644 --- a/arch/arm64/kvm/emulate-nested.c +++ b/arch/arm64/kvm/emulate-nested.c @@ -70,6 +70,7 @@ enum cgt_group_id { CGT_HCR_ENSCXT, CGT_HCR_TTLBIS, CGT_HCR_TTLBOS, + CGT_HCR_TID5, CGT_MDCR_TPMCR, CGT_MDCR_TPM, @@ -308,6 +309,12 @@ static const struct trap_bits coarse_trap_bits[] = { .mask = HCR_TTLBOS, .behaviour = BEHAVE_FORWARD_RW, }, + [CGT_HCR_TID5] = { + .index = HCR_EL2, + .value = HCR_TID5, + .mask = HCR_TID5, + .behaviour = BEHAVE_FORWARD_RW, + }, [CGT_MDCR_TPMCR] = { .index = MDCR_EL2, .value = MDCR_EL2_TPMCR, @@ -665,6 +672,7 @@ static const struct encoding_to_trap_config encoding_to_cgt[] __initconst = { SR_TRAP(SYS_CCSIDR2_EL1, CGT_HCR_TID2_TID4), SR_TRAP(SYS_CLIDR_EL1, CGT_HCR_TID2_TID4), SR_TRAP(SYS_CSSELR_EL1, CGT_HCR_TID2_TID4), + SR_TRAP(SYS_GMID_EL1, CGT_HCR_TID5), SR_RANGE_TRAP(SYS_ID_PFR0_EL1, sys_reg(3, 0, 0, 7, 7), CGT_HCR_TID3), SR_TRAP(SYS_ICC_SGI0R_EL1, CGT_HCR_IMO_FMO_ICH_HCR_TC), -- 2.47.3