Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1725590rdb; Thu, 25 Jan 2024 04:31:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtdhXEyuBumHR+pwAM1xEC4CBT81wQxOiOb4/ziSgRSmklqkyuCuDkd4slOdyhg8wGaS0s X-Received: by 2002:a92:da04:0:b0:362:88bd:831b with SMTP id z4-20020a92da04000000b0036288bd831bmr1205872ilm.19.1706185893195; Thu, 25 Jan 2024 04:31:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706185893; cv=pass; d=google.com; s=arc-20160816; b=N2IpWWFpSedZKAeG+70IOQav4wAEp8ink2YikSmfzGL7+r6+XxuZpR8xlzhhKVvZno 5UqnjWHPdxGQLKeVjnh0bcZIux0lpDRoZCyb3hPF8howyyAu8zjdcyv3ky84To5Nie+x esEYZQTtO7Snv9h6wCTUgWoCZR0d0kEtlyq+pyHo/txjT340dMc5di1pZVA5xyeoNYDu RGeLB7wprES80yZ5JQ58OkAhdN6nDMYWFOl7To1yL0dkWjGI+AG/t/2qVcDkOh+Xt447 L2XJjnELnEKWBmuCPbgu8neNS1tVTD2cm5U+QUol+Rd6BzwOps3p/5d6x9E0RTr01t9o eOoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e2Gx71tG+PGiXuCcWrEYqd74AvFTiXta4T5CfVZ20i4=; fh=zgrZddJK3+M32bJtoQRrW1bd2QNOWtu1amjZu+/rLKc=; b=vLFXLghoAiykE5jQnxx0LGNCsXuuf+uXw0sJWBBBaP5TJHl2SoyE+kGAQlL5ldOG98 ne/rKGQwdYxm+4H+NP+bWUbR5ceeLQQQ3cOMoHOnpIVmj9OyeMJULSPoz1we5zLDuSMC TuJmZYoIBBkIM84CoLjdiQ3XJsI+nakKMfh/24BxWHc0wBxjbuxDnxH3Igu4bu/akqjx aS08026iGBolME2jl8Fhh6VpU57gTqvAFsroYXxtGoVcZeG08Fkg+3E77klEEA/ixGUU DQAW1PMY2u5Wo0VmkkhEEUgNTBz3+GgeU34b9ZWQqVRwiEu8uMvlzfiQGVzvm73BSw3g +WRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=vYVPfKcT; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-38580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o16-20020a635a10000000b005cdde899923si13082101pgb.758.2024.01.25.04.31.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 04:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=vYVPfKcT; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-38580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CB6062914A4 for ; Thu, 25 Jan 2024 12:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F2CF2AEEE; Thu, 25 Jan 2024 12:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="vYVPfKcT" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B6423D6; Thu, 25 Jan 2024 12:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706185883; cv=none; b=rOzGYv5aF2+E4YHzJa/sPr673bvhaSkFxlcfKXj4YUzMfV/B3RHswvo/mFPY/5juI92bde4s11reNHw/DWi6/avXNaXF30LMoqQy7mBV70UiKsyGjHWL/GlGHSGatbjm9Vv6Iedto2orIeO9qPt0cK6JXznIztHDx161MnHr6bY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706185883; c=relaxed/simple; bh=e2Gx71tG+PGiXuCcWrEYqd74AvFTiXta4T5CfVZ20i4=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tl9axKTFX64Tull4M0FaU5q2VepxDfet26WgyGKkjYKlmaq7GCZN8Fagl7OWhW7HLXgj6qLxUdDJf+aoyTc1EZ9vg8B1JymbsI1QezFYpFntKaPHPSI1G/J2nm/lDOyjH/zg6LSl999foSseqAx0zmfjzaFavY0cW17vvEd2NCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=vYVPfKcT; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1706185881; x=1737721881; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=e2Gx71tG+PGiXuCcWrEYqd74AvFTiXta4T5CfVZ20i4=; b=vYVPfKcTjbqNf6fxMdBuEt2Brx8eTxfc/k/sNNZncYBSMyuJmmhaj8mj L79dHltC21R73ictxK1VeqCZRnzI9hItXRrN2wPltmt6tmEIE0QxX7JW9 cSiunODrLQoO/IRXWE0ytVYE20DbBlxsoHxg6N1M8DstKPVEwVolFSjZ1 xo3OuDIwXd7Vj25EgPiqBYtikDPrDp5GD86Z5u4mWL1TLg3K+3KgKDsm8 cSXx8UjusttDS2JSQ0hwbCE5K3GsBQxFYus+6fIfjJZ72fm9PkX2r1qxk EYKgCpK20ZRsCY6A4BFHcr4Cb/fPy0ClRzjbZuiDPSM1Bv/I8UIIdIeJD A==; X-CSE-ConnectionGUID: kHKU490MTVa/CUpB0qKI1Q== X-CSE-MsgGUID: 04RsdzskT3uNcxxVcLoRZg== X-IronPort-AV: E=Sophos;i="6.05,216,1701154800"; d="asc'?scan'208";a="15284694" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Jan 2024 05:31:19 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Jan 2024 05:31:15 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 25 Jan 2024 05:31:12 -0700 Date: Thu, 25 Jan 2024 12:30:34 +0000 From: Conor Dooley To: Miguel Ojeda CC: Conor Dooley , , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Nathan Chancellor , Nick Desaulniers , Tom Rix , , , , Subject: Re: [PATCH v1 0/2] RISC-V: enable rust Message-ID: <20240125-bucked-payroll-47f82077b262@wendy> References: <20230307102441.94417-1-conor.dooley@microchip.com> <20230608-dispatch-sneer-aa09bd7b2eb8@wendy> <20230608-spiritism-gonad-5f5aff4c3a24@wendy> <20240117-swiftly-parasail-618d62972d6e@spud> <20240118-implode-delirium-eefdd86e170e@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mujnSF4ge/jontNh" Content-Disposition: inline In-Reply-To: --mujnSF4ge/jontNh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 05:09:40PM +0100, Miguel Ojeda wrote: > On Thu, Jan 18, 2024 at 4:49=E2=80=AFPM Conor Dooley w= rote: > > > > The bit that worries me most is bindgen, and in particular detecting the > > version of libclang used. I mentioned to Nathan or Nick about needing a > > buildtime test for the version of LIBCLANG being used. > > I'm less worried about this for LLVM=3D1 builds, since while I think it= is > > possible to provide a LIBCLANG path to the build system, I suspect that > > for LLVM=3D1 builds it's almost always going to match the LLVM toolchain > > in use. I chatted with the clang built linux folks about this yesterday, Nathan agreed that dealing with incompatibility issues iff they crop up is a reasonable way to go. > `scripts/rust_is_available.sh` tests whether `libclang` is at least > the minimum LLVM supported version; and under `LLVM=3D1` builds, it also > tests whether the `bindgen` found one matches the C compiler. Do you > mean something like that? If by "the bindgen found one matches the C compiler" you mean that the version of libclang used by bindgen matches the C compiler, then that sounds great. > For `bindgen` under GCC builds, we will eventually want a "proper" way > to use GCC instead (or possibly other approaches like querying the > information): https://github.com/rust-lang/rust-bindgen/issues/1949. > Recently, there has been a thread in our Zulip and a couple people are > experimenting: https://rust-for-linux.zulipchat.com/#narrow/stream/288089= -General/topic/Bindgen.20--.20GCC.20backend.20port That link for me goes to a message on 22/01, so later than the email you sent. > > I'll do another rebase and resend after the merge window closes I > > suppose :) That said, I gave things another spin today, in a different environment, as a final check before sending and found an issue causing kernel panics. RISC-V (and x86/arm64) supports kcfi (CFI_CLANG) but enabling sanitisers seems to be a nightly only option for rustc. The kernel I built today had CFI_CLANG enabled and that caused panics when the rust samples were loaded. The CFI_CLANG Kconfig entry has a cc-option test for whether the option is supported, but from a quick check I don't see a comparable test to use for rust. Even if a test was added, the current flag is an unstable one, so I am not sure if testing for it is the right call in the first place, given the stabilised flag would be entirely different? The tracking issue seems to be complete: https://github.com/rust-lang/rust/issues/89653 but the tracking issue for sanitisiers themselves is only 3/5: https://github.com/rust-lang/rust/issues/39699 The simple thing would be to make them mutually exclusive options in Kconfig. What do you think? Cheers, Conor. --mujnSF4ge/jontNh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZbJUXAAKCRB4tDGHoIJi 0uVHAQDIljZB931BuYsvFh8CDiXkeXE86yDu7dnEqYO2MErRBwEArNXVKUHQ6zGx JQPxBR+Fd23f1rnzfJFcWNiA7BscMA8= =IPeL -----END PGP SIGNATURE----- --mujnSF4ge/jontNh--