From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460AbbIGPuz (ORCPT ); Mon, 7 Sep 2015 11:50:55 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:33098 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbbIGPux (ORCPT ); Mon, 7 Sep 2015 11:50:53 -0400 Subject: Re: [RFC PATCH 1/3] arm64: entry: Remove unnecessary calculation for S_SP in EL1h Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Jungseok Lee In-Reply-To: <20150907145646.GB13786@leverpostej> Date: Tue, 8 Sep 2015 00:51:04 +0900 Cc: Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Dave P Martin , James Morse Content-Transfer-Encoding: 7bit Message-Id: <9A8464CF-B1F4-4CB1-A04C-37EE8F10EE29@gmail.com> References: <1441376587-12979-1-git-send-email-jungseoklee85@gmail.com> <1441376587-12979-2-git-send-email-jungseoklee85@gmail.com> <20150907145646.GB13786@leverpostej> To: Mark Rutland X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sep 7, 2015, at 11:56 PM, Mark Rutland wrote: Hi Mark, > On Fri, Sep 04, 2015 at 03:23:05PM +0100, Jungseok Lee wrote: >> Under EL1h, S_SP data is not seen in kernel_exit. Thus, x21 calculation >> is not needed in kernel_entry. Currently, S_SP information is vaild only >> when sp_el0 is used. > > I don't think this is true. The generic BUG implementation will grab the > saved SP from the pt_regs, and with this change we'll report whatever > happened to be in x21 instead. > >> Signed-off-by: Jungseok Lee >> --- >> arch/arm64/kernel/entry.S | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S >> index e163518..d23ca0d 100644 >> --- a/arch/arm64/kernel/entry.S >> +++ b/arch/arm64/kernel/entry.S >> @@ -91,8 +91,6 @@ >> get_thread_info tsk // Ensure MDSCR_EL1.SS is clear, >> ldr x19, [tsk, #TI_FLAGS] // since we can unmask debug >> disable_step_tsk x19, x20 // exceptions when scheduling. >> - .else >> - add x21, sp, #S_FRAME_SIZE >> .endif >> mrs x22, elr_el1 >> mrs x23, spsr_el1 > > Immediately after this we do: > > stp lr, x21, [sp, #S_LR] > > To store the LR and SP to the pt_regs which bug_handler would use. > > Am I missing smoething? No, You're right. As James mentioned, x21 is used in do_sp_pc_abort. Thanks for the comment. Best Regards Jungseok Lee