Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3589927rwb; Mon, 16 Jan 2023 09:59:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXmqqN66Xgb3ElCc3fyCS0hPfidIuIOIlthEc9MrJdhN0/rldqsh8tLpKYHvJmtTDr5zu/ X-Received: by 2002:a17:906:5283:b0:84d:4be4:aa2b with SMTP id c3-20020a170906528300b0084d4be4aa2bmr12897169ejm.68.1673891945868; Mon, 16 Jan 2023 09:59:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673891945; cv=none; d=google.com; s=arc-20160816; b=ZF4+UvVHoC2Fh+fJZycacoui1AdiRLAoKU+YuzlkGUUPhvqm8Nbyj+j/8QlOR0US3F b13Y+4Vh48hSWFfrQeJiyCTMA9LXzDtAYUytjGxwLOGiB2n95Cyz94GzQQcfteoa1/zR nbTu15GPPgEYrScvr0NkD+stoVb+0JGskE02R5kQWMjnIF5CjAMdMWhEtFzZxPx9K0ui /A3e4Tt6mox8feV6NVRJL/6OLnBlqYx5qF2r+Uam14F5mE9cB6D8qGzAGlQeTRLHe//d rQBbZtSx6dyrG1ohAQ2R4d9AgOLb/RAReSde/sVVyaEb4GDt1oRuoQQ0A9hRODxrHC9R qOOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=pQQL6K9+g3nFmYTxhhPBdAWY0ZIqAkC6J7tK4XIrDaU=; b=0sk3gwc+xYu0vN8DDySbDU1uJGTT0L49efRlVUaS2RJBIc4yD+/Yw2ZyTXT/SVHyM7 Mfio47DrjX2/0auzpkXtwqlYldSIqiZHXNlEjAN+iWy0jkWKTdDZvaEnmTOtchV3KuVg fkNBEAGLN0yEKNYIGtlYCxHEXzbhvflNXpiGJF++U5bfyumX/Cf5dMPjAAVfnURtV/iE gUfdYrl7oHd/UKByQrarLKkKAiuX+kaE8wL/GHVMYvM85kAS+QVzVFE0htNRLqvquiR4 ECR1iwMlVy4Qv0W+/K1RZJIf3h6EX1H8PFRdHZnWzIIcepiL4XFRDtBVjSDqpOedQsIy DA2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4u6LSUXN; dkim=neutral (no key) header.i=@linutronix.de header.b=sgeWZOao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js10-20020a17090797ca00b007ae74740f93si35732851ejc.832.2023.01.16.09.58.51; Mon, 16 Jan 2023 09:59:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4u6LSUXN; dkim=neutral (no key) header.i=@linutronix.de header.b=sgeWZOao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233631AbjAPQjl (ORCPT + 50 others); Mon, 16 Jan 2023 11:39:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233633AbjAPQjU (ORCPT ); Mon, 16 Jan 2023 11:39:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34452C650; Mon, 16 Jan 2023 08:27:52 -0800 (PST) Date: Mon, 16 Jan 2023 16:27:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673886470; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQQL6K9+g3nFmYTxhhPBdAWY0ZIqAkC6J7tK4XIrDaU=; b=4u6LSUXNyZSxsGSltzZE00kMT/aUmQ+VxdSsJ4DfrJUjWUwti00Yh60m/MD0HDMhouXc+4 4/jsDYItlUPEgpzN447amyAKlEW3CtjeV/FBzJyq3mMimdh2OXjIK1eQwhvkMvgQl75pqC 3nKQZD+J/1cpDX1IIU/qkt1KAE+YIYCGdze5SE1a56Z0QFnSVOwlhCf6CAilmA4g6dxM25 RP6jsAIP//uumxjvV+vOAamJGuWM61sxOD/d13sgdLpXrkUfu8KvBBIiYhrdZ+7ZQJJyA+ 1Lr6wOYgiRJbrFleUBVOFIgUQFWrlaYzShpXUahw7tpclwTpTMun/bIPKPmTRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673886470; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQQL6K9+g3nFmYTxhhPBdAWY0ZIqAkC6J7tK4XIrDaU=; b=sgeWZOaocyIlaAYRTu9ifRlcpmZvVtfxIx7xVVr5adfXPXKlhAl4gx/4lB5+qBfKHpHGU3 Sn4I8c7cqemL0FDg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL Cc: Baoquan He , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <87mt6rjrra.ffs@tglx> References: <87mt6rjrra.ffs@tglx> MIME-Version: 1.0 Message-ID: <167388646935.4906.13609836242653190947.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 5fa55950729d0762a787451dc52862c3f850f859 Gitweb: https://git.kernel.org/tip/5fa55950729d0762a787451dc52862c3f850f859 Author: Thomas Gleixner AuthorDate: Mon, 09 Jan 2023 22:57:13 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 16 Jan 2023 17:24:56 +01:00 x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL Baoquan reported that after triggering a crash the subsequent crash-kernel fails to boot about half of the time. It triggers a NULL pointer dereference in the periodic tick code. This happens because the legacy timer interrupt (IRQ0) is resent in software which happens in soft interrupt (tasklet) context. In this context get_irq_regs() returns NULL which leads to the NULL pointer dereference. The reason for the resend is a spurious APIC interrupt on the IRQ0 vector which is captured and leads to a resend when the legacy timer interrupt is enabled. This is wrong because the legacy PIC interrupts are level triggered and therefore should never be resent in software, but nothing ever sets the IRQ_LEVEL flag on those interrupts, so the core code does not know about their trigger type. Ensure that IRQ_LEVEL is set when the legacy PCI interrupts are set up. Fixes: a4633adcdbc1 ("[PATCH] genirq: add genirq sw IRQ-retrigger") Reported-by: Baoquan He Signed-off-by: Thomas Gleixner Tested-by: Baoquan He Link: https://lore.kernel.org/r/87mt6rjrra.ffs@tglx --- arch/x86/kernel/i8259.c | 1 + arch/x86/kernel/irqinit.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 3aa5304..4d8aff0 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c @@ -114,6 +114,7 @@ static void make_8259A_irq(unsigned int irq) disable_irq_nosync(irq); io_apic_irqs &= ~(1<init(0); - for (i = 0; i < nr_legacy_irqs(); i++) + for (i = 0; i < nr_legacy_irqs(); i++) { irq_set_chip_and_handler(i, chip, handle_level_irq); + irq_set_status_flags(i, IRQ_LEVEL); + } } void __init init_IRQ(void)