Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp920334pxj; Fri, 14 May 2021 21:11:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3J8LGxjlV6C/AvbkUEVjJNWb3221O5IAk4Vkw0G2/mw/wCdraTjbg2BLq+buDdd9pxaGk X-Received: by 2002:a05:6638:29a:: with SMTP id c26mr46371516jaq.135.1621051902977; Fri, 14 May 2021 21:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621051902; cv=none; d=google.com; s=arc-20160816; b=AvoJMtVU21e1c0oz9rD7ywhNvF61EFHltgcmQbqJ9ne8kMMW4kH9yuQJPJw9+7iUsz 7TtJwU4F0OeRTnY+tTfsBalD5fR6HVVk/J7eluAxO26NRPgJ9NAUBJ/yvyvwqNYNL2gd k2Xv3Ght0XQh07o9mEAuXN0ZnFIQwNzSGTLMOKFCrTa6tLzbmWCruddeKMWz8I3EKXQB azv8h/jDjAR9asp088SEgxGfuRIOoTPd/aSeX3XkDa0xsXq/Q6ssb07e1y5ndp2cf/mm 66p3wps2WWki4w1ElTFTV52bOfFNjAPc/CAPrZkQB1TVl/19NiCPA3mjqdAu89ABiGRc M/Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=xkymiY+8+CNIxsNAedZC22OCKPl0xAPTK6wwAANss68=; b=zyqj4T/RJuasBOoczq+XWxGBCVDvbQoHgDVW597CZoeFoVhEMAd3HE+j9UDFEepl3O GcHioUegGsJA20NILWoo3ElCDNs1UqB/5Vk5pRvVsj502+D7tLXJMCgnylRcVfv67Gn3 ID0YHgkpzIQYe42c5Vp8UgW7ZH1ZQN07E98BpDk4wXnjCGVL5mQc5ruUhCC5TdIfRhyI 59XJwi62vFFOK4xy/f9APiqFLvNZ9bj5XL5CSxkqfqHWKoCuRqsXtl469ow2WxI2OmCG OoRG/mPJ/lM7GLado4UNc6AzDMyy4MPjYtS57WRVcXkYw6DuI69vJdkCoHk1Yqj5QbmP dYvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2021042801 header.b=RDMQYC3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si10544610iok.27.2021.05.14.21.11.29; Fri, 14 May 2021 21:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2021042801 header.b=RDMQYC3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234867AbhEOBpo (ORCPT + 99 others); Fri, 14 May 2021 21:45:44 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33297 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234799AbhEOBpf (ORCPT ); Fri, 14 May 2021 21:45:35 -0400 Received: from tazenda.hos.anvin.org ([IPv6:2601:646:8602:8be0:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.16.1/8.15.2) with ESMTPSA id 14F1i7an3212185 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 14 May 2021 18:44:17 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 14F1i7an3212185 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2021042801; t=1621043057; bh=xkymiY+8+CNIxsNAedZC22OCKPl0xAPTK6wwAANss68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RDMQYC3pBOYO5otHcHqta/pHNKgzu38vU0Bh5OD1KBZDDMjUmH3guILQvhCTGoX49 isiIPoEIWfMbaHZ1PP8x8pKu/FHa846kUkNCX32RznKT+2ZLcGdDdsi4IFylXISfp5 XUfQqrHvhUMoK5Io4fbF7UwYKRdd7d1JbIJJHM1sLQ5xXR+eMY7O7rUcSiNYbuJ1HT aahgvdCl+WvS8gStUR1fmEIQIZFNrrvW75FBQkbdQhpnVK0JhcEDEjemDB054ESA0K tvgV8/+aHpiu9Sza9ayET0gkpriSXzie9BI/5tOxyLibGo2KNh3dphs0woO3rAQX0d JkeVPISGCISUA== From: "H. Peter Anvin" To: Thomas Gleixner , Ingo Molnar , Andy Lutomirski , Borislav Petkov , "H. Peter Anvin" Cc: Linux Kernel Mailing List Subject: [PATCH v2 7/9] x86/irq: WARN_ONCE() if irq_move_cleanup is called on a pending interrupt Date: Fri, 14 May 2021 18:43:59 -0700 Message-Id: <20210515014400.2999028-8-hpa@zytor.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515014400.2999028-1-hpa@zytor.com> References: <20210515014400.2999028-1-hpa@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H. Peter Anvin (Intel)" The current IRQ vector allocation code should be "clean" and never issue a IRQ_MOVE_CLEANUP_VECTOR IPI for an interrupt that could still be pending. This should make it possible to move it to the "normal" system IRQ vector range. This should probably be a three-step process: 1. Introduce this WARN_ONCE() on this event ever occurring. 2. Move the IRQ_MOVE_CLEANUP_VECTOR to the sysvec range. 3. Remove the self-IPI hack. This implements step 1. Suggested-by: Thomas Gleixner Signed-off-by: H. Peter Anvin (Intel) --- arch/x86/kernel/apic/vector.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 6dbdc7c22bb7..7ba2982a3585 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -939,9 +939,14 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_irq_move_cleanup) * to this CPU. IRQ_MOVE_CLEANUP_VECTOR is the lowest * priority external vector, so on return from this * interrupt the device interrupt will happen first. + * + * *** This should never happen with the current IRQ + * cleanup code, so WARN_ONCE() for now, and + * eventually get rid of this hack. */ irr = apic_read(APIC_IRR + (vector / 32 * 0x10)); if (irr & (1U << (vector % 32))) { + WARN_ONCE(1, "irq_move_cleanup called on still pending interrupt\n"); apic->send_IPI_self(IRQ_MOVE_CLEANUP_VECTOR); continue; } -- 2.31.1