Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1985609pxb; Fri, 29 Jan 2021 09:58:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQdCSypQrpqByrV1UlhE6FG9P/63XUD6k2mTLWjkDxB0t0EdczBGZprWkAORJ3+h/6YeAt X-Received: by 2002:aa7:d98a:: with SMTP id u10mr6434404eds.275.1611943126533; Fri, 29 Jan 2021 09:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611943126; cv=none; d=google.com; s=arc-20160816; b=JZK+BnaXORyMwGunJIKKu4QAdxZe/3RUHtcUId4YWjw0f4b63kyCqhlsTLK7x/33Zd rDNNBi94nfU4miMwzeqXRghNpqeU18mai3ifaIytPAZU4KXAvPJdVXPJk+tPXBfEAOPM 0TfcOYMM2C6t0942gczaKliUQlRTZsTSBONVqsxxJlcMdkrWK001IQ02FdPq8hXruSOR 62usZtnrGPRr6c/fKfDrojCC0fNp51/J9Vj3KuwC9ZRaf6hex4HLOq+p1sKI2eU8XhNJ ZAQLbRLZZlPyPVwfdkGGSGQCSA7UOUa3hie26m6ivxPY5wKJI6h1xyltT+UsCykiRdUs XHQA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kSF/8Ft7dWESFoCDDW8VM49eOulFgsCY/P2OXuNKL4w=; b=NsnrNMXW/wiQD6Yy5liv72y6uRpyRe6drclWW6HLaXKzSPIjodOSUxc4E7W5uMmA1t /tiPGjk81JxAeWWe9Cf7yMTGYq79UV1/MZXqBv67Qh+3jygIbjWBgER9WwUvy76y/ojI Dof4VO4/hMeohChtlLqOSJJ9jSi83Ibq3VNn+E3U/7NLggZWTQtLSYDtfW0Cq+i0usqF B78Ga2Fy0UGlJZpzj3kUPhCbeIxT0dNtIXMRWJkD8vb1P8FYFSfyx0tm2/V11ZH3x7Cb A7ynZGYG/DVLYZ4G8YR6Lw+/+Om8hQZyBkHjxhtjSSK0YEinQmFaaeuQidQdgMeCJ7gM S7NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lHZn6a58; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si5183953ejt.189.2021.01.29.09.58.22; Fri, 29 Jan 2021 09:58:46 -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=@kernel.org header.s=k20201202 header.b=lHZn6a58; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbhA2R45 (ORCPT + 99 others); Fri, 29 Jan 2021 12:56:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:41478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbhA2R4z (ORCPT ); Fri, 29 Jan 2021 12:56:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D346A64DFD; Fri, 29 Jan 2021 17:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611942974; bh=76vEgkr0lY2H1oivQ80gbBVHfJx1p6xaz5YbZTkVGBQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lHZn6a58VWB2LqQQr4UPdlNExEyqUf4kXBOZELsmazN0vOZemwnz4Uj6sm5JDudG2 897MmIqqh8KLoT/4rMYSO2jjWdDlMIyhYRp1cN+0SwZsLl0MZHmcxTa4f8iervQMX1 VJgzhP2j/aiLBkIC5g18MKPEnWI3UMlDb2gfD3Tv/ILlJY89L6pz37Kma+Nuu2EQAc rkgeZMldMwVBR2vZKYnoGt5Nd8iHRaswEAhWIATf/04K46xtiVuzTrRlvS4NnPz5w7 5r2xoy74WIIan5YpAe3UY/mo9UM6OSYBYIt2e5XP0Dc8HnF9q5cKhia0q+jdgRAM// jLvdm9WEbgf4A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 7AC7B40513; Fri, 29 Jan 2021 14:56:10 -0300 (-03) Date: Fri, 29 Jan 2021 14:56:10 -0300 From: Arnaldo Carvalho de Melo To: Tiezhu Yang Cc: Thomas Bogendoerfer , Peter Zijlstra , Jiaxun Yang , Ingo Molnar , 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: <20210129175610.GC794568@kernel.org> 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> <20210127211506.GA21163@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jan 29, 2021 at 10:48:52AM +0800, Tiezhu Yang escreveu: > On 01/28/2021 05:15 AM, Thomas Bogendoerfer wrote: > > 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 ? > > If it is possible, I prefer to merge this three patches together > through mips-next tree. The kernel part should go via the mips-next tree, the tooling I can process, that is how these things go in other cases where kernel and tooling changes for some new feature are needed. This helps making sure tooling is not in lockstep with the kernel, one should be able to use a new tool in an old kernel and vice-versa. - Arnaldo