Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13734916pxu; Mon, 4 Jan 2021 03:03:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzx0FF2UyU1j+bWL6L4hUGaMABHA5zvjhxbE8rUtF6XRBlzrRuBfcRBU2nMdplgPQYRRNPP X-Received: by 2002:a50:e848:: with SMTP id k8mr70070599edn.77.1609758179895; Mon, 04 Jan 2021 03:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609758179; cv=none; d=google.com; s=arc-20160816; b=mkfiR3UXn7cX/AdSeX4/OIsFmvgybubwjHwAygI+o+LQ1EC7YWM7qTWYblvoJeHuDm mIo3kREBLlWW8BFH5Guw1cQC+RyjkFr3qMbr61xgPTJ1hO3yFMkxOzSCE30nZGi3TGE5 ZoCUw4xgLiPamDdfTYXhoIm7vw/5V/X57eGua9m57/QAD0rJJ7KttIHPuM1VMDgu53lX y6aqrFBAbPjk+6scGs/TsaEF1cuWXoBLfU7QAVFAXVDpeC+YIOH02rVsVZ9F4Nxn/gzr FrC4Jp0hpgMyNvyEd24dqQNn8cE8Lv+zWhnWbKcEIum2K0QMsAePAPJd3Lxsz7GmxoKC 1G+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mhrOwaAhI1UDmmcXdIWUBJdkLN1PFDKL46QLbpMb4OE=; b=UqKvJfyoAjNA3v0NthfiLqPJtZrBG5JBNhcIyVoDoLLQ3BpyGy9dH+gHQP0aNhkvop zAOQdGHS2pBWqLfbsVTiNQyIVH0GFpmruG8szYS7NaAECFmqYjFN0s7Wmoq1h7Jr0Sl7 usrHnJ6JjMvOdcj3AMeYMJNJ6FPKweEYBFWPLU6H4iUKBaMnIkZ4IQTB+kbsy+sR2Ps2 98f2O9qyPkB4Y7tF0Sb8yO1xidEFJ9GdJas+wINBN9vuGw+am8xy8m0ACvpXBm4d/cgK ioLDr/r6OBVBi1pBRE0zMBEujGHFFSCaSCL+q7Jz2f3ZWf5uS94/a5W+KVYZcdPkU4ng JJ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="t7EcSy1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj28si31113929edb.352.2021.01.04.03.02.36; Mon, 04 Jan 2021 03:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="t7EcSy1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbhADLBL (ORCPT + 99 others); Mon, 4 Jan 2021 06:01:11 -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.