From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A99C635674E for ; Tue, 12 May 2026 14:51:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778597500; cv=none; b=LZQlowD5mHz/PP5r5PSSXf8gSh7SHPhYox3DQZ24BQnxMUt0MKWJKIZ6jnZx/NfHX0eHxe4Oc3k/Dz0VBqFIT2vCMLvD5wvniJhFOg5ikgrZBVCQg4hg3DbqU+X9q1tQg8vRi+MllzgHvK+e7G8vvZDmHfHT9xSr4eFMl9QoGfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778597500; c=relaxed/simple; bh=BNqJ0Z6GNT0MHQZDqpDCSNrcAvkD0K3k+w5ye4TtnhY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sTyECGkI9BRl6gIdYY9JNc3yP7zNqaJSrh73Fp+1bcjf4VVi+fpDzCSsZ3xkCRBmEp2GxW1XciYUZuNuRRa27LPVT+JqVdmRfU9iRwO4bqrdAqdbbrUJAibps6B9atEJmvulbWoitGi6yeMX0KTTBVGmQg5Wzv55ry3npSmussU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C2OpMINp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C2OpMINp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40349C2BCB0 for ; Tue, 12 May 2026 14:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778597500; bh=BNqJ0Z6GNT0MHQZDqpDCSNrcAvkD0K3k+w5ye4TtnhY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C2OpMINpLvlyob3nUcn23aeM3ISBXqrjJwN37GqHULq0SH8nRW5WpMpbkmw+efVgd zfmxNwXrbSBxX3EbJhcntBsj24DEaExuL34jG02VmncK0oF5KSv2D7tdCIg3T3O0p3 qDgT42N7IQN3Ki7Bi+s2sXCYs7gRybL4voLeHcmuqKF/KdAF4DCSbg51PubBouIZxX b4gGHFy9hkdKItGxFFZ8Tu5JwviLoRHU/AZP3z9CLq3ABB7uTtpE5URJybzL4vyXIL AoAaft7ZUBSK60SyNZZ6Z3m+lv4QrDpYQ1KpF+l0J2JhZ37UUNRXS/e1EC6tYzXMC2 yMEIw8hTlsI7w== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) 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 1wMoSQ-00000001b3y-1INk for stable@vger.kernel.org; Tue, 12 May 2026 14:51:38 +0000 From: Marc Zyngier To: stable@vger.kernel.org Subject: [PATCH 6.1.y] KVM: arm64: Wake-up from WFI when iqrchip is in userspace Date: Tue, 12 May 2026 15:51:30 +0100 Message-ID: <20260512145130.3677051-1-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026051236-tribesman-mortuary-f185@gregkh> References: <2026051236-tribesman-mortuary-f185@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: 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 commit 4ce98bf0865c349e7026ad9c14f48da264920953 upstream It appears that there is nothing in the wake-up path that evaluates whether the in-kernel interrupts are pending unless we have a vgic. This means that the userspace irqchip support has been broken for about four years, and nobody noticed. It was also broken before as we wouldn't wake-up on a PMU interrupt, but hey, who cares... It is probably time to remove the feature altogether, because it was a terrible idea 10 years ago, and it still is. Fixes: b57de4ffd7c6d ("KVM: arm64: Simplify kvm_cpu_has_pending_timer()") Link: https://patch.msgid.link/20260423163607.486345-1-maz@kernel.org Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 6eb992056c67f..b0fe2bf7fa5ae 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -540,6 +540,11 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) { bool irq_lines = *vcpu_hcr(v) & (HCR_VI | HCR_VF); + + irq_lines |= (!irqchip_in_kernel(v->kvm) && + (kvm_timer_should_notify_user(v) || + kvm_pmu_should_notify_user(v))); + return ((irq_lines || kvm_vgic_vcpu_pending_irq(v)) && !kvm_arm_vcpu_stopped(v) && !v->arch.pause); } -- 2.47.3