From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 794D1C43613 for ; Mon, 24 Jun 2019 13:22:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4B80A204FD for ; Mon, 24 Jun 2019 13:22:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kbBxdx7l"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="eDt6mjbo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B80A204FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/ip2ij50YjHiP8jghoAYywhyGKRa5/DcQaUA7UzEPwM=; b=kbBxdx7l0N6G8V tkZcWcFtlflFIdmHBsjRNnuJdM5HsE4E82rHCygTENclvH3bHqaI6WRGmNrzO6y1hzVVdGbi7Xyvv C/4JIUn8WiH6oplYSd51Wd4nKNe6YORwsUEpJe8SoPWEk6d0tXJW/WnBDucwQl3Xnvm5ADtEtbKIO VIdRHUvIT2W9dG/QpDTxe/hcfktOxca/s5HvtGBAnaxPCrPhsfj6tRsvtGAAbiTdxnmJF0VOv8gmi VqXvGV5ymgqDohRQj+m5pERBNDLUWz71wrqdSmv7wUf9MSmJ/S9cYyTlqS2jklsXEwztnTDyYjGhE zJ2ZjCWwIHc7WhwqD6/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hfOvN-0006ko-Ss; Mon, 24 Jun 2019 13:22:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hfOud-0006Di-2a for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2019 13:21:37 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D48C92133F; Mon, 24 Jun 2019 13:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561382494; bh=9ELmp3ckM1SNaxjhHehS21dBJzYbmjQUXzH1W0gDRd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eDt6mjboezKiMPi593uwLjkuZhgMZpY9mcTV9T6q5lXacg1nyN2aPv747AJtlrKFI Sgv5uLIFoA0URSp+YDVd2ZzylWbFIxFdUAOBKWS73kO2diXRFrmu9n4PhkmGUayWJE AgdIbj45lYu0/YFzxaxVT32ITEnUa35TY5Kcr1KQ= Date: Mon, 24 Jun 2019 14:21:29 +0100 From: Will Deacon To: jinho lim Subject: Re: [PATCH v2] arm64: rename dump_instr as dump_kernel_instr Message-ID: <20190624132129.4c772nkjbrilxtcy@willie-the-truck> References: <20190620065249.24112-1-jordan.lim@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190620065249.24112-1-jordan.lim@samsung.com> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190624_062135_168319_E58574DA X-CRM114-Status: GOOD ( 16.24 ) 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@arm.com, anshuman.khandual@arm.com, marc.zyngier@arm.com, andreyknvl@google.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, seroto7@gmail.com, ebiederm@xmission.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 20, 2019 at 03:52:49PM +0900, jinho lim wrote: > [v2] The version information is not usually part of the commit message. Please drop that... > dump_kernel_instr does not work for user mode. > rename dump_instr function and remove __dump_instr. ... and rewrite this so it explains the problem that you're solving. > Signed-off-by: jinho lim > --- > > Thanks for review, I rename dump_instr function and merge __dump_instr in it. > > arch/arm64/kernel/traps.c | 29 ++++++++++++++--------------- > 1 file changed, 14 insertions(+), 15 deletions(-) > > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index ccc13b45d9b1..7053165cb31a 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -66,11 +66,20 @@ static void dump_backtrace_entry(unsigned long where) > printk(" %pS\n", (void *)where); > } > > -static void __dump_instr(const char *lvl, struct pt_regs *regs) > +static void dump_kernel_instr(const char *lvl, struct pt_regs *regs) > { > - unsigned long addr = instruction_pointer(regs); > + unsigned long addr; > char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str; > int i; > + mm_segment_t fs; > + > + if (user_mode(regs)) > + return; > + > + addr = instruction_pointer(regs); > + > + fs = get_fs(); > + set_fs(KERNEL_DS); Actually, if we use aarch64_insn_read() instead of get_user() then we can avoid having to mess directly with the fs and we'll also get endianness correction for free when running a big-endian kernel. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel