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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 06107C433DB for ; Mon, 1 Feb 2021 12:24:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 27C2364E94 for ; Mon, 1 Feb 2021 12:24:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27C2364E94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 852796B0070; Mon, 1 Feb 2021 07:24:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8029B6B0071; Mon, 1 Feb 2021 07:24:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 719B36B0073; Mon, 1 Feb 2021 07:24:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id 5AC5F6B0070 for ; Mon, 1 Feb 2021 07:24:10 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 22CAC181AC212 for ; Mon, 1 Feb 2021 12:24:10 +0000 (UTC) X-FDA: 77769616260.16.side56_160ea9b275c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id EDED1100E6903 for ; Mon, 1 Feb 2021 12:24:09 +0000 (UTC) X-HE-Tag: side56_160ea9b275c2 X-Filterd-Recvd-Size: 2373 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 12:24:09 +0000 (UTC) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l6YFS-0000Vn-00; Mon, 01 Feb 2021 13:24:06 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 7C044C0CEC; Mon, 1 Feb 2021 13:23:52 +0100 (CET) Date: Mon, 1 Feb 2021 13:23:52 +0100 From: Thomas Bogendoerfer To: Huang Pei Cc: ambrosehua@gmail.com, Bibo Mao , Andrew Morton , linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Jiaxun Yang , Paul Burton , Li Xuefeng , Yang Tiezhu , Gao Juxin , Fuxin Zhang , Huacai Chen Subject: Re: [PATCH] MIPS: fix kernel_stack_pointer() Message-ID: <20210201122352.GA8095@alpha.franken.de> References: <20210129043507.30488-1-huangpei@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210129043507.30488-1-huangpei@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 29, 2021 at 12:35:07PM +0800, Huang Pei wrote: > MIPS always save kernel stack pointer in regs[29] > > Signed-off-by: Huang Pei > --- > arch/mips/include/asm/ptrace.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h > index 1e76774b36dd..daf3cf244ea9 100644 > --- a/arch/mips/include/asm/ptrace.h > +++ b/arch/mips/include/asm/ptrace.h > @@ -53,7 +53,7 @@ struct pt_regs { > > static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) > { > - return regs->regs[31]; > + return regs->regs[29]; hmm, I'm still wondering where the trick is... looks like this is used for uprobes, so nobody has ever used uprobes or I'm missing something. How did you find that ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]