From patchwork Mon Dec 14 02:25:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11971173 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 58A42C4361B for ; Mon, 14 Dec 2020 02:29:19 +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 E5A5822240 for ; Mon, 14 Dec 2020 02:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5A5822240 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=lNHVA6MIQ6GFPEGJBJ8Ao4o6yfbTDSIrsbOJ02L6n14=; b=qIChloD+85k+3rXFeHaa0ekKL1 0t5Kgc14U2XgTB6HllC06sUNiVu83U/oPqggPUL7CeVGj20mJ0e98ydru8L9f+zTALWXrYW2rjhjV eY6v3/FzCAfLnc6hhLNVl5AHcqJ/OyH0bivk9OKXJPVr6n/I3/qFT4a/Nf6ks0NtCEjZdD1S61jWF qdpVh3OAYvF0+W/UkmasMr7q/DeXTdCSbdpDJsbiUzg1esK0GKfGBFxs+ewW2AzZbf8CorP3tWIKT AzTaoXJ1TSDft9YgS26Szv9OIVG1m6zmv/bjx7sfpHq8b8d+kon8yR17dPzPCDDS2thket5Ug90Tb tT/p832g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodar-0002Rc-Ea; Mon, 14 Dec 2020 02:28:09 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodap-0002R6-7K for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 02:28:08 +0000 Received: by mail-pj1-x1042.google.com with SMTP id iq13so5405116pjb.3 for ; Sun, 13 Dec 2020 18:28:06 -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=mkeZgFrWNtwvlgO0x2SwOEsdL2dSm3JTnIiHUjKwwMw=; b=UuD1lfsbKUeNF+K+/mAE9k6hzwu1neOHzNwXOo1D4wrpysOBWipW4MVcOAgf10zWoD mOu/l0JYXz6SUTn0nOm1j5/dd+ITCbNQG4UO1ZlDatAnnsj6udOMZjPFUZzbm5hoz3Lq 4nf04V0qcWPaj6cXXwrTkmARIZ60wVJNI1uiZq+WyK2CftEMb+J7DM1FqmSdDJN/9TWt UhyfMvsSqij18io4Gd1/8XYQYBv7LeSfDoUJc3EIA64fchHTjsJUIPJSvtEKlzUoUJp1 ylkdTh8kLOHLvSZqg6ewVKhl39H3fA1jssANMlS+6rCEWJ84J2vOfDIaRYUvHQDw/UX+ VSrw== 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=mkeZgFrWNtwvlgO0x2SwOEsdL2dSm3JTnIiHUjKwwMw=; b=YmXZszei9suDZp5Nq6euvVpqYfe6fKehM3o6i8c4/8YqOIrafKF+Cu0Pl0cAyYspdG 4A0IH4zC8Ff0v/QuXATqjTZ3BJ4+wZ6vhKkuHJ3FplGm1zw5RajYedemt2/qvJWdG7SO ZCIbHChD3sMBKtbAtza+GrNweY1rd9OHhA+gAqB53NxCuM+w6LZcUBohH/qeo3hA9lYh ugRy+iw5YaJmibuCOhAh2B0A3VnmZSpIJGPahXcBfExHoFn4SJoGFb5CZ8PhPr1e3IV6 WmJ3nrDeJEOlseaWEuXdIwFyS44la6Kz85siaTYrxIq4PHzSAPdAe0LCADcuAVBaGIk6 343g== X-Gm-Message-State: AOAM531QO2S/gynZ1N/9DxtrzsVFnOIyx8+Dr6z0V/NAs0Zk+/s4NCOY 2YSWJ6FdiuEqRek3rH+t3Iv/u7eBc2yioHs= X-Google-Smtp-Source: ABdhPJzsaoZK1g7l+cdQLwS+Z4AhJIjgWzNz5xIQIQGanuGSC1EwBS7UgxJafafz0baw601Y794d5g== X-Received: by 2002:a17:90a:970b:: with SMTP id x11mr23148956pjo.16.1607912884984; Sun, 13 Dec 2020 18:28:04 -0800 (PST) Received: from localhost.localdomain ([111.199.190.168]) by smtp.gmail.com with ESMTPSA id l197sm18118148pfd.97.2020.12.13.18.28.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 18:28:04 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional Date: Mon, 14 Dec 2020 10:25:50 +0800 Message-Id: <1607912752-12481-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201213_212807_327125_85D821DD X-CRM114-Status: GOOD ( 13.78 ) 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 Arches may implement their own counterpart of irq_enter/exit in the frontend. Hence make the pair in __handle_domain_irq() arch optional 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 --- kernel/irq/Kconfig | 4 ++++ kernel/irq/irqdesc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig index 164a031cfdb6..f17a9c8771c1 100644 --- a/kernel/irq/Kconfig +++ b/kernel/irq/Kconfig @@ -100,6 +100,10 @@ config IRQ_MSI_IOMMU config HANDLE_DOMAIN_IRQ bool +config ARCH_HAS_IRQENTRY_ENTER + bool + select HANDLE_DOMAIN_IRQ + config IRQ_TIMINGS bool diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 1a7723604399..77819e489f9b 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -669,7 +669,9 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, unsigned int irq = hwirq; int ret = 0; +#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER irq_enter(); +#endif #ifdef CONFIG_IRQ_DOMAIN if (lookup) @@ -687,7 +689,9 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, generic_handle_irq(irq); } +#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER irq_exit(); +#endif set_irq_regs(old_regs); return ret; } 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) From patchwork Mon Dec 14 02:25:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11971177 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 29625C4361B for ; Mon, 14 Dec 2020 02:29:28 +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 C1CB322240 for ; Mon, 14 Dec 2020 02:29:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1CB322240 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=avkVEURJuZpMrIVEF6X3bjCeeP+l8O8DEwlvXx6FO5Q=; b=ReNBQGoqXdR9R8ihF6CJqFMiNC SawmNb2bVYYX+mBlE9rlf2oOoO55EpudFHrb1pmM/cINEwaRT/Itq0SvGulgnX73yRz/VodvFbwO+ XxaO2HF4gmJX9rSL5/w7WYbK5i+ZeASx7hBi1DaBqkqeW/vQ0LoymwOar1BHtay524ia+fDztk+qq zdtqOTzT4w8hYdnykqH2i08piO3h9EaJ4mEjRD9TBVNqSMkqXbqdoskQ/65t0t+4aqc9wP3E7B89v cb3KCeuBEuBEvEfrMp3iR9fYs/U+sp1G7QT4qms85+M0OK8taV/T9gX/vE3nwRkHNF1Mbj5en8wuB pLUfS45g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodb3-0002Ts-IA; Mon, 14 Dec 2020 02:28:21 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodaz-0002Sw-Si for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 02:28:18 +0000 Received: by mail-pl1-x641.google.com with SMTP id g20so6995476plo.2 for ; Sun, 13 Dec 2020 18:28:17 -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=VGC2KvBXsdeABmWhBNM9L//IYhToK9rsi9x1CUt6we0=; b=ngKSfRmwLclQuH/l5w7k7OomfIaAt7G76ymIky65jMCF+63hZLipbrnl3bx6NDosWs /9x6hFg7XDCNYlix6KDJrppMm7jWSPF1M6WrXly+ckt7pznERCg4sv5//tulfDtwCGF7 Y+XIQZ8U+NQrW+K+1+rIBlam5zA+FN/At2MqzsTeI2zqM7JIhBn70YBtYBnhWGnHVukL 9P/AiNTioG7QmbYF4kjAYo2OY6GLwADBdfepCvUZnglleptbmlNwGNYPsTP6fUF9bWjv WHA8Iyx/QCrLwyD3AdG3h/QI7APHWbLWpT7lhHAwQNlmv1jU5xpJqbnwsycCuxJb4uqq LLQw== 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=VGC2KvBXsdeABmWhBNM9L//IYhToK9rsi9x1CUt6we0=; b=dmZTH54HDpo5NnvIpzMYCTqP0YfLEODZ14PAbSRFuM0rTIhccwL/3t6Jj2c2wV6ROO aQnrkJiPDPo7AnBNDGywZldFmryP81Q6fCBvvrHJbMdRJyww6czby78rmYfuL7j1uQkT 6EwfODj1/T9ldt/MRo+NK8LGYJMW9aJ4XiGAHALFWNeRpa2Wf7yiDcBERS9hTsWDrsHt Xlw3rWsEdsngXTC9wLJcMfSVxlM97MLYla4739zsHe05jPoSGakRkFi7doC9+LO4jeE5 Z7/9ONxx1Gda0YSLa7xJNkcIZanteV/ryoqIlPpNDxmL92q752rPcmZNe2Pm0HlLVmxP Aslg== X-Gm-Message-State: AOAM5312xJF3qMQzo45PlJQW5Zsygh7kLqoAI0bddfHgPP4soviZjJXO bINMh1u1eRgr4GiWtRL0o1rFys7IpBTtf6U= X-Google-Smtp-Source: ABdhPJw6bW9S8nMSv4IrYfYP49z3MSsSF5K2RsR7BcePsGFmY+zGXOu1RLWen191x0FmQ6x476XYQg== X-Received: by 2002:a17:902:70cc:b029:da:ccb4:c266 with SMTP id l12-20020a17090270ccb02900daccb4c266mr20516339plt.37.1607912895552; Sun, 13 Dec 2020 18:28:15 -0800 (PST) Received: from localhost.localdomain ([111.199.190.168]) by smtp.gmail.com with ESMTPSA id l197sm18118148pfd.97.2020.12.13.18.28.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 18:28:14 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] arm64/irq-gic-v3: make reschedule-ipi light weight Date: Mon, 14 Dec 2020 10:25:52 +0800 Message-Id: <1607912752-12481-3-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_212818_048657_C59F33CC X-CRM114-Status: GOOD ( 14.31 ) 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 To achieve the light weight as DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_reschedule_ipi) on x86, it had better treat irqnr differently at the frontend. And let IPI_RESCHEDULE call __irq_enter_raw() instead of 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 --- drivers/irqchip/irq-gic-v3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index a66e0b04e42b..777f5ace6862 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -642,6 +642,9 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs) nmi_exit(); } +/* RESCHEDULE IPI hwirq nr is 0, and the only raw one */ +static unsigned long raw_interrupt_mask = 1; + static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) { u32 irqnr; @@ -654,7 +657,10 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs return; } - irq_enter_rcu(); + if (raw_interrupt_mask & 1 << irqnr) + __irq_enter_raw(); + else + irq_enter_rcu(); if (gic_prio_masking_enabled()) { gic_pmr_mask_irqs(); gic_arch_enable_irqs(); @@ -675,7 +681,10 @@ 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(); + if (raw_interrupt_mask & 1 << irqnr) + __irq_exit_raw(); + else + irq_exit_rcu(); } static u32 gic_get_pribits(void)