From patchwork Fri Sep 24 13:28:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12515515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C4CCC433F5 for ; Fri, 24 Sep 2021 13:33:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0283661029 for ; Fri, 24 Sep 2021 13:33:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0283661029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PNZO/1fupoZRLauiBslhxfG2mQBGjrcPQnHmMs8M5nU=; b=1FERUHZQ7J3csA z/gYkTGYXMu17ocY8T/hHVnLnLrooPB9R64vhylt/GeZTmD4E1qz3fBTkI4j2xk+t4bAJR+kQoqhs Y9EkEddz1Me8qToPveXfPugUmUiXMswALwKm3CqGe60L0SAndYXYXul3cphLfLY8F9TvYKDwuWZVP B3lde7Lk9Cq/wIXhNek6ZUTNCi2sWTEBxbvGTVYuV3MohKPxdfC8p4i5WWZ46ds/lMU1p20Xx5uG7 y9Msl5LZJD34Rsp9vR24yS5aff8tdds71SgSzCmy4Ze/6+xkmBaPO/Hk8M21/COsRvzJdUKcAStL/ xIt7k+gRjYF4DEBEQyVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlIf-00Ebai-3c; Fri, 24 Sep 2021 13:31:38 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlGK-00Eah3-JP for linux-arm-kernel@lists.infradead.org; Fri, 24 Sep 2021 13:29:14 +0000 Received: by mail-pj1-x102e.google.com with SMTP id lb1-20020a17090b4a4100b001993f863df2so7537357pjb.5 for ; Fri, 24 Sep 2021 06:29:11 -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=LuVRHSoDHvh0b+vTtC4laKIXlpYzxfgmhQy9f1AfUOI=; b=gGTSJviVEt/s+MrhWx9aPz9ihCm0qsO/fCFFtb4Khkk6fLbyLAoIOHD4JvmMPFTWuf 5iyVK29+jf5B6N+wJa8rA5S/lfcbl4Qy05WJM9+TegpeBIK7QIPEFBCu1zSJhvwZAmi3 UIkrPK6Y8AZp46sV+dj5AkHykzwE56KMaqeOm5c9Lv7JP7Q1NNPhzHqG9V+0fDHZbK8V OxJyrwtustC0XuXrLWT2loJUBqIxpcDRb2whj5nhqn/CP+pfUknkylRGAVnPrcKgkahM 4wtLQOO+THDYm1FXKGYlJEsUgMRvJS1dqAzZIWKMls8QOcBQtmugjj8F2oKYHlKgvDDA cB8g== 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=LuVRHSoDHvh0b+vTtC4laKIXlpYzxfgmhQy9f1AfUOI=; b=Rk+Ch1LMKPS5ZfDqrLlihwgswLlykIBNjTs+Jwe+anTO8m0wtjjZrdA42qwKl3SxWL 01pNexdUMotaTFKrgyX7r1Bxs8MsSNc5vRigiIUXhQzsAl+KYO3ORTUv5TMjeBAQ/+6C ck6TBk804xk7CDLhTyHzohYs2AJ4ZBjaNRKUHwnpHfSKBMW2i3UmJhXLgjgpCeLIoElV CrgmRtzw0+kz9VQsEWytcLj4ApwzMu6UhAJYNWMNoWtNI7oEH8lqh4KtqPZ++KAH0YpR zdLxk33NJ5y/FJSce2gBdnBWnTaZa7xGsndGf+YXZfWbK00OgesTgI2HuR1BUh/Gs/Ti gRcw== X-Gm-Message-State: AOAM531sx5VXiUFxNZmeOZ7HT9o7styBXdKH/AqunAzOtOadT6hGywuz ozeHPiac1PVr7jXjboLymw== X-Google-Smtp-Source: ABdhPJzYIijoWtStXvdoV1AKicvCc+7W5u5sjvbscGWsbaGQ1V8Dhcisw6emmMky5QdKM+cXIBoX5Q== X-Received: by 2002:a17:90b:11c9:: with SMTP id gv9mr2110466pjb.116.1632490151478; Fri, 24 Sep 2021 06:29:11 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 26sm11756573pgx.72.2021.09.24.06.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 06:29:11 -0700 (PDT) From: Pingfan Liu To: linux-kernel@vger.kernel.org Cc: Pingfan Liu , Thomas Gleixner , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Yuichi Ito , linux-arm-kernel@lists.infradead.org Subject: [PATCHv2 3/5] kernel/irq: make irq_{enter, exit}() in handle_domain_irq() arch optional Date: Fri, 24 Sep 2021 21:28:35 +0800 Message-Id: <20210924132837.45994-4-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924132837.45994-1-kernelfans@gmail.com> References: <20210924132837.45994-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_062912_683030_744063DC X-CRM114-Status: GOOD ( 11.94 ) 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 handle_domain_irq() contains two major parts: -1. irq_enter()/irq_exit(), which serves as hooks for rcu and trace etc. -2. irq mapping and dispatching After the introduction of irqentry_enter()/irqentry_exit() and arch specific counterpart (e.g. arm64), roughly speaking, rcu_irq_enter() has already been called. Hence here comes requirement to move irq_enter/irq_exit out of handle_domain_irq(). And arches should handle about irq_enter_rcu()/irq_exit_rcu() by themself. Since there is still arches, which does not adopt irqentry_enter(), let irq_enter()/irq_exit() arch optional in handle_domain_irq(). Signed-off-by: Pingfan Liu Cc: Thomas Gleixner Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Joey Gouly Cc: Sami Tolvanen Cc: Julien Thierry Cc: Yuichi Ito Cc: linux-arm-kernel@lists.infradead.org To: linux-kernel@vger.kernel.org --- kernel/irq/Kconfig | 3 +++ kernel/irq/irqdesc.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig index fbc54c2a7f23..defa1db2d664 100644 --- a/kernel/irq/Kconfig +++ b/kernel/irq/Kconfig @@ -100,6 +100,9 @@ config IRQ_MSI_IOMMU config HANDLE_DOMAIN_IRQ bool +config HAVE_ARCH_IRQENTRY + bool + config IRQ_TIMINGS bool diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 4e3c29bb603c..fd5dd9d278b5 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -693,7 +693,9 @@ int handle_domain_irq(struct irq_domain *domain, struct irq_desc *desc; int ret = 0; +#ifndef CONFIG_HAVE_ARCH_IRQENTRY irq_enter(); +#endif /* The irqdomain code provides boundary checks */ desc = irq_resolve_mapping(domain, hwirq); @@ -702,7 +704,9 @@ int handle_domain_irq(struct irq_domain *domain, else ret = -EINVAL; +#ifndef CONFIG_HAVE_ARCH_IRQENTRY irq_exit(); +#endif set_irq_regs(old_regs); return ret; }