mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip
@ 2025-10-21  9:44 Sascha Bischoff
  2025-10-21 14:01 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sascha Bischoff @ 2025-10-21  9:44 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, linux-kernel, kvm
  Cc: nd, maz, broonie, oliver.upton, Joey Gouly, Suzuki Poulose, yuzenghui

If there is no in-kernel irqchip for a GICv3 host set all of the trap
bits to block all accesses. This fixes the no-vgic-v3 selftest again.

Fixes: 3193287ddffb ("KVM: arm64: gic-v3: Only set ICH_HCR traps for v2-on-v3 or v3 guests")
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/all/23072856-6b8c-41e2-93d1-ea8a240a7079@sirena.org.uk
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
---
 arch/arm64/kvm/vgic/vgic-v3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c
index 6fbb4b099855..2f75ef14d339 100644
--- a/arch/arm64/kvm/vgic/vgic-v3.c
+++ b/arch/arm64/kvm/vgic/vgic-v3.c
@@ -301,7 +301,8 @@ void vcpu_set_ich_hcr(struct kvm_vcpu *vcpu)
 		return;
 
 	/* Hide GICv3 sysreg if necessary */
-	if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V2) {
+	if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V2 ||
+	    !irqchip_in_kernel(vcpu->kvm)) {
 		vgic_v3->vgic_hcr |= (ICH_HCR_EL2_TALL0 | ICH_HCR_EL2_TALL1 |
 				      ICH_HCR_EL2_TC);
 		return;
-- 
2.34.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip
  2025-10-21  9:44 [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip Sascha Bischoff
@ 2025-10-21 14:01 ` Mark Brown
  2025-10-27 14:02 ` Sebastian Ott
  2025-10-30 16:23 ` Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-10-21 14:01 UTC (permalink / raw)
  To: Sascha Bischoff
  Cc: linux-arm-kernel, kvmarm, linux-kernel, kvm, nd, maz,
	oliver.upton, Joey Gouly, Suzuki Poulose, yuzenghui

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

On Tue, Oct 21, 2025 at 09:44:09AM +0000, Sascha Bischoff wrote:
> If there is no in-kernel irqchip for a GICv3 host set all of the trap
> bits to block all accesses. This fixes the no-vgic-v3 selftest again.

Tested-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip
  2025-10-21  9:44 [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip Sascha Bischoff
  2025-10-21 14:01 ` Mark Brown
@ 2025-10-27 14:02 ` Sebastian Ott
  2025-10-30 16:23 ` Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Sebastian Ott @ 2025-10-27 14:02 UTC (permalink / raw)
  To: Sascha Bischoff
  Cc: linux-arm-kernel, kvmarm, linux-kernel, kvm, nd, maz, broonie,
	oliver.upton, Joey Gouly, Suzuki Poulose, yuzenghui

On Tue, 21 Oct 2025, Sascha Bischoff wrote:

> If there is no in-kernel irqchip for a GICv3 host set all of the trap
> bits to block all accesses. This fixes the no-vgic-v3 selftest again.
>
> Fixes: 3193287ddffb ("KVM: arm64: gic-v3: Only set ICH_HCR traps for v2-on-v3 or v3 guests")
> Reported-by: Mark Brown <broonie@kernel.org>
> Closes: https://lore.kernel.org/all/23072856-6b8c-41e2-93d1-ea8a240a7079@sirena.org.uk
> Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>

Reviewed-by: Sebastian Ott <sebott@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip
  2025-10-21  9:44 [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip Sascha Bischoff
  2025-10-21 14:01 ` Mark Brown
  2025-10-27 14:02 ` Sebastian Ott
@ 2025-10-30 16:23 ` Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2025-10-30 16:23 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, linux-kernel, kvm, Sascha Bischoff
  Cc: nd, broonie, oliver.upton, Joey Gouly, Suzuki Poulose, yuzenghui

On Tue, 21 Oct 2025 09:44:09 +0000, Sascha Bischoff wrote:
> If there is no in-kernel irqchip for a GICv3 host set all of the trap
> bits to block all accesses. This fixes the no-vgic-v3 selftest again.
> 
> 

Applied to fixes, thanks!

[1/1] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip
      commit: da888524c393b4a14727e1a821bdd51313d0a2d3

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-30 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21  9:44 [PATCH] KVM: arm64: vgic-v3: Trap all if no in-kernel irqchip Sascha Bischoff
2025-10-21 14:01 ` Mark Brown
2025-10-27 14:02 ` Sebastian Ott
2025-10-30 16:23 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®