From patchwork Thu Jan 31 18:23:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 10791153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C13C17E9 for ; Thu, 31 Jan 2019 18:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01CC0302B6 for ; Thu, 31 Jan 2019 18:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9FE0304C3; Thu, 31 Jan 2019 18:24:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E0B0302B6 for ; Thu, 31 Jan 2019 18:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=9fcNttGpvwnyXL9DO0ELaxGOx0ciW3WeyCOqz/SGar4=; b=VjTC1ISb/7FFJp O8WQiEnLW43OurMJRb13WMm/wJ0taYAalCIfD5dsdK14jmbHnNb4yehZ+lQTXjvWhbnu4xFkB/wmc LHjX6iO14D6Wnxb6Uu49WPSU6MbMGdWprW1IQoIe9qn7WXo1WC7MLTzUvJpur2xhN7aL4G3Xr/qaq asg9XiBh6chn/yVIKwVu7ZJ9qooLmlhNwNPm3tRsr/0AGCcTdMLVXEUK/WdWbXxIimLEwDUzsm8fP QMXhRoAAZnKO8AFpBBxfFi2nv768xEENyq155Hb+qPD+OdQaoXG2ClaUEKpvRIRG0OUk/CVQBsmvb lx9X0q8OyNFz5k4MMReg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpH0j-0004JF-Bo; Thu, 31 Jan 2019 18:24:25 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpH0N-0003zE-9c for linux-arm-kernel@lists.infradead.org; Thu, 31 Jan 2019 18:24:10 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C92DEBD; Thu, 31 Jan 2019 10:24:02 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C0B193F59C; Thu, 31 Jan 2019 10:24:00 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] arm64: entry: Remove unneeded need_resched() loop Date: Thu, 31 Jan 2019 18:23:37 +0000 Message-Id: <20190131182339.9835-2-valentin.schneider@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190131182339.9835-1-valentin.schneider@arm.com> References: <20190131182339.9835-1-valentin.schneider@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190131_102404_098821_F079F492 X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Julien Thierry , Marc Zyngier , Catalin Marinas , Will Deacon , Julien Grall , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Reported-by: Julien Thierry Reported-by: Will Deacon Signed-off-by: Valentin Schneider Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Julien Grall Cc: Julien Thierry Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Julien Thierry Acked-by: Will Deacon --- arch/arm64/kernel/entry.S | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 0ec0c46b2c0c..4d0c81f29a60 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -611,7 +611,7 @@ el1_irq: #ifdef CONFIG_PREEMPT ldr x24, [tsk, #TSK_TI_PREEMPT] // get preempt count cbnz x24, 1f // preempt count != 0 - bl el1_preempt + bl preempt_schedule_irq // irq en/disable is done inside 1: #endif #ifdef CONFIG_TRACE_IRQFLAGS @@ -620,15 +620,6 @@ el1_irq: kernel_exit 1 ENDPROC(el1_irq) -#ifdef CONFIG_PREEMPT -el1_preempt: - mov x24, lr -1: bl preempt_schedule_irq // irq en/disable is done inside - ldr x0, [tsk, #TSK_TI_FLAGS] // get new tasks TI_FLAGS - tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling? - ret x24 -#endif - /* * EL0 mode handlers. */ From patchwork Thu Jan 31 18:23:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 10791155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9C5791E for ; Thu, 31 Jan 2019 18:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEF12304C3 for ; Thu, 31 Jan 2019 18:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D33F53057B; Thu, 31 Jan 2019 18:24:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4834F304C3 for ; Thu, 31 Jan 2019 18:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=XveqOIv8bV8fDRPGvHTT7al8JTFvNcKR108F6bM5XUE=; b=fl7CJHk99G2W5o JnO7C+9OQmMPE0cGhWb/Oa4eTALfwI97gNvkIXO2+x0mDODcWOMuSCY3zpbgxe2CmD3nWXLZ2EqG7 Y1rDozyNm6lh6jI8PLeR7BSviXRMimkuJ/axttrqNMq0UbkLU/a5UafH5xvdcfagYxL9xaTo0gz6w UoqbE7iCjIQcbq/esY1rpTiMe4np5Lgy5OWRS+lv/MwvmKesGycJlvFb69O6Hy4ImcP6s9HAhaZ/3 yk1CyclaSGaUxcxaKoOx+06vywrXdFMBKMU3pd0e5ZyizqhQ7tgk+GPUFhAozLWeeGj4tTvyHMLWt TmRcTWt4uq6HeD4MnxYw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpH0u-0004T5-OP; Thu, 31 Jan 2019 18:24:36 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpH0P-00041h-5d for linux-arm-kernel@lists.infradead.org; Thu, 31 Jan 2019 18:24:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F1ACDA78; Thu, 31 Jan 2019 10:24:04 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9B7513F59C; Thu, 31 Jan 2019 10:24:03 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/3] ARM: entry: Remove unneeded need_resched() loop Date: Thu, 31 Jan 2019 18:23:38 +0000 Message-Id: <20190131182339.9835-3-valentin.schneider@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190131182339.9835-1-valentin.schneider@arm.com> References: <20190131182339.9835-1-valentin.schneider@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190131_102405_873576_ECB0DAE6 X-CRM114-Status: GOOD ( 11.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Will Deacon , Russell King , linux-arm-kernel@lists.infradead.org, Julien Thierry Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Signed-off-by: Valentin Schneider Cc: Russell King Cc: Thomas Gleixner Cc: Will Deacon Cc: Julien Thierry Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Julien Thierry --- arch/arm/kernel/entry-armv.S | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index e85a3af9ddeb..a7ac22e09bb2 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -220,7 +220,7 @@ __irq_svc: teq r8, #0 @ if preempt count != 0 movne r0, #0 @ force flags to 0 tst r0, #_TIF_NEED_RESCHED - blne svc_preempt + blne preempt_schedule_irq @ irq en/disable is done inside #endif svc_exit r5, irq = 1 @ return from exception @@ -229,16 +229,6 @@ ENDPROC(__irq_svc) .ltorg -#ifdef CONFIG_PREEMPT -svc_preempt: - mov r8, lr -1: bl preempt_schedule_irq @ irq en/disable is done inside - ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS - tst r0, #_TIF_NEED_RESCHED - reteq r8 @ go again - b 1b -#endif - __und_fault: @ Correct the PC such that it is pointing at the instruction @ which caused the fault. If the faulting instruction was ARM