From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C388540D565; Wed, 22 Jul 2026 09:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784712469; cv=none; b=Hzsp1PH17r5FIXEcT0F9WsYmlV9MZQLMG0Bv9+azdIr1Bf/JCoIp8XRdFTDP6zW1sgCnROVcLJkrz6HRVxIXk2pOOGD7y4AyfFBHRrVo9laz8M+1zgiWTK3bqJjaiEHUyeAMO/fqFTFoJUGzUeRUgNj8RNFq6GUvTquSNpsIdNk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784712469; c=relaxed/simple; bh=Mx7r2/SMwr97by1qxjSxW7aoIckxGANeAeNJ1Ot8gaE=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=JUKQ5FSDlvL9e5EdOnqtnVnD4lVHs+ECQySRc7aGtBzMi1oQYdw6sXVK3oc3BYkMHWI5r6Awo7IBfMtDy+GXpgDH0b/ptEdqk20xDEalXbGnFgglQ19OJ9h6vfOWs725gXyDbW+s021I+b6ODBZv3ALltSmPay1fCXOXpdGZ1Cg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZZczb7cn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZZczb7cn" 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) Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.