From patchwork Mon Dec 14 02:25:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11971175 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.7 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,URIBL_BLOCKED, 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 8E359C4361B for ; Mon, 14 Dec 2020 02:29:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 3AE3C22240 for ; Mon, 14 Dec 2020 02:29:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AE3C22240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ETuzNqFiDzyGo9UclK/LYVdbTS9xZyNbV2mv2gUfsHU=; b=KvEyQgEzNb48zXYwrkDBAwEpeo hkRdr2+7SWkKCYYB1YwQ/5Ev8EVOFq+V6FQxPVWwILDK5lHWmvz5vl4shyvNgrQFgj/GYwJM0/kZY v0GlBavgu/4qXlnX4iAYsRvV50XQqDiFYSB6vLKoaD4IO2e8YK2zfxJTwfrDJTBGjm7bUv/lSvus9 fz2yyCqsAzAoneRrcLUwhZTnxbFqQa+oQA5a++kn98s2fZEAS0JI6++F8veckPb6ctcEFTHj995m/ RGYkwoIGrFqB4cWukfX+bkZzAHk94PjtlM5ft3UDChinHkOejb7mc+KhIm2kdufVZoKzOFXm23eBI 2/FjO8AA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodax-0002Si-Jh; Mon, 14 Dec 2020 02:28:15 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodau-0002Rs-DL for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 02:28:13 +0000 Received: by mail-pj1-x1044.google.com with SMTP id lj6so4003554pjb.0 for ; Sun, 13 Dec 2020 18:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eeH0XfSKszLGKVrGZ7VZAhTDiPSmvGTY31V3/UnpmLo=; b=mNOW+Hhs5RXH8++ZN/1h9aT0saNDwQFdIBhAW5qUY6yEm+zqzASgqmb1v7KPXhrccG WXOCI4JG4hUTXo+bN7M6h0DRhBXN1CpN4rcY1HjMbSjRmBRAa/a9Es3iOYT4oZ0auuPB es2tOnq/bc0m7hnZO/iidBs/wJs2PhN3OFGkr40Cm8rJ93n/BcvnfHIFLwmr9FCbIjum XfXzZOIKfrDcwxa6/xAnP8QHbu7h+f+ikVuiEXO34PEc5m3cAqsR5W3qbuqfPH3YS3ri e5dI66YF64eFjbpF1N10wS+FxV9dNtoDohNCk6R/kIescJ6GPBJwDQBctRHBeoq2Fhwx W51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eeH0XfSKszLGKVrGZ7VZAhTDiPSmvGTY31V3/UnpmLo=; b=ulopjw5oP/iKx6YnY4Pp/HNR3yAXYzn3NYIvpD5vHnVmyYH3/+qOjRYOZDBdzL2m7v gKzlPu52opffOLWMQSNJZVWRUOtMrXN9LeJD34oE2g9S9k7rNMTNGPlrqZazEZr+Tbdz KqiDf7qDrAnBsj4bqFZQuc9fniSK6aByVU5J94fEs8u72tKyVTtzKH8ItYvGccybX0Pb tgr2glmwTTcLotOK9NDK+xM+leSJvIkm0dGywBrbVjJh6PM2cxnR/I6e5+Ks+lA1Bcyf Oq9MrLmmnFlSqV8JoPkY1jhWMrqDyS2kJRcvPXp8yvvwx6J9RtsI9znxII3IEC7w7kFv xMvg== X-Gm-Message-State: AOAM530LsSVb5GWWPzwyDgRswHvaHcntT7wmuP4+WvHNLp6Ez5mDD1rx C+36gNOnhnQu27JyVMu7Mj2L0Hu6+HEBVhw= X-Google-Smtp-Source: ABdhPJzGcJzt9OBZxsmw+2dx+yuaeky9JKwGb7Znv9y6YN9tLU+N5BIlxjcxRVr2U7peJAS9y3ARAg== X-Received: by 2002:a17:90a:4817:: with SMTP id a23mr22979922pjh.16.1607912890185; Sun, 13 Dec 2020 18:28:10 -0800 (PST) Received: from localhost.localdomain ([111.199.190.168]) by smtp.gmail.com with ESMTPSA id l197sm18118148pfd.97.2020.12.13.18.28.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 18:28:09 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] arm64/irq-gic-v3: make gic_handle_irq() cope with enter_from_kernel_mode() Date: Mon, 14 Dec 2020 10:25:51 +0800 Message-Id: <1607912752-12481-2-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1607912752-12481-1-git-send-email-kernelfans@gmail.com> References: <1607912752-12481-1-git-send-email-kernelfans@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201213_212812_837246_9EDB88C5 X-CRM114-Status: GOOD ( 15.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Julien Thierry , Catalin Marinas , Pingfan Liu , Marc Zyngier , Will Deacon MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The call to irq_enter() originated from gic_handle_irq() has already redundant, since arm64 has enter_from_kernel_mode() akin to irqenter_entry(). So eliminate the call in __handle_domain_irq(). And accordingly supplement irq_enter_rcu(). Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Julien Thierry To: linux-arm-kernel@lists.infradead.org --- arch/arm64/Kconfig | 1 + drivers/irqchip/irq-gic-v3.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a6b5b7ef40ae..84ffed84158f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -201,6 +201,7 @@ config ARM64 select SWIOTLB select SYSCTL_EXCEPTION_TRACE select THREAD_INFO_IN_TASK + select ARCH_HAS_IRQENTRY_ENTER help ARM 64-bit (AArch64) Linux support. diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 16fecc0febe8..a66e0b04e42b 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -654,14 +654,17 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs return; } + irq_enter_rcu(); if (gic_prio_masking_enabled()) { gic_pmr_mask_irqs(); gic_arch_enable_irqs(); } /* Check for special IDs first */ - if ((irqnr >= 1020 && irqnr <= 1023)) + if ((irqnr >= 1020 && irqnr <= 1023)) { + irq_exit_rcu(); return; + } if (static_branch_likely(&supports_deactivate_key)) gic_write_eoir(irqnr); @@ -672,6 +675,7 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs WARN_ONCE(true, "Unexpected interrupt received!\n"); gic_deactivate_unhandled(irqnr); } + irq_exit_rcu(); } static u32 gic_get_pribits(void)