Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2828284pxb; Mon, 19 Apr 2021 15:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmyW++z5CDJwncWOzfN9JasiVtWqt9bkhbWSWTGA8m0qZ/78gSnUVA6xFyz7k5IJhGpRq/ X-Received: by 2002:a17:907:367:: with SMTP id rs7mr24771263ejb.468.1618870768148; Mon, 19 Apr 2021 15:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618870768; cv=none; d=google.com; s=arc-20160816; b=r476W3WqIq7v8IuNyOX6v21fI6lFB2XAkUfbiq4pqih8UgtyVXZaTKzFnf9+SQuTH6 +yhuzZPeC6jvwhAI9SB7KemqPgAhNHu2dhWlkB6Yxk3h5KmB6pn40ArZR3NB5x4MmN6H pLUERvNHdbPLY/NzrHeGK1SWS27ByMZ3fZOFdx79UzWjmKkl/CNRiJPnJddBBgBHvGMB s2I96pCZPs1GBDimnLQc2eaEH0998Uag4AvnKuwEqfSYbvX+kwCFuNDySY2ZzdZstSg9 EatSJvxaro0JF0Dce48diaDPAPp3UwK4Kv9fh8xOlKpe1PF0n5i5JgDTMTa06FsiZPVl U3Ww== 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-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=e7Dcl8pNjyi3821l3B3pLY+4/wzBaqnimiTGhUpsc4o=; b=r/psChocCvnUHmmqUTsVtOLWa9Egr+WLEwztaFf8XKJhjRElMMQ5iTJEV6s7BHIFjZ MQevkzUO3X7Nmo+2Uf7LmOfY+vI7+Va2kec/ATVc/9clAgVenJMC8q/TbgT0qQZ84xdM k5JFIIkIvk2ODDqozkBOpWfiYYVLlQ9+871l2J317K5DofsAAXmxvbtUsm1FL0ggJYkl c7ep3juD6pSrfmg8riVeKqucAE8oNlSpq5can12SDxKwHQGAUbDgPqPEf4YH48xMGRIq P2qh4NvmqXbEMc2DJT10IYYRQ0RfpT7pw4tte9JoShnI6lNrDc6hUBud5eVq7Sx7KSHs nktQ== 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 f14si12365751ejc.147.2021.04.19.15.19.05; Mon, 19 Apr 2021 15:19:28 -0700 (PDT) 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 S233645AbhDSUBl (ORCPT + 99 others); Mon, 19 Apr 2021 16:01:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:56016 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhDSUBl (ORCPT ); Mon, 19 Apr 2021 16:01:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BAA0DB020; Mon, 19 Apr 2021 20:01:09 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 2309EDA732; Mon, 19 Apr 2021 21:58:51 +0200 (CEST) Date: Mon, 19 Apr 2021 21:58:51 +0200 From: David Sterba To: Miguel Ojeda Cc: Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman Subject: Re: [PATCH 04/13] Kbuild: Rust support Message-ID: <20210419195850.GV7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Miguel Ojeda , Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-5-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 07:34:51PM +0200, Miguel Ojeda wrote: > On Fri, Apr 16, 2021 at 3:38 PM Peter Zijlstra wrote: > > > > So if I read all this right, rust compiles to .o and, like any other .o > > file is then fed into objtool (for x86_64). Did you have any problems > > with objtool? Does it generate correct ORC unwind information? > > I opened an issue a while ago to take a closer look at the ORC > unwinder etc., so it is in my radar (thanks for raising it up, > nevertheless!). > > Currently, causing a panic in a nested non-inlined function (f -> g -> > h) in one of the samples with the ORC unwinder enabled gives me > something like: > > [ 0.903456] rust_begin_unwind+0x9/0x10 > [ 0.903456] ? _RNvNtCsbDqzXfLQacH_4core9panicking9panic_fmt+0x29/0x30 > [ 0.903456] ? _RNvNtCsbDqzXfLQacH_4core9panicking5panic+0x44/0x50 > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1h+0x1c/0x20 > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1g+0x9/0x10 > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1f+0x9/0x10 > [ 0.903456] ? > _RNvXCsbDqzXfLQacH_12rust_minimalNtB2_11RustMinimalNtCsbDqzXfLQacH_6kernel12KernelModule4init+0x73/0x80 > [ 0.903456] ? _RNvXsa_NtCsbDqzXfLQacH_4core3fmtbNtB5_5Debug3fmt+0x30/0x30 > [ 0.903456] ? __rust_minimal_init+0x11/0x20 Are there plans to unmangle the symbols when printing stacks? c++filt says: rust_begin_unwind+0x9/0x10 ? core[8787f43e282added]::panicking::panic_fmt+0x29/0x30 ? core[8787f43e282added]::panicking::panic+0x44/0x50 ? rust_minimal[8787f43e282added]::h+0x1c/0x20 ? rust_minimal[8787f43e282added]::g+0x9/0x10 ? rust_minimal[8787f43e282added]::f+0x9/0x10 ? ::init+0x73/0x80 ? ::fmt+0x30/0x30 ? __rust_minimal_init+0x11/0x20 for simple functions it's barely parseable but the following is hardly readable > _RNvXs5_NtCsbDqzXfLQacH_11rust_binder11range_allocNtB5_15DescriptorStateNtNtCsbDqzXfLQacH_4core3fmt5Debug3fmt+0x60/0x60 translates to ::fmt