Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp605630pxb; Wed, 27 Jan 2021 16:31:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL1m1W99P3knqDF2uo41Aj8ewfXqzJuFqBAPwJW/grc26WlR8wynrL0ORdZV6Q+j+Zelab X-Received: by 2002:a05:6402:1398:: with SMTP id b24mr10900879edv.108.1611793917378; Wed, 27 Jan 2021 16:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611793917; cv=none; d=google.com; s=arc-20160816; b=lpUnXLi53+VK/QQaqsWDXVnYN2ZI1zkTEtIBCtMbtxuaeO0pJfoQHCC6sgZAqJo3/O lSoEVd5Di7CZvdjuuHLGiMfZzTA5K9hrtUW92am9DPntmVbXN9Q5fE5XgXPkO5r2rYrp ltLssk96qeA4GYBDjX91QaSoH1FLqECmIAk1s0zSwwiOiSQxvTOlYysSwlrXzr7QmLvi 1c35yVjLXbA9NIJuyPti6yh5hU97wGab6J2bYHBJifrLwq8RfCe51GIJTu6SuQrB8UZ+ uQZ1MFdhIrdjWnl6Ua0CZUBJBWu49EgmZGkL4nrAW0lxPI9+XSPjnr14ftNdkkyZyHDt DPqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0Mhh/akzjPoseL7U0XdSub0BjA1s8gsgYat7JnzsjGc=; b=ZV3eBY3xacHreyPgSlmCWSq8ox5enPEgKfIpnbpSzAT78ZI5qXigsWaLWO+Qj3iVYj X/HNe86ITo0wJA5BeFKfe9sA6dpCDTFn3ayiiaAqTddHSg8KflEM4NdUwp6g6q+5+mRx ZkZHrtoyj/LI1FApcfWlk5b+LbKQ1AvbgeWTlkpUY84vOAoyRH74ADtz0ZEG+x3OLtNZ A+WZxE7k+ntHmaoqtHJcKdtQvxKmPwv8N95uIx80w73LsEMaWd2CdVy/+FV+ICTHlWOX +YqtsUin+ECeaKnv8C2teTayawKF8AlDX5E/bQaeajMbd23shQeBdXABN8VQwWNsmNTh XbXw== ARC-Authentication-Results: i=1; mx.google.com; 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 gg14si1526113ejb.367.2021.01.27.16.31.32; Wed, 27 Jan 2021 16:31:57 -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; 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 S233481AbhA0VQd (ORCPT + 99 others); Wed, 27 Jan 2021 16:16:33 -0500 Received: from elvis.franken.de ([193.175.24.41]:60530 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231927AbhA0VQb (ORCPT ); Wed, 27 Jan 2021 16:16:31 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l4s9k-0003fj-00; Wed, 27 Jan 2021 22:15:16 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id F222CC0AAF; Wed, 27 Jan 2021 22:15:06 +0100 (CET) Date: Wed, 27 Jan 2021 22:15:06 +0100 From: Thomas Bogendoerfer To: Peter Zijlstra Cc: Jiaxun Yang , Tiezhu Yang , 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: <20210127211506.GA21163@alpha.franken.de> References: <1609246561-5474-1-git-send-email-yangtiezhu@loongson.cn> <1609246561-5474-2-git-send-email-yangtiezhu@loongson.cn> <20210104105904.GK3021@hirez.programming.kicks-ass.net> <0712b131-715a-a83a-bc9e-61405824ff0e@flygoat.com> <20210105101806.GG3040@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210105101806.GG3040@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2021 at 11:18:06AM +0100, Peter Zijlstra wrote: > On Tue, Jan 05, 2021 at 11:45:37AM +0800, Jiaxun Yang wrote: > > 在 2021/1/4 下午6:59, Peter Zijlstra 写道: > > > 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? > > > > Hi all, > > > > In MIPS world it's impossible to raise a thread to 64bit without kernel > > aware. > > Without STATUS.UX set it will trigger reserved instruction exception when > > trying > > to run 64bit instructions. > > The other way around is the case on x86, a 64bit program can create and > execute 32bit code sections without the kernel being aware. But if > clearing STATUS.UX has the same issue as setting it, that should not be > a problem for you. > > > However it may be possible to run with 32bit ABI without > > TIF_32BIT_REGS if user program didn't get ELF ABI right. I think > > that's out of our current consideration. > > Fair enough. > > > > The thing x86 does today is look at it's pt_regs state to determine the > > > actual state. > > It is possible to look at pt_regs Status.UX bit on MIPS. But it seems > > unnecessary > > as user can't change it. > > Ok, good. Then no objection, proceed! :-) this patch aims more to mips-next, while patch 2 and 3 are targeting tools/perf. Should I take them into mips-next, too ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]