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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 05015C83F07 for ; Mon, 7 Jul 2025 14:53:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYnDW-0005UG-R5; Mon, 07 Jul 2025 10:53:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYmts-0008Fh-PF; Mon, 07 Jul 2025 10:33:06 -0400 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYmtp-0004mB-Jg; Mon, 07 Jul 2025 10:32:56 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 024FD5C5693; Mon, 7 Jul 2025 14:32:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8F83C4CEE3; Mon, 7 Jul 2025 14:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751898761; bh=DdUOUP5mOqQ5AnhbWh7hEm+EvlHejcuQ1bLOlyqiBL4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KSzJDC7lf2TlnSN+8kHxQ427RalmOl1e56t6vJU6DWxWL/ZfHmNEDjly0g4SG74d9 4sLXOJ/fkwwxeX5szGb/SXp+qeYFzOsYfEt/DBsWK3dNGi0s50tsF3teP1Uqm02yRL SDn3GLazy4uTzfXuPyCYiQNso8ALdq2TXxW4OvNvjtvnNOxo+uj8p35S43dWv8jzEe 3fobCEMrzgKp3J7rB91JJ82OCQv/vWGXVtR1eDO88p10eXXyv/C+o2e7i4eF8VIFxc ijTRTox4UBWmCa+F0DdEiRPJkFEhhZDbql76io7FLNjDZduzirVNlqFAKtJFQkxUjQ qzjhuQrVENnjw== 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.95) (envelope-from ) id 1uYmtb-00DQz6-Bn; Mon, 07 Jul 2025 15:32:39 +0100 Date: Mon, 07 Jul 2025 15:32:38 +0100 Message-ID: <86y0t09im1.wl-maz@kernel.org> From: Marc Zyngier To: Peter Maydell Cc: eric.auger@redhat.com, eric.auger.pro@gmail.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, miguel.luis@oracle.com, richard.henderson@linaro.org, gkulkarni@amperecomputing.com, gankulkarni@os.amperecomputing.com, hi@alyssa.is Subject: Re: [PATCH v7 4/4] hw/arm/virt: Allow virt extensions with KVM In-Reply-To: References: <20250702163115.251445-1-eric.auger@redhat.com> <20250702163115.251445-5-eric.auger@redhat.com> <9c78f7c0-88ce-4c4d-b6c0-5b77b4d83367@redhat.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: peter.maydell@linaro.org, eric.auger@redhat.com, eric.auger.pro@gmail.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, miguel.luis@oracle.com, richard.henderson@linaro.org, gkulkarni@amperecomputing.com, gankulkarni@os.amperecomputing.com, hi@alyssa.is X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass client-ip=139.178.84.217; envelope-from=maz@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org On Mon, 07 Jul 2025 10:53:38 +0100, Peter Maydell wrote: > > On Mon, 7 Jul 2025 at 10:30, Eric Auger wrote: > > > > Hi Peter, Marc, > > > > On 7/4/25 2:22 PM, Peter Maydell wrote: > > > I suppose the system registers probably generally Just Work > > > via the sysreg GET/SET_ONE_REG API, but won't the in-kernel > > > GICv3 have extra state that we need to migrate in > > > hw/intc/arm_gicv3_kvm.c ? > > Do you see some specific registers/resources that would need attention? > > All the EL2-only-accessible GIC registers: ICH_AP*R_EL2, > ICH_EISR_EL2, ICH_ELRSR_EL2, ICH_HCR_EL2, ICH_LR_EL2, > etc etc. It isn't obvious to me why we'd expose any of the status registers to userspace. ICH_{EISR,ELRSR,MISR}_EL2 are entirely synthetic, and are directly generated by the emulation from the rest of the state. Save/restoring this state would make things pointlessly complicated, unless I'm missing something obvious. > These all need to be exposed via KVM_DEV_ARM_VGIC_GRP_CPU_SYSREG > and hw/intc/arm_gicv3_kvm.c needs code to be able to save and > restore them into the GIC data structures (and we need to make > sure the kernel isn't accidentally exposing them as CPU registers > via the GET/SET_ONE_REG API, I think, in whatever way we do > that for the existing EL1 GIC cpuif registers). > > I don't see any of the EL2 sysregs listed in the kernel's > gic_v3_icc_reg_descs[], which looks like it's what drives > the handling of KVM_DEV_ARM_VGIC_GRP_CPU_SYSREG. Hmmm... This is indeed pretty inconsistent. I'll have a look at it. Thanks, M. -- Without deviation from the norm, progress is not possible.