From patchwork Fri Sep 24 13:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12515547 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=ham 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 8DAD2C433EF for ; Fri, 24 Sep 2021 13:34:30 +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 5EA1461039 for ; Fri, 24 Sep 2021 13:34:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5EA1461039 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=yg4n7QQYu7S1yfzTOVQfksIfE0NoAm4BpZbDPeaLvMY=; b=ZhCFWCIHOVEmEH NcU5jN4yKpcVyEKrOzyaLIJR+/RyhblzlBiiEq+Z6zUxVAyHAJn7pBbPmKMzmKmsiBloHn6zMXAR+ Py1/IfLrOs89xVJbdQPfGUpH0IM8gUp0zRLIbAzOXaYwlCg0dCxp0rGpdv1WZHxQel4w+jG0wksi3 ym6X5lKCFHsa3h8aySWgc1z90PgY/HX2Of5pm2TrVaI7YD8BjaazcAdPIffiP5PbV3ykzpGcjXo3I 01rritLx6BEYNV43H653guQdCMJlpt/FT93hHt/+hToKDDrn2wvJ3CZERORZ1jVD6w/nEUAWSQ3xR B3cmElcwjB6UmU4xdcxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlJZ-00Ebxu-Pu; Fri, 24 Sep 2021 13:32:34 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlGP-00Eaj2-US for linux-arm-kernel@lists.infradead.org; Fri, 24 Sep 2021 13:29:19 +0000 Received: by mail-pl1-x62d.google.com with SMTP id l6so6456541plh.9 for ; Fri, 24 Sep 2021 06:29:17 -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=/Uue+yztpX5IM7kP0vfiTVA2GtP2LIyQitnNsalGpdo=; b=ICWjXmDPNT7mP37H9Ct+Iwt9gOslgCNFdX+RO8yQAQFsW+YFBsIU8abgsW5964B2PM +kglcXD+s5Zt37TzAT+FIY6wJbJ32W2Rru2aJq8g9M29AVokeJSZHEyvbs7HysaReRDz XFVcYvAgfPCpH2LUVdyJh0mWRv6IIR0swoEBSgOaCn9uwxhWukDLDTsd4CzhBcEHa13Q 5AW14pdksgsVq5r/p5qzNrQxr+fk3kHYr35k1JdCFTPxxySav3G7QmMSuGsP8rjdgyiS qEtI217++EolPYTaGeUrgq5t2E9uYLUKUkyI5jdm8AljOjOjuML4SCv/VAzqGycXn69K pe+w== 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=/Uue+yztpX5IM7kP0vfiTVA2GtP2LIyQitnNsalGpdo=; b=6zPgmbzxIEfBQ96Oh/nl6W9hAy9R7KL3p0uZHGi2rACysPNeO248aa+Fv3fc0hGEje Tw0Myp9NQHA49wWErqgq8wTjRZgqbrHp8P4CfFKJI/K1xVxQI1jmoXQWBmCP6ekmveY4 96CDmjIet6k/QWuvbEgohqqOJsupXHJ5xmxpBN0AMYgDcUwp0pY+u9uYcT/xOmrSTcbI 33TGx4EPxumoWA7kX86Fc4MTZGs8h8lg07E1oPuxwhDZGbDFKlHPsbg1il49eTF2erYe etoempMRpRADQlYcQ3mVC0RJC+QOu2SPdTMdpos3mSTkILJnBOyjnBe2+8aozc+/X6MP rLrQ== X-Gm-Message-State: AOAM531SJHXyrFMnvFujBwkbVVIF5YtiGjy8hP3YIId1h+xObyh8F+/b yp+QHnsJ8MDmfatxLzNfTzu0YE6b8Q== X-Google-Smtp-Source: ABdhPJydAbj296V1R49Fk2kv5TFPlIv5RgcrNJwUoCYjkaac0cwhj428TdO8RO/PFkKoS6MFkrVV+A== X-Received: by 2002:a17:90b:3715:: with SMTP id mg21mr2297406pjb.186.1632490156639; Fri, 24 Sep 2021 06:29:16 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 06:29:16 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Thomas Gleixner , Yuichi Ito , linux-kernel@vger.kernel.org Subject: [PATCHv2 4/5] irqchip/GICv3: let gic_handle_irq() utilize irqentry on arm64 Date: Fri, 24 Sep 2021 21:28:36 +0800 Message-Id: <20210924132837.45994-5-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_062918_029666_7C8CE7F4 X-CRM114-Status: GOOD ( 11.91 ) 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 The call to rcu_irq_enter() originated from gic_handle_irq() is redundant now, since arm64 has enter_from_kernel_mode() akin to irqenter_entry(), which has already called rcu_irq_enter(). Based on code analysis, the redundant can raise some mistake, e.g. rcu_data->dynticks_nmi_nesting inc 2, which causes rcu_is_cpu_rrupt_from_idle() unexpected. So eliminate the call to irq_enter() in handle_domain_irq(). And accordingly supplementing irq_enter_rcu(). Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Joey Gouly Cc: Sami Tolvanen Cc: Julien Thierry Cc: Thomas Gleixner Cc: Yuichi Ito Cc: linux-kernel@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- arch/arm64/Kconfig | 1 + drivers/irqchip/irq-gic-v3.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5c7ae4c3954b..d29bae38a951 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -98,6 +98,7 @@ config ARM64 select ARCH_HAS_UBSAN_SANITIZE_ALL select ARM_AMBA select ARM_ARCH_TIMER + select HAVE_ARCH_IRQENTRY select ARM_GIC select AUDIT_ARCH_COMPAT_GENERIC select ARM_GIC_V2M if PCI diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 89dcec902a82..906538fa8771 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -729,10 +729,12 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs else isb(); + irq_enter_rcu(); if (handle_domain_irq(gic_data.domain, irqnr, regs)) { WARN_ONCE(true, "Unexpected interrupt received!\n"); gic_deactivate_unhandled(irqnr); } + irq_exit_rcu(); } static u32 gic_get_pribits(void)