Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4844919rwl; Mon, 3 Apr 2023 10:21:08 -0700 (PDT) X-Google-Smtp-Source: AKy350as7FWlnLUKkccvKs+b6CUPVJoEJp0q5nvbbPCy56ZCdwBfYfAnTJrxpkYQCDXRQtlItXSa X-Received: by 2002:aa7:d50e:0:b0:502:1cd3:d0fb with SMTP id y14-20020aa7d50e000000b005021cd3d0fbmr32807747edq.20.1680542468058; Mon, 03 Apr 2023 10:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680542468; cv=none; d=google.com; s=arc-20160816; b=UX2K2BeLhFeRfH4NOw8Hf4kZKNCf0HpZLmauCNlhutK/3CZactJGLH3brewulMjfM1 NTAwz7tdaXftBgx9w6BbgJDnPjbfzgpay2icUta3+fTlL2ebG+lpFtwBC/SofcRp4+5e 0cNjoF5ihA4e4yFODPmQHULWc0IqlT75y/YgJmADoy58dJ6ebX8QFjOUvKHYJUNvvB5U eZPU8qtKC0lurouZphoLqrQQGBQen+2e7MEjppMVx0PRuU5eIYfrdPeODBDhuCs4j4LY jeqzZ9eL1kVm7JUJH44X5EXsfxPm7bYSdnEPe5CMgohZZn9NrYjpAegJ/Q74/LykeptP Ku8g== 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=IKV0bHmyryA+AQjf3ldZmuzcrz4vmysU3zWtd7jLG1g=; b=F75A9MWt4Q/iPQdP5sDSZtmfiYB2em4n8GwJEBBTbQAMcZ0LTqKXK4YKitaD1hveh3 eFhgtOG/9ZfxIkrKcbonBxnqmg4UyytZ5bJRjaO4GYboV6v8IEYNpezg9sGII3aMtpMW UDu4oDtBo/P7fUM+jyWcui9LhTJeN4QJiatOmrorR0N1y+e8O+IsXFK4EYBQqpvxK4Ef kiwuI3KZEAgGGkBHctlx2A1eNHUAUY7NmrhIqckg7T/nx2yyiiatzFS0dN3t8wgQaNPq nNz5W87lFZdooeBkPzNEukbMMAD00YknS6r36qNA3cZGrlnWdvTdbk+ncun6fr3oaz0C ZlAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZwzCFdR2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020aa7d647000000b004c0abff5545si3890110edr.614.2023.04.03.10.20.43; Mon, 03 Apr 2023 10:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZwzCFdR2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232369AbjDCRPG (ORCPT + 99 others); Mon, 3 Apr 2023 13:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbjDCRPF (ORCPT ); Mon, 3 Apr 2023 13:15:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 284B61BF0; Mon, 3 Apr 2023 10:15:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B9FF762276; Mon, 3 Apr 2023 17:15:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82E2DC433D2; Mon, 3 Apr 2023 17:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680542103; bh=goHoB2jLaOy/EZiBpWOJOkuOxo+2a8uUDASlH5Rjdeo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZwzCFdR2HlV/3xEQ2th+BoUWRZxclFUkHHSDMfWoUpFshEVDp4PwvXfwPfwER46zu utJLROIS9/Qc/2ko2aE1xfHFyTEz59HpTsq4MoWb4c8DmwUTg+qDyjk3du2n2sBJvX dQUKlZ5L1keWxOxmBB8S08JMiituLrqzxnnE06tbsYuy+/FLZTfjyTp/0PDW7Kairo c84lBAg53Eb2j6lj7QaRqTK0B9n6oGkXHkX5TPH+344DGvaXCqX7DY4VXPMy8FoKmA nFSYMz35eiNfDuL4I3hMZwKn8jWjD0oZGCwIJEYgZes3oq7ZktScL+GuTEm6fj2N7i 43CXpTlrr0RJg== Date: Mon, 3 Apr 2023 18:14:57 +0100 From: Conor Dooley To: Miguel Ojeda Cc: Conor Dooley , linux-riscv@lists.infradead.org, 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 , rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v1 0/2] RISC-V: enable rust Message-ID: <20230403-repose-cartwheel-c3e10c231cae@spud> References: <20230307102441.94417-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XTCdhfO5W5YlGhZZ" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --XTCdhfO5W5YlGhZZ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 03, 2023 at 06:35:45PM +0200, Miguel Ojeda wrote: > On Thu, Mar 30, 2023 at 11:12=E2=80=AFAM Conor Dooley > wrote: > > > > I'd rather do this in the RISC-V Makefile so that it does not get > > forgotten. >=20 > Sounds good to me! We want to have the least amount of things possible > in the common pieces (e.g. for the target spec file we moved some > flags); so the more we move out to `arch/`, the better. >=20 > > If my understanding of bindgen is correct, we don't actually need to be > > honest to it about what extensions the rest of the kernel is compiled > > with, only make sure that it is not called with arguments it does not > > understand? >=20 > As long as bindgen generates things with the right ABI etc., yeah. > But, in principle, enabling one extension one side but not the other > could be wrong if it ends up in something that Rust uses, e.g. if the > C side does: >=20 > #ifdef __ARM_ARCH_7R__ > int x; > #else > char x; > #endif >=20 > and Rust attempts to use it, then particular `-march` builds could be bro= ken. To be on the safe side then, we should really disable the extensions across the whole kernel. I don't *think* we have any madness at the moment like in the above, but it is better to be on the safe side. As I note below, it's just one extension for now anyway. > > What version of GCC do I need to replicate this? I can build tip-of-tree > > gcc if needs be. >=20 > Sorry, what do you want to replicate? If you mean what we had in the > old GitHub CI, I see: >=20 > CONFIG_CC_VERSION_TEXT=3D"riscv64-linux-gnu-gcc (Ubuntu > 11.3.0-1ubuntu1~22.04) 11.3.0" >=20 > which successfully boots in QEMU for the kernel config we tested. No, I misunderstood your question. I thought you meant something else entirely. > But if you are asking what should be supported, I guess it depends on > the RISC-V maintainers. Ideally, everything that the kernel supports > (GCC >=3D 5.1), Heh, as if that number is true across the board! > but since the GCC+Rust builds are so experimental, I > think as long as something is tested from time to time, it would be > great (to at least know not everything is completely broken). >=20 > But if you think that would be too much effort to maintain, or even > GCC builds in general, then please feel free to ignore it for the time > being, i.e. it is better to have LLVM builds rather than nothing! :) Yeah, it may be worth getting just the LLVM bits in. I abhor the -march handling and it may end up looking like shite with the zicsr & zifencei handling. Worst comes to worst, can permit gcc builds by just removing all the extensions that get passed in -march for RUST && CC_IS_GCC type scenarios. The only one of those at the moment is zihintpause & I don't suppose too many tears will be shed over that. For now it's safe to assume that LLVM doesn't require zicsr or zifencei [1], we don't need to do a version dance right away. =C2=AF\_(=E3=83=84)_/=C2=AF, Conor. 1 - https://reviews.llvm.org/D147183#4233360 --XTCdhfO5W5YlGhZZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZCsJkAAKCRB4tDGHoIJi 0sYFAQDDRMpXIXaf93gLvJjaLEOPJ8XmdZ81CElLrdC/W/n/QgD/TsQf3QYbIo/K DV49NcCFvY9TYFvAJ4G3pq6JXWWEEgw= =tW4o -----END PGP SIGNATURE----- --XTCdhfO5W5YlGhZZ--