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 33146C4453A for ; Wed, 22 Jul 2026 09:27:56 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6rLVzkqTuW28t7Xy9m/mIBHPwAtbjdw7U4wk3FR9O6k=; b=FVVe7mK33OmprDXnTaBNzPWMI7 jjokoaS0S4WmwIrnHBsky7xgU+i/XrCe181m+BhPD+X7fuZDYMtHp+d7eTUvHJ/blxF1GTiKkYVJ5 o2b7MsQuQZ4c/0J8eyDkCRsSMfnYZgGZYZqvysrNohSr9fk54uQTxDKUgkT0k0fTBeTpIsoqxIxBT vC4RgxWnxlvDrWXaeawW112RPi69966KtVfGdP+f88EXVlFwndK4gCcMyPmjo475DwBeSvr6IXe4X bJt/vYCS2IpB3/ReG+jDi9VsSOkdHlkobe2+Q3AC8vv2gV2+XWyWD77r6XvjCXsQmmN/XqFr1kJk0 BySUy1AA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmTF0-0000000BPYn-0DQf; Wed, 22 Jul 2026 09:27:50 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wmTEx-0000000BPXU-03nk for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2026 09:27:47 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2E2F960A64; Wed, 22 Jul 2026 09:27:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0FBD1F00A3D; Wed, 22 Jul 2026 09:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784712465; bh=6rLVzkqTuW28t7Xy9m/mIBHPwAtbjdw7U4wk3FR9O6k=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=ZZczb7cn7HWVcnCRKvotdCu8jCxT5XRWclLr0CTpVX2vqxYJotLelHnBInvGbuYP4 38tMLNHh9vOkHbH+RCCdv/6HEs+z6BI7Wsi93/rJ1BPpLD3s1Y3fludTpcm9P865J/ G0fSCBA4k1Bzjt26QEF2Js2+5+/uRn6vyvRU6/H9HiSWH1VtXgammSHDRerwf4dHaZ rwacLypcErpw0SC3/bdLCvcN6ykJiluhx71sSi7lao2M/vAXIXbjQ5b5MwZVmhfpk5 63AQDo5Cc/eIp+f52I1Gb1FvPmf4BcY+5p/PIoelAI2IflNMiUdQoqJjyV4dcYm8U4 E6xTMm+Vu0k5A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) 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 1wmTEt-00000007YqG-2ptG; Wed, 22 Jul 2026 09:27:43 +0000 Date: Wed, 22 Jul 2026 10:27:43 +0100 Message-ID: <86cxwfe5m8.wl-maz@kernel.org> From: Marc Zyngier To: Kohei Enju Cc: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun , "Aneesh Kumar K . V" , Emi Kisanuki , Vishal Annapurve , WeiLin.Chang@arm.com, Lorenzo Pieralisi Subject: Re: [PATCH v15 12/37] KVM: arm64: CCA: Support the VGIC in realms In-Reply-To: References: <20260715142841.80544-1-steven.price@arm.com> <20260715142841.80544-13-steven.price@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: enju.kohei@fujitsu.com, steven.price@arm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, joey.gouly@arm.com, alexandru.elisei@arm.com, christoffer.dall@arm.com, tabba@google.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, gshan@redhat.com, sdonthineni@nvidia.com, alpergun@google.com, aneesh.kumar@kernel.org, fj0570is@fujitsu.com, vannapurve@google.com, WeiLin.Chang@arm.com, lpieralisi@kernel.org 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 On Wed, 22 Jul 2026 09:27:29 +0100, Kohei Enju wrote: > > On 07/15 15:28, Steven Price wrote: > > The RMM provides emulation of a VGIC to the realm guest. With RMM v2.0 > > the registers are passed in the system registers so this works similar > > to a normal guest, but kvm_arch_vcpu_put() need reordering to early out, > > and realm guests don't support GICv2 even if the host does. > > > > Signed-off-by: Steven Price > > Hi Steven, > > I've been testing this series and found that when the host CPU doesn't have > ARM64_HAS_ICH_HCR_EL2_TDIR this series doesn't work as expected. What modern CPU doesn't support TDIR? The only CPUs I know of that are stuck in this mode are old ARMv8.0 CPUs, and anything else was fixed. > > Since commit 2a28810cbb8b ("KVM: arm64: GICv3: Detect and work around the lack > of ICV_DIR_EL1 trapping"), when the host CPU doesn't support this feature, KVM > traps all GIC sysreg accesses in the common group. However, currently trap > handlers for ICC_{PMR,RPR,CTLR}_EL1 registers are missing [0]. So when Realm > guests try to access those registers, KVM traps them but just emits the warning > shown in [1], and Realm guests fail to boot. This isn't missing. This is handled by the early emulation in vgic-v3-sr.c, which of course CCA completely bypasses. Too bad. > > As far as I can tell, the CCA requirements don't require the > ARM64_HAS_ICH_HCR_EL2_TDIR feature. If that's the case, this seems to be a > problem. Is there any workaround for this issue, or should we implement trap > handlers for those registers? No. Either you support TDIR, like any modern CPU, or you don't run CCA. I'm not adding yet another level of emulation for this. Thanks, M. -- Without deviation from the norm, progress is not possible.