From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792589156; b=chH+36+tcgH2db9ti3TNidZ+T3nSVXLMHBKSa074V/TzD1z7iWgriz0ockBtK2r8Xe7t UYZcvk09UUTIq/HbQCGdfrtI6Pxqy1YD27pFMnF2Gf3axzLhYxgydUlCpuN3LFzUbK0Y4 SclN8yRFuCYog1CVOMpWfpxpX3cqL44V3PleN3HMnvC4/LFMhwJ01+AE2OnK1CSrCAADJ ITm6GwIs3wZeetVei19faEQoyJZKlQfj1REZgMmh6DuV8Xq2y1+YQPr88mCsULGzD9Gls fsXeh5KykpZqq33zBTi8VaOEHg++uHjYPs/sS2DOnMHf/fkbsw7LSoy8ocsf6MDAbPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792589156; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To:X-SA-Exim-Mail-From: X-SA-Exim-Scanned; bh=WmpDi7uAEvCBbE9BhvFq4d4HOMx3zfGqFapjUnsxTxk=; b=IKZf8lWVmZz9w3Hy2VG1CSqfd6/9rPVAeSR39bCDnRgup9nmu6fS1lQ33Sbdt9OWrJIO 8HyUgJ+BwmrsN0OXAooIlIxqN0e5SLefDNublPu9IVg3bwIagdhhjMwmoygRuujbZbWLu Z/u6MyX1JHLuAA49b3VGVcc6uE4H93Gx6VZAvA6LFIDyRWZi6mW0KnpX/jpUSy2LAaE9n fmS35xsbNJ9z1o1sQyCDs3B+6XQaeTGlY6ut0JJawwPQ2QkL0J4qv8g/49P1m0HrrMWom 53CzjReKTaMV5PHlonmr3YRZlCd2XqD1ksaGHmqQ56YIZ3Rl9ECLKxmJ9+1kxQBWp2g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RZozsfb0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03C83606A31D; Wed, 21 Oct 2026 13:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RZozsfb0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A19F91F000C4; Wed, 21 Oct 2026 13:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792589155; bh=WmpDi7uAEvCBbE9BhvFq4d4HOMx3zfGqFapjUnsxTxk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=RZozsfb0ChtozlH8YnpQ1cvLafomzdAOPmTu3pessHUZEoHJL/MrAJMGUyG8k2Mau qgjn7jTqXt/flSpYgcfX+K+u9Rtt6WTRs7nnerWzG+lfXX72yz43wL50iwsPPJKrPh BurJWL0QMxEcsoqIxUtGh4HAtd6ygCCv05wCx3XJJauqJvLEW0V63lsqzdFt27ODpX Bokboc/Fk0G5plek7tBZwQnuhWbTRETuZcb9Pj5zyr7bs7jcgE9MJKUJ/M4lp74nFi H/wgoVGnz/lXgpcr+1zIM6WvSB0oSKy/kghjSMMLpQeMDAOk9W6jXM6IEP6nRJj+rO O8gs8ipyhpcBg== 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 1xJWKH-00000005cet-0YFY; Wed, 21 Oct 2026 13:25:53 +0000 Date: Wed, 21 Oct 2026 14:25:52 +0100 Message-ID: <86pkx3yylb.wl-maz@kernel.org> From: Marc Zyngier To: Vincent Donnefort Cc: oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kernel-team@android.com, fuad.tabba@linux.dev, stable@vger.kernel.org Subject: Re: [PATCH v1] KVM: arm64: pkvm: Clear GICv3 LRs in the hypervisor In-Reply-To: References: <20261021110000.508827-1-vdonnefort@google.com> <86qzhjz1iz.wl-maz@kernel.org> 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) X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: vdonnefort@google.com, oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kernel-team@android.com, fuad.tabba@linux.dev, stable@vger.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, 21 Oct 2026 13:50:22 +0100, Vincent Donnefort wrote: > > On Wed, Oct 21, 2026 at 01:22:28PM +0100, Marc Zyngier wrote: > > On Wed, 21 Oct 2026 12:00:00 +0100, > > Vincent Donnefort wrote: > > > > > > The LR registers are architecturally UNKNOWN when the CPU boots or > > > resumes. However, in protected mode, only the used ones are reset. > > > During boot the HVC __vgic_v3_init_lrs() is never called because > > > vgic_present is only set in init_subsystems(), after cpu_hyp_init() was > > > called. > > > > Why don't you fix this rather than making the init even more > > different? > > Ack, I'll make a patch to fix that first. > > > > > > Also, the PM notifier isn't registered for pKVM and the HVC > > > becomes unavailable after the host is deprivileged. > > > > Sanitising the LRs on PSCI_ON is probably the right thing to do, but I > > don't understand why resetting the LRs is out of reach from the host, > > given that the host is fully in charge of the interrupt injection, and > > therefore controls the LRs. > > I suppose I could reinstantiate the pm callbacks for pkvm to at least reset the > LRs? I think there are two different things: - pKVM must not rely on the host resetting the LRs once it is deprivileged (that's the PSCI_ON case) - pKVM must not prevent the host from resetting the LRs (that's the "mind your own business" case). Both need addressing. If that means the LRs get reset twice because pKVM inherits the PM callbacks, so be it. Thanks, M. -- Without deviation from the norm, progress is not possible.