From patchwork Mon Dec 21 11:30:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 58806 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp2536108lbb; Mon, 21 Dec 2015 03:31:56 -0800 (PST) X-Received: by 10.66.240.4 with SMTP id vw4mr26364614pac.9.1450697514699; Mon, 21 Dec 2015 03:31:54 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id he9si8574551pac.102.2015.12.21.03.31.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Dec 2015 03:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aAyfx-00006b-Kc; Mon, 21 Dec 2015 11:30:49 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aAyfs-0008Ny-Em for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2015 11:30:46 +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 653B749; Mon, 21 Dec 2015 03:29:56 -0800 (PST) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD0593F24D; Mon, 21 Dec 2015 03:30:21 -0800 (PST) Date: Mon, 21 Dec 2015 11:30:21 +0000 From: Will Deacon To: Jungseok Lee Subject: Re: [PATCH v8 9/4] arm64: remove irq_count and do_softirq_own_stack() Message-ID: <20151221113021.GH23092@arm.com> References: <1449226948-14251-1-git-send-email-james.morse@arm.com> <1450454507-8907-1-git-send-email-james.morse@arm.com> <68E0E2C7-A4C2-45C2-95C5-842FA807F918@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <68E0E2C7-A4C2-45C2-95C5-842FA807F918@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151221_033044_513967_20C4DCCA X-CRM114-Status: GOOD ( 12.10 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.101.70 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , James Morse , linux-arm-kernel@lists.infradead.org, AKASHI Takahiro Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On Sun, Dec 20, 2015 at 08:07:46PM +0900, Jungseok Lee wrote: > On Dec 19, 2015, at 1:01 AM, James Morse wrote: > > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > > index 0667fb7d8bb1..6745a9041f99 100644 > > --- a/arch/arm64/kernel/entry.S > > +++ b/arch/arm64/kernel/entry.S > > @@ -181,19 +181,20 @@ alternative_endif > > .macro irq_stack_entry > > mov x19, sp // preserve the original sp > > > > - this_cpu_ptr irq_stack, x25, x26 > > - > > /* > > - * Check the lowest address on irq_stack for the irq_count value, > > - * incremented by do_softirq_own_stack if we have re-enabled irqs > > - * while on the irq_stack. > > + * Compare sp and sp_el0, if the top ~(THREAD_SIZE - 1) bits match, > > + * we are on a task stack, and should switch to the irq stack. > > */ > > - ldr x26, [x25] > > - cbnz x26, 9998f // recursive use? > > + mrs x26, sp_el0 // already masked > > Nit: How about using 'get_thread_info x26'? Something like the following? Will --->8 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 6745a9041f99..c0db321db7e1 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -182,12 +182,12 @@ alternative_endif mov x19, sp // preserve the original sp /* - * Compare sp and sp_el0, if the top ~(THREAD_SIZE - 1) bits match, - * we are on a task stack, and should switch to the irq stack. + * Compare sp with the current thread_info, if the top + * ~(THREAD_SIZE - 1) bits match, we are on a task stack, and + * should switch to the irq stack. */ - mrs x26, sp_el0 // already masked and x25, x19, #~(THREAD_SIZE - 1) - cmp x25, x26 + cmp x25, tsk b.ne 9998f this_cpu_ptr irq_stack, x25, x26 @@ -406,10 +406,10 @@ el1_irq: bl trace_hardirqs_off #endif + get_thread_info tsk irq_handler #ifdef CONFIG_PREEMPT - get_thread_info tsk ldr w24, [tsk, #TI_PREEMPT] // get preempt count cbnz w24, 1f // preempt count != 0 ldr x0, [tsk, #TI_FLAGS] // get flags