From nobody Mon Nov 23 22:32:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1793977337; cv=none; d=zohomail.com; s=zohoarc; b=a/WMqAmMzrfaqEoSm5/BzueZM/h1Rr6O8TKExzPHfF3QI0UMG6fXV1XXuCCErSg4cKjpB9UEEY9SL4CR35OEUM6vqegFhWn5hPG7l7m3wx+RWvPN2QMvNephWcEDbOjq3mu1o4EqmTZQAL65CW0ete0g3jPXisO6zZmhBP3Ityo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793977337; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HcS7Wx1laP6tiPacb1Hf+gduLCdPWiMZ+f17krnHkEM=; b=msbM+R7s9Y2OsrF+uSTeeYoXgzq6Fw9pBNloXQEOiYHXaPZhmAPzidKBjpwjCoUAxUDWNmuGd87uwhxILFidpJUU5QhFFBYN+33I546StiXV8luMwNbOoBPfco39slp/C/4Q6oVFsK3Acy5BqiTtUEi6ErHkiD4lJDleZM132sQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793977337369703.4423571637136; Fri, 6 Nov 2026 07:02:17 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1476719.1682702 (Exim 4.92) (envelope-from ) id 1xPLS7-0000gV-87; Fri, 06 Nov 2026 15:02:03 +0000 Received: by outflank-mailman (output) from mailman id 1476719.1682702; Fri, 06 Nov 2026 15:02:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xPLS7-0000gO-5K; Fri, 06 Nov 2026 15:02:03 +0000 Received: by outflank-mailman (input) for mailman id 1476719; Fri, 06 Nov 2026 15:02:02 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xPLS6-0000gI-R8 for xen-devel@lists.xenproject.org; Fri, 06 Nov 2026 15:02:02 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xPLS6-000Nho-7s for xen-devel@lists.xenproject.org; Fri, 06 Nov 2026 16:02:02 +0100 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6aedebdf-e002-0a2a0a5209dd-0a2a4503bc5e-30 for ; Fri, 06 Nov 2026 16:02:02 +0100 Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6aedebe9-fae8-0a2a45030019-b9ff1c22b1d9-3 for ; Fri, 06 Nov 2026 16:02:02 +0100 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 1a1b1616f85000403d.00a for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Nov 2026 15:01:55 +0000 Received: from julian.home (82-67-211-29.subs.proxad.net [82.67.211.29]) (Authenticated sender: julian.vetter@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id 1836A81169; Fri, 6 Nov 2026 16:01:54 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=HcS7Wx1laP6tiPacb1Hf+gduLCdPWiMZ+f17krnHkEM=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=knJ6SpP6j3iONdNvSjOUvIAUguKAi8Q4LhYYH/7O5WpqSL0J/FZBKMy9AxX668najBI98GouO U8H5r5gedgtsUTIOn8uh30yMtEvdvzXZPpSw8zvZpDaOPY8fsoe4daDk5gfnDoSl+rl8HXhOVPA U5ZMEaRpo1LMTbwmb1cRZLXixdyIfUV2NCGeIvGAOG6/0YIivhR42qOLpmZ5hc+gs5KbMZI/Thd fuM82dcL1O3gMeUOTw7h2/SQP7/NDE09eDQtaDnfTddm4PwBqcwwPpwUYNTAME1Y2lmHzxrH/Vm MB7iWiK/HfHSOS+ADERI1K/BHhNiR5u6MSaF2wVE79RA== X-Zone-Loop: 8eaba596b66a797b3c85f384b4c698cd7dccbb67b70b x-campaign-type: default x-transaction-id: 9ed4ec70-ce6c-4ac4-b568-f73cf2105318 x-swg-uid: 01-70bcb356-a602-4ff3-b650-101fc9a60b71 X-Mailer: Sweego Message-ID: <1793977315.8631fc262581453bbf619ec5b2062170.1a1b1616f85000403d@vates.tech> x-swg-bid: 1793977315.8631fc262581453bbf619ec5b2062170.1a1b1616f85000403d Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Julian Vetter To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Thomas Gleixner , Peter Zijlstra , Stefano Stabellini , Oleksandr Tyshchenko , Mathieu Desnoyers , Sebastian Andrzej Siewior , Jiayuan Chen , "Masami Hiramatsu (Google)" , "Vineeth Pillai (Google)" , Julian Vetter Subject: [PATCH 1/2] irq_work: Add irq_work_raise_pending() Date: Fri, 6 Nov 2026 16:01:37 +0100 In-Reply-To: <1793977074.8631fc262581453bbf619ec5b2062170.1a1b15dc430000403d@vates.tech> References: <1793977074.8631fc262581453bbf619ec5b2062170.1a1b15dc430000403d@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.3d.696c5d20722f4023.1a1b1616d7a.7ba72b838a78e8bd=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1793977314682 X-purgate-ID: tlsNG-33051d/1793977322-770F64E9-65D05C4E/0/0 X-purgate-type: clean X-purgate-size: 2825 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1793977339311158500 ---=Part.3d.696c5d20722f4023.1a1b1616d7a.7ba72b838a78e8bd=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" irq_work_queue() only raises the irq_work interrupt when the per-CPU list transitions from empty to non-empty. Later queuers rely on that interrupt to also run their work. If that interrupt gets lost, nothing runs the raised list on that CPU anymore. On architectures with an irq_work interrupt irq_work_tick() skips the raised list, and further irq_work_queue() calls find the list non-empty and don't raise the interrupt again. All irq_work on that CPU is stuck. This happens when irq_work is queued while the local interrupt controller is disabled, e.g. a self-IPI is dropped when sent while the x86 local APIC is software-disabled. Add irq_work_raise_pending(), which re-raises the irq_work interrupt if work is pending on the current CPU. Code which disables the local interrupt controller can call it once interrupts are accepted again. Signed-off-by: Julian Vetter --- include/linux/irq_work.h | 2 ++ kernel/irq_work.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index 7184e1273965..712a92ead4a5 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h @@ -62,12 +62,14 @@ void irq_work_run(void); void irq_work_run_cpu(unsigned int cpu); bool irq_work_needs_cpu(void); void irq_work_single(void *arg); +void irq_work_raise_pending(void); =20 void arch_irq_work_raise(void); =20 #else static inline bool irq_work_needs_cpu(void) { return false; } static inline void irq_work_run(void) { } +static inline void irq_work_raise_pending(void) { } static inline void irq_work_run_cpu(unsigned int cpu) { } static inline void irq_work_single(void *arg) { } #endif diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 73eabcbdcd50..1720a07f12bf 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -112,6 +112,16 @@ static void __irq_work_queue_local(struct irq_work *wo= rk) irq_work_raise(work); } =20 +/* Re-raise the irq_work interrupt on this CPU */ +void irq_work_raise_pending(void) +{ + lockdep_assert_irqs_disabled(); + + if (!llist_empty(this_cpu_ptr(&raised_list)) || + (tick_nohz_tick_stopped() && !llist_empty(this_cpu_ptr(&lazy_list)))) + arch_irq_work_raise(); +} + /* Enqueue the irq work @work on the current CPU */ bool irq_work_queue(struct irq_work *work) { --=20 2.53.0 --=20 Julian Vetter | Vates Hypervisor & Kernel Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.3d.696c5d20722f4023.1a1b1616d7a.7ba72b838a78e8bd=--- From nobody Mon Nov 23 22:32:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1793977349; cv=none; d=zohomail.com; s=zohoarc; b=fMfs+DtVPkXJPfnMJken1fAubM/teyfjMYy7dJkMOxPwzkgoLxwFkQ7GfTGZV/xD71hu2IeRF+RiZ0+GKZecqIoO12oKONNVnHMMGyszuqxRwju4ppmu/SZMSZuGjC8/LHYMwCcjPcfsNBSrHbZsbAuM+GW0KTfC0jBd+bj+MMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793977349; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wHHvi3hBR4r+9APsqtUvDD87Ym1BNhY3X703ylm8Qyw=; b=ROnDqPqMlA/K79rXaALq7h7bhJYN46Wsa7Oj2h1bTGEDDQhOJUAhC6PCvK3yMKx0Iz/gNGFnyt99sMSaUdz2qtwWeDUrcoTvvvs1uui5sLq1SroOfuU6vcL0OEnVDHP4zgvrwXu4FOF8apR+TSG5/xYEy5L0PBXr4xfonYPuqXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793977349611523.2600051313184; Fri, 6 Nov 2026 07:02:29 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1476720.1682712 (Exim 4.92) (envelope-from ) id 1xPLSF-0000th-Fb; Fri, 06 Nov 2026 15:02:11 +0000 Received: by outflank-mailman (output) from mailman id 1476720.1682712; Fri, 06 Nov 2026 15:02:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xPLSF-0000ta-Ce; Fri, 06 Nov 2026 15:02:11 +0000 Received: by outflank-mailman (input) for mailman id 1476720; Fri, 06 Nov 2026 15:02:10 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xPLSE-0000tC-1F for xen-devel@lists.xenproject.org; Fri, 06 Nov 2026 15:02:10 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xPLSD-000Nho-CP for xen-devel@lists.xenproject.org; Fri, 06 Nov 2026 16:02:09 +0100 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6aedebf1-e002-0a2a0a5209dd-0a2a4501d8f0-0 for ; Fri, 06 Nov 2026 16:02:09 +0100 Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6aedebf0-5984-0a2a45010019-b9ff1c23b6af-3 for ; Fri, 06 Nov 2026 16:02:09 +0100 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 1a1b161726c000403d.00a for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Nov 2026 15:01:55 +0000 Received: from julian.home (82-67-211-29.subs.proxad.net [82.67.211.29]) (Authenticated sender: julian.vetter@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id E6ED081A63; Fri, 6 Nov 2026 16:01:54 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=wHHvi3hBR4r+9APsqtUvDD87Ym1BNhY3X703ylm8Qyw=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=j1qYmRoV8gTjKVD2zGfnYtkSPKWdpHSSVTrMSLKoukGnuOWYqJR+wAopGSmVRths4Y46SvTwx eMZ8OqNUvQFNbvGyU3NET0jM9A/1AAWuQ3LaRa8efWJAnISqz6whRjqzZ6R3UlgHJ9Jk4wHm2eO qGmvSqPGpnQTJkCAsS+Mi840Mq8oHSEvPVEdpcETJ+gSZuDQ+FHaQaxcfBJtkcPUnrGRI+Qb2Gc M/urp2+jgxc2P0LXZR/T6viI+G8b+2SH8CnAsQenWtVGwWOORkDMHeJvZGjhmP580fwQo/xzUu7 bfsb6IUbNqYGW29PnVQzwG4YlEpJdTKy+USUGKuOT0Yw== X-Zone-Loop: 421a4d0a402fe47186c6b38243650f29e1e461c3535f x-campaign-type: default x-transaction-id: 32875009-4875-4d3c-9d00-34efde578f7a x-swg-uid: 01-2b6e033f-775e-4059-9040-9249c2aed5a3 X-Mailer: Sweego Message-ID: <1793977316.8631fc262581453bbf619ec5b2062170.1a1b161726c000403d@vates.tech> x-swg-bid: 1793977316.8631fc262581453bbf619ec5b2062170.1a1b161726c000403d Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Julian Vetter To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Thomas Gleixner , Peter Zijlstra , Stefano Stabellini , Oleksandr Tyshchenko , Mathieu Desnoyers , Sebastian Andrzej Siewior , Jiayuan Chen , "Masami Hiramatsu (Google)" , "Vineeth Pillai (Google)" , Julian Vetter Subject: [PATCH 2/2] xen/manage: Re-raise pending irq_work after suspend Date: Fri, 6 Nov 2026 16:01:38 +0100 In-Reply-To: <1793977074.8631fc262581453bbf619ec5b2062170.1a1b15dc430000403d@vates.tech> References: <1793977074.8631fc262581453bbf619ec5b2062170.1a1b15dc430000403d@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.3e.4ed4c3bce91e9c03.1a1b16170c2.c742e2ef938736bc=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1793977315523 X-purgate-ID: tlsNG-d62444/1793977329-BE664757-78A7B694/0/0 X-purgate-type: clean X-purgate-size: 1846 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1793977351538158500 ---=Part.3e.4ed4c3bce91e9c03.1a1b16170c2.c742e2ef938736bc=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" xen_suspend() calls syscore_suspend(), which on x86 disables the APIC, and only re-enables it in syscore_resume(). But, in between, gnttab_resume() and xen_irq_resume() call printk(). With an nbcon console, e.g. the 8250, printk() queues irq_work, which sends a self-IPI. As the APIC is disabled, the IPI is dropped. The irq_work stays on the raised list, and no later irq_work_queue() on that CPU raises the IPI again. All irq_work on that CPU is dead after resume. Commit 560f4deda327 ("printk/nbcon: Change nbcon_irq_work to IRQ_WORK_LAZY") removed this particular issue, but any other non-lazy irq_work queued in this window would cause the irq_work to stall in the same way. To fix the issue, re-raise pending irq_work once syscore_resume() has re-enabled the APIC. Signed-off-by: Julian Vetter --- drivers/xen/manage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 05d7de128e71..5054fcb25337 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include =20 @@ -86,6 +87,8 @@ static int xen_suspend(void *data) =20 syscore_resume(); =20 + irq_work_raise_pending(); + return 0; } =20 --=20 2.53.0 --=20 Julian Vetter | Vates Hypervisor & Kernel Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.3e.4ed4c3bce91e9c03.1a1b16170c2.c742e2ef938736bc=---