Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp899242pxb; Fri, 22 Apr 2022 13:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwnN33ZSAzYlkNOP8l/6u+NatWlCDV0lFC1hMx1HL4+U73SWGVBbc6ihsvB3ltxIr/LtEH X-Received: by 2002:a63:ad0c:0:b0:374:50b4:c955 with SMTP id g12-20020a63ad0c000000b0037450b4c955mr5332831pgf.530.1650660439701; Fri, 22 Apr 2022 13:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650660439; cv=none; d=google.com; s=arc-20160816; b=FVf+6X9A5wFAoC/TAbdPgG3Kq4zrfKXm2kBJpG9L3mCrhv6ZkNQOLFc8qgMZftJ1xb zE5ydf/65OTjyX5mUuvGSGgpHymymIOhAjyO3fiprExqHYSHXYF5K4/Fo66QcjCGzJbv Am6UoyoTkvDmR2as6YZSk/EhktyjnU6l0SKDmBqVSMnPPmLkIVi0pK8azJdJ6WTbH5zm PMSxmAPwEUCDALTwTaG4tEijJjGZYsJBQbpO4Mxikmb+EAnqGqpHFmLhEiphKruYTd7R p4BTkYq8256GYx4FT/eJ0a98zo/z69p4bUWmY8I7g/IIvV219OQcUBNFeHVW7sslU3Jj vu7A== 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; bh=iQPhbY+LxZLej2JSRwshiiNk4MKgpm0s/70/5SE/Spw=; b=wBd+rArPM9lTX5U3lUeZ3VaBlm28FYekmwX6OI4e6PatmL6tr4DUKYXUs7PB4S2wwS i82+t6YJ2C2FpTZ/Al1oGm/tZlxzAcHW2BsQDtYu81aHOHLMdqJFMgZMgHGbFYHkHtkm sLmKZuoLBanbqoLW5YnM3amatJF1c2cLYsxGx+nww0NkQtM/kqw4CvCwzhPEUDgwdyL/ GL+oxZjhEMug27t1E3lG4OxRcegRiXBlUBI8rCnWmp4GfF/FMxycObruftNJXCIDOpn9 YKq2jqyMwqURFqaiz3ITytD3yRJ+DqkLrN2Gmh93PqDGltUuQB2xYYW6H5L453WHrnIt b/zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BeznbCe3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 19-20020a630313000000b003aaf6022e05si122971pgd.676.2022.04.22.13.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:47:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BeznbCe3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C9342DCF08; Fri, 22 Apr 2022 12:36:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379324AbiDTOIv (ORCPT + 99 others); Wed, 20 Apr 2022 10:08:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379314AbiDTOIq (ORCPT ); Wed, 20 Apr 2022 10:08:46 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E1F93E0E2 for ; Wed, 20 Apr 2022 07:06:00 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id j8so1837438pll.11 for ; Wed, 20 Apr 2022 07:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iQPhbY+LxZLej2JSRwshiiNk4MKgpm0s/70/5SE/Spw=; b=BeznbCe320Iwc28CPWiQKfI6oFePospyKcwGywCHWnFSddTpMFekmYVGIUo5xODNL4 eKIQyXaEuaMz4suKWnDAmWuAGp/TAArKty/wtGqd2RX6OJuryeh5didBpgXMjGjiC+Uo TWfT4omujCztsxLAIsr8bJdQemveNhF7U9fyQJZcToIxZfDDDZaVtwvT/ZlNq/sQg7cA 6e9OTdX+gmNJJlGJY3YhhcnwwjkkzmESWdoPj0VpCCTlt1UafYTmKJ8p3h/jsIeMIHze g4z+l29ROVu3rl8J2LMQ0xGMlPGkv379qNbUhkpDFavtRR6NuFLgs5v+RXmsW3W7NmPe 48qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iQPhbY+LxZLej2JSRwshiiNk4MKgpm0s/70/5SE/Spw=; b=NGyxUxSJU/eVZJbHqe+cZZa4Yo8cOAZS/ppPlREKrnmRoYvnG/v1KKyYwPaMDtiDF5 6wFP8ymuYjU2ZRC/ivlIr6RNgKbiY9C+4XG0q/a1r5pLmB1Tz58Byy2mxKNxF1rA0Ss7 FgLbr21oWV8BOBvwZbZg/c+/3eyZhxpnXNDIdiE+DOj8Mgs7zqmPjGcOTNF7En0Zy7ki 5/67Zp0/87MdAA6OgTDanY/G/7aChaRNthhR/Aya7bzSw65iL4dFvvRsSGxcDuN9odo5 1UzRNX/fB/Yavq8wwP2phnBClAxi+CjsCVxAmDwnAFOKdWCxmS+//KpaHijUn6Fc0PbZ +JaA== X-Gm-Message-State: AOAM532yJU2Q9g/0l/I0jDG5KMS4ZzjJs1A3GzYFKSndVQFWry9EN8Zc 7ONZwHLuoUuw7D18+17hzg== X-Received: by 2002:a17:90b:1e10:b0:1ce:8478:ea09 with SMTP id pg16-20020a17090b1e1000b001ce8478ea09mr4767019pjb.134.1650463559607; Wed, 20 Apr 2022 07:05:59 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id br10-20020a056a00440a00b0050a777cd10csm10959178pfb.91.2022.04.20.07.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 07:05:59 -0700 (PDT) From: Pingfan Liu To: x86@kernel.org Cc: Pingfan Liu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Maciej W. Rozycki" , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCH 5/9] x86/irq: place for_each_active_irq() in rcu read section Date: Wed, 20 Apr 2022 22:05:17 +0800 Message-Id: <20220420140521.45361-6-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220420140521.45361-1-kernelfans@gmail.com> References: <20220420140521.45361-1-kernelfans@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Since there are access to irq_desc, and no preemption is provided at the involved, it requires rcu read lock to protect irq_desc. Signed-off-by: Pingfan Liu Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: "Maciej W. Rozycki" Cc: Marc Zyngier Cc: linux-kernel@vger.kernel.org To: x86@kernel.org --- arch/x86/kernel/apic/io_apic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index c1bb384935b0..4bb16edcbe4d 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -1333,6 +1333,7 @@ void __init print_IO_APICs(void) print_IO_APIC(ioapic_idx); printk(KERN_DEBUG "IRQ to pin mappings:\n"); + rcu_read_lock(); for_each_active_irq(irq) { struct irq_pin_list *entry; struct irq_chip *chip; @@ -1352,6 +1353,7 @@ void __init print_IO_APICs(void) pr_cont("-> %d:%d", entry->apic, entry->pin); pr_cont("\n"); } + rcu_read_unlock(); printk(KERN_INFO ".................................... done.\n"); } @@ -2009,6 +2011,7 @@ static inline void init_IO_APIC_traps(void) struct irq_cfg *cfg; unsigned int irq; + /* The early boot stage is free of irq_desc release */ for_each_active_irq(irq) { cfg = irq_cfg(irq); if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) { -- 2.31.1