From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7D674CD13CF for ; Sun, 9 Nov 2025 17:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IYmT83DvLr0MvZ9Y3hOrPjWhU+egk0dw7fUg2nj5mYo=; b=X8i9trqQi372WVKPNNn9YSZzfS IA8sqzcE8l4ivlUUkOFA7OxbLVlh88lkvPr9LhJ7LvsMHqNVVNCGVIEWwODPZPWBx0yC3u1r5zGEd OhSAOERY9BaoCIaeuE/IBNmeX3B6vW6lon2KpLUEW0vIIuHZSXNCZAF016GjdHZT3HqDGOdtM5P3C mUoThMtcQ2mKM3WoWTXZ24xgohtnnpzG5PtoMHbmGo6T8+KisYRpoaVEu4D4kcx+OAcGa6dofoICg QNpRGK0KlLUBnzSUtrdwQTmbzgmAMAzIndh9wjvnkFd4aUxFEt7WMRXH3Vv+cX8MUYBxdqG9H+qfV jn6kqNlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vI92j-00000004DUV-1W62; Sun, 09 Nov 2025 17:17:35 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vI91p-00000004CGu-1Z8W for linux-arm-kernel@lists.infradead.org; Sun, 09 Nov 2025 17:16:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 0E8D941B01; Sun, 9 Nov 2025 17:16:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6886C116B1; Sun, 9 Nov 2025 17:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762708596; bh=KaV8WuYjga/OBqyYenYZWM5x2h8cMy0LZ9LYeamx33E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O8P2YQsi0c9XQBj5qKH4Qhf4NgroiU7/cfPDVtI3/KTiJWyinM5l6jquQ+tTMr2Iv 0XuJEAcyjNvfg5To6x2H0wqfx7+LoTrxGEKBxec1QS7x+5xKyVx3IylMHjODnOwjAu oo46aU/Y/UzyDi6vRBQIdfkH9fvy7alhDaUDvwtwLnvMNmmuvtk40nAXRQDDHINUF2 m7yjWruZWMid68S2NA7MoOQhv6isBdMs54iCdTudYxpml/lKpz4dycsYi4I2zMCKKh 2mrH3t5Do27dlMQIsbbhuhHx2blesKU0DdhAfd1/d3/7ojs3NE7+PRF64KDNhKS+GN K5qA1W4S5/T+g== 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 1vI91n-00000003exw-0Jr6; Sun, 09 Nov 2025 17:16:35 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Christoffer Dall , Volodymyr Babchuk , Yao Yuan Subject: [PATCH v2 29/45] KVM: arm64: GICv3: Set ICH_HCR_EL2.TDIR when interrupts overflow LR capacity Date: Sun, 9 Nov 2025 17:16:03 +0000 Message-ID: <20251109171619.1507205-30-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251109171619.1507205-1-maz@kernel.org> References: <20251109171619.1507205-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com, christoffer.dall@arm.com, Volodymyr_Babchuk@epam.com, yaoyuan@linux.alibaba.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251109_091637_546843_A3CA9B8D X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we are ready to handle deactivation through ICV_DIR_EL1, set the trap bit if we have active interrupts outside of the LRs. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/vgic/vgic-v3.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index 1026031f22ff9..26e17ed057f00 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -42,6 +42,13 @@ void vgic_v3_configure_hcr(struct kvm_vcpu *vcpu, ICH_HCR_EL2_VGrp0DIE : ICH_HCR_EL2_VGrp0EIE; cpuif->vgic_hcr |= (cpuif->vgic_vmcr & ICH_VMCR_ENG1_MASK) ? ICH_HCR_EL2_VGrp1DIE : ICH_HCR_EL2_VGrp1EIE; + + /* + * Note that we set the trap irrespective of EOIMode, as that + * can change behind our back without any warning... + */ + if (irqs_active_outside_lrs(als)) + cpuif->vgic_hcr |= ICH_HCR_EL2_TDIR; } static bool lr_signals_eoi_mi(u64 lr_val) -- 2.47.3