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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 B7048C433E0 for ; Mon, 4 Jan 2021 11:01:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B1DE21D93 for ; Mon, 4 Jan 2021 11:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbhADLBM (ORCPT ); Mon, 4 Jan 2021 06:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbhADLBL (ORCPT ); Mon, 4 Jan 2021 06:01:11 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23217C061574; Mon, 4 Jan 2021 03:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mhrOwaAhI1UDmmcXdIWUBJdkLN1PFDKL46QLbpMb4OE=; b=t7EcSy1/+qFRoVVLaSlSHi7QsH 7zXfhq5/F/jyb/cnYAdtGAaot76mgGHhyRfjNmuwi9kx84+M9lAiYQ7LceCnCL+iJhif3nYzv5szz Iju7r9DWrtyZjEse7Xkf3GX5YLe7nT56D5HWyN9nEkR9nIGGuWqPoy5NAPd2sXHEpzhp4UN6S68Em K4kCHuMnlcag11zob/PH40je2+u18joRj/YGJI1GFVRIB/isA8rkC+ojFljAbHJd+37OepLnz1wVc 8kkqmMp2j+Yb27/zhbqoB2uApubThXl1y3Ro9RrkW4ir5bdPh41ENvtjOkmhPQsshwq7fcbmiLSiZ r4iuKmug==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1kwNZq-0000Rm-Pa; Mon, 04 Jan 2021 10:59:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E961F30377D; Mon, 4 Jan 2021 11:59:04 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CC6BB20298581; Mon, 4 Jan 2021 11:59:04 +0100 (CET) Date: Mon, 4 Jan 2021 11:59:04 +0100 From: Peter Zijlstra To: Tiezhu Yang Cc: Thomas Bogendoerfer , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , David Daney , Ralf Baechle , Archer Yan , x86@kernel.org Subject: Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf Message-ID: <20210104105904.GK3021@hirez.programming.kicks-ass.net> References: <1609246561-5474-1-git-send-email-yangtiezhu@loongson.cn> <1609246561-5474-2-git-send-email-yangtiezhu@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1609246561-5474-2-git-send-email-yangtiezhu@loongson.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote: > +u64 perf_reg_abi(struct task_struct *tsk) > +{ > + if (test_tsk_thread_flag(tsk, TIF_32BIT_REGS)) > + return PERF_SAMPLE_REGS_ABI_32; > + else > + return PERF_SAMPLE_REGS_ABI_64; > +} So we recently changed this on x86 to not rely on TIF flags. IIRC the problem is that on x86 you can change the mode of a task without the kernel being aware of it. Is something like that possible on MIPS as well? The thing x86 does today is look at it's pt_regs state to determine the actual state.