From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14607C4332F for ; Sat, 12 Feb 2022 15:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236359AbiBLPrv (ORCPT ); Sat, 12 Feb 2022 10:47:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbiBLPrs (ORCPT ); Sat, 12 Feb 2022 10:47:48 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F35C212; Sat, 12 Feb 2022 07:47:45 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id p63so14902031iod.11; Sat, 12 Feb 2022 07:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NgeFCi+7UEK+nuh5x7QmJDaX6DxRBY5bpSpry5mSd78=; b=Y88Bnv1NDKvFo/zSY71RycxR2B/ACxpaW4T8kK3tqHqqQbpUAV2I1OqHKgzbSdhrDb QawjU0J+cVvOy4E4YoIvfXhs2SIP+8Wjor7UFfj9vJs/WzufHZgiGsGzq6HHh/Ihr3im 3Q1+qditD4ehYRA0/AO80uTEFs6air76y7OZR7ruaDev3sQ47gRVfyCjN6xPjWtWX9gj rlTdZE9Q1bvJnL7TULLZH5Q2e/XqaeGAUzpl5Ym7KRemoqCta6NysmF5neqHTJWlPRAS KE5tVCBrM5IjxzNOqNkAwn4DNyaUgL5Vx2/ERkqh5aHXiGOirP9g4jhrBxji8VuhuUbZ 63BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NgeFCi+7UEK+nuh5x7QmJDaX6DxRBY5bpSpry5mSd78=; b=B6KCr+L1lJFuw4fqUDLA4e67D2cVpo+LS006cUQlfkljieAqUhf3IOoTJTrAvu5fKN LwnIN7L7d+M2toA1oEMfVt0osG1MMpeJRpEtwESRp3Qp4Wsmbgqfgghw1D43U807U5uq WlrQRsbgYN/Xau6HH61+DjPe3U13zNk1cATobPblpE1+b/DzrAN3/Qys02+IFYDSfAap ih6tyBiqrKJseQoAr8d1tGt9Ak+Ewf5kQcWC34NukmiAnJPwWsu2OjFjKUJpVSNWI2oF CibHuO6CU7xAtc1cF7JFnnztYfM0HNB36qR5UttUQ5uHvH8l8PpMh4KOk9OvbwER4AcX dwKg== X-Gm-Message-State: AOAM532tHtromcBYAZW5IJ3x4P21XVVN3v+v8ZV0XQVSe5vC7KDiCKik eabE9rOP4zBCNrT38oIGtpnK2ZaH4UuPCofjgMc= X-Google-Smtp-Source: ABdhPJzH9YyzNLTg9POFjsMYEBvv50IYOenD6jjVc2LJHnBnXQzNscn5cyEPVT4EBKpUx2wAjYDcVqVZhEvJ8smZXfs= X-Received: by 2002:a05:6638:4105:: with SMTP id ay5mr3853138jab.186.1644680864074; Sat, 12 Feb 2022 07:47:44 -0800 (PST) MIME-Version: 1.0 References: <20220212130410.6901-1-ojeda@kernel.org> <20220212130410.6901-17-ojeda@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Sat, 12 Feb 2022 16:47:33 +0100 Message-ID: Subject: Re: [PATCH v4 16/20] Kbuild: add Rust support To: "Russell King (Oracle)" Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kernel , Alex Gaynor , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman , Sven Van Asbroeck , Gary Guo , Boris-Chengbiao Zhou , Boqun Feng , Douglas Su , Dariusz Sosnowski , Antonio Terceiro , Daniel Xu , Miguel Cano , Masahiro Yamada , Michal Marek , Nick Desaulniers , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Linux Kbuild mailing list , Linux ARM , linuxppc-dev , linux-riscv Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell, On Sat, Feb 12, 2022 at 3:17 PM Russell King (Oracle) wrote: > > Please don't use CPU_32v6* here. > > It probably makes more sense to add a symbol "HAVE_RUST" and have the > appropriate architecture Kconfig files select HAVE_RUST. We can do it whatever way arch maintainers prefer, of course. Why would you prefer one over the other? > Does Rust support Thumb on ARMv6 and ARMv7 architectures? Yes, the main backend is LLVM. Some built-in targets and their support level are listed here, if you want to take a look: https://doc.rust-lang.org/nightly/rustc/platform-support.html There is also a GCC backend in `rustc` [1], which is making good progress and may eventually give us access to architectures supported by GCC. Furthermore, a from-scratch Rust frontend for GCC [2] is being worked on, though this effort will likely take more time to reach a point where it may be used for the kernel. [1] https://github.com/rust-lang/rust/tree/master/compiler/rustc_codegen_gcc [2] https://github.com/Rust-GCC/gccrs > Please remove every utterance of "default n" from your patch; n is the > default default which default defaults to, so you don't need to specify > default n to make the option default to n. It will default to n purely > because n is the default when no default is specified. Certainly. I am curious, though: is there a reason for most of the other 500+ instances in the kernel tree? > As Rust doesn't support all the architectures that the kernel supports, > Rust must not be used for core infrastructure. Yeah, although I am not sure I understand what you are getting at here. Cheers, Miguel