From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F3FE606A32C for ; Fri, 4 Dec 2026 09:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2CTwKfw7; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=Q0XsRTtX 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:Date:Subject:Cc:To:From:Message-ID:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=DR/DxtbqCus0gYKIO5We5fmRmav7zE9BxfOQMqCC7Wo=; b=2CTwKfw7Irb1e4cTvWmWgpS7Hn gdVuwMC+G8I7qUr8EsE6jPijwsnTFrwumo0IG9sza7xkgzORiUH3VJa7fIcJVFM/0uj79KbTDAMA4 lFLMdKvA87oe0N7VZuL3k5SvSa0Jhpu7yy0gVR/WeOx72nYSsNt7EaOVTYHLl5BPcYgKxiOB3fLZc UiMLDKJHlhatsUGHk5KGiXkojR64ZNP2dQqh2oJBKu2b1HPYLcdfDupjG9qA9lex1ALtrMe4zrIFg QDctP+kqf3EZxFa58kluc/4XnxaKHn71v2SdPytMUNM5OtJhgSiBPvJYm+auh/MFZW2QvQL5EEH9d VqSe1Wgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZPLx-0000000HJKT-4BVr; Fri, 04 Dec 2026 09:13:18 +0000 Received: from out203-205-221-236.mail.qq.com ([203.205.221.236]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZPLp-0000000HJIS-0xM4 for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 09:13:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1796375582; bh=DR/DxtbqCus0gYKIO5We5fmRmav7zE9BxfOQMqCC7Wo=; h=From:To:Cc:Subject:Date; b=Q0XsRTtX0UNTdv27KaHbcvU7usOH5rfPyFEbNvBnG4ICVdjy+6pEEeihu1kvBp0R/ 23nOFxsRttlebcSTXOalRUvF00xwJNxCOzCI2TcL5hh7B7MMw8PiHwAgvZJgR7U31a cn2Lch8ExEAL/jGfTS7cld3HA+LXhQYe2pGwoZIc= Received: from localhost.localdomain ([116.128.244.169]) by newxmesmtplogicsvrszc43-0.qq.com (NewEsmtp) with SMTP id 3302723C; Fri, 04 Dec 2026 17:12:48 +0800 X-QQ-mid: xmsmtpt1796375568t8vwrgowh Message-ID: X-QQ-XMAILINFO: M1rD3f8svNznPy46ZabQig9DP+BDlUu50JMQxw3f4u7tP+SmjJvnxrlBKsKtz/ WsW9pVoHBP1qvUGQKuHolRwJKLrUSCwfGygfW/NmomCAh8OuD2Q0vBF9197TZflhgR/lIMg5p3fZ TXnbaQsJmbVKHElgfed1dSJDt+15digFOEJpQLYoRIK7bIi6Te/Bs14Kz+1PvOt+tjluH+2D9L7/ IkDXrp/liub8uOktNpAGAZKoF1S1IK8wGpccUVpL6N1YVkIJhlpIjdZNhxdQ6aKVRhPnFuOs2C+o wNWQyFumoLCjXHu4E3lcDEsWIydGATzdQ6imNXvvgbaDDEwmaEM2Pz0qulPfeclnemalc1aQysk7 Kfy+8KN9AIuuU79EB5KM83Q+Ew9caZ+e8tEtjee1eYJxXYcOwQFSu/7ps3epqTyaYEQ1AWH3UikP QTwDdBuii48H+tGZvsEXL2Cxr1scRw6gdRwDCOH3/mcQFbfSWfOIOexVtMzn6YqrffCMpxyfHrN8 kn9U6uW3qCr0Y1UAIfSTitK/pcwA3YCvHJ8OMCLbh7hJja++N1QY17TMZKOYtkE8Oa7tuixLVJn/ SZU72/iB4YnBoXi4xUDnMhS8rDxDWFNxxObXBABknw533qC6R0tPQqGsQJPkcM9m92dfXvzigjHt i1rdgwfV6YiLwnzL5Ct8DwQ0EQFhePU8FkFwzZbDyeGUa0HydZyjJZEZRPTYKBor7/M64TVrtemy AWba46qJJO6aGXBLkzuFWS6b6KKojzvjDPBYCg7mh5HSKmRIU6/gdz+Zt/iskNSrxQ0Lfgq2mSXO 2azWWusWglqrLViQLrEtCFgFb+4KwFqt2walPyjcZ3vBrE08CBvA6oEXfZAk9UG4fqLDZO1ZBS7C secj4Nhcz5276IdL+aEEpFmAgUH0ZkcPwggXWAwuLDjq3bbyHfqNsvBK9yCVpD68zcBeU+gplpXB DBWG13J/r1lxeYeICHBko38OdaVrXpYoauxHUMw+L/3vjT0UQFHkBDa6xUK/l9ubga3cqTC2ZPoM v+U1GMmwKNyD9DNoz2InZnbdg6JtGnnyBxpsnmHrxeruoxmQ3R5Py516dH0sNJHkSF6LAJoQ== X-QQ-XMRINFO: NI4Ajvh11aEjEMj13RCX7UuhPEoou2bs1g== From: Minhang Zhang To: Marc Zyngier , Oliver Upton Cc: Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Cornelia Huck , Christoffer Dall , Dongjiu Geng , James Morse , Ben Horgan , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Minhang Zhang Subject: [PATCH 0/2] KVM: arm64: Fix RAS trapping and MTE_frac validation Date: Fri, 4 Dec 2026 17:12:23 +0800 X-OQ-MSGID: <20261204091225.775137-1-sesame_h@qq.com> X-Mailer: git-send-email 2.25.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_011309_597940_523D773D X-CRM114-Status: UNSURE ( 8.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Minhang Zhang This series fixes two independent issues in arm64 KVM. Patch 1 enables trapping of RAS error record accesses whenever the host's sanitised ID registers report RAS, including when CONFIG_ARM64_RAS_EXTN is disabled. Update both the host and hyp HCR initialisation paths so that this also applies in protected mode, where hyp rebuilds HCR_EL2. This keeps guest accesses under KVM's emulation, including when userspace hides RAS from the guest. Patch 2 uses KVM's sanitised MTE field to decide whether to apply the MTE_frac compatibility rewrite. This avoids changing the zero MTE_frac reported for VMs where MTE is hidden, including nested virtualisation, while preserving compatibility with older KVM versions for MTE guests. The patches are independent. Build-checked arch/arm64/kvm/sys_regs.o and the nVHE aggregate object arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o with arm64 defconfig, CONFIG_KVM=y, and CONFIG_ARM64_RAS_EXTN both enabled and disabled, based on v7.4-rc5 (fe6ff8d5d675). No KVM runtime testing or hardware reproduction was performed for either issue. Minhang Zhang (2): KVM: arm64: Trap RAS error records whenever the host has RAS KVM: arm64: Only clamp MTE_frac when the VM has MTE arch/arm64/kvm/hyp/nvhe/pkvm.c | 8 +++++--- arch/arm64/kvm/sys_regs.c | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) -- 2.25.1