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 7C53CC4167B for ; Sat, 17 Dec 2022 04:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiLQEor (ORCPT ); Fri, 16 Dec 2022 23:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiLQEop (ORCPT ); Fri, 16 Dec 2022 23:44:45 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52C6D30562 for ; Fri, 16 Dec 2022 20:44:44 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id il11-20020a17090b164b00b00219a4366109so5231704pjb.0 for ; Fri, 16 Dec 2022 20:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=lq5qLaqjn47UolL4tsokkeSChCFRg4lpAueP7xiyK5c=; b=hI3GPjV+otMa4Ye095FQjaGiWFlvwbSCtpy0DBUgqx9lFQzUf2P0+VMQ+0p2TVTqA5 RWgmwjx++Vat5TAo6ZfBcEzl2ZRlK0ZvijwVXFFrEBj2H0CDfCxn7T4YMffcWbCjNa1k OJ1EPcqIFGczYb7jLwFDNuh3dCqMPAyPDyafE9GbwooLR5G9wHsJJe+T94Zh3w3gAyx+ mdEDkdd8xr1Tfwaqf9PpBiVqe0nyLrdo8K7KCclSR7jY4bh0MjIjPp0ejIeHUmkRkjI1 wnNzvdOhssab9K/qDUX2tlWPiLFv8SGiFbH+aFMdn+xsjdYLaNd8mNcT9S/wPq2j5kby 0GjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lq5qLaqjn47UolL4tsokkeSChCFRg4lpAueP7xiyK5c=; b=nIPQftTaqafgYiFBU4CqSoMUCesrsGhUgZDlbChRPCnGES59Yl7Bxv33mle6SuzCDT 3W0cSlJOKAKQ3OLz2ulcRBsCN1bYPS1B9nCKOtxlspRZTkqiTOqPvovtO0qNlRvLI3UU B5oDDGnGm2nciux4kjps45b6BQdbmd8QmKlJG8XiMEHHVLWoSj+MPf4y6edPm/zYU6Ii efLtpq3tqxjVtHBrETjnTlhqR/y10fZZ+tTn0xTmD6gXdw6oUDMNpH3X74hDKKs1Ukvr TngH9NxMHvEt5p7B3PS0f1wfm8Rdp5bSlUFcb4/AmstULbj84dL/X7dFDUv3OxJj9WS/ AtUA== X-Gm-Message-State: AFqh2kqT0bTet9SvcuAGGap6vDNq5o1PXyf8y51iBBUQHcmcrjmADcjD +ZkYJkOPCnX8dJRpNUgoAHK4wc/sB16qMg== X-Google-Smtp-Source: AMrXdXvH1QaOoHmXxQnjA4mtzl2imb7fSbG7jRPeov73t2X0+amIt1J7VPlYImsSKZuDLTlFJocq/RGIXZxZFA== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a17:90a:d318:b0:220:1f03:129b with SMTP id p24-20020a17090ad31800b002201f03129bmr138587pju.0.1671252283386; Fri, 16 Dec 2022 20:44:43 -0800 (PST) Date: Sat, 17 Dec 2022 12:44:33 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221217044436.4138642-1-davidgow@google.com> Subject: [PATCH 0/3] rust: arch/um: Rust support for UML From: David Gow To: Miguel Ojeda , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Nathan Chancellor , Nick Desaulniers Cc: David Gow , rust-for-linux@vger.kernel.org, linux-um@lists.infradead.org, llvm@lists.linux.dev, linux-doc@vger.kernel.org, kunit-dev@googlegroups.com, x86@kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , Gary Guo , Brendan Higgins , Daniel Latypov , Jonathan Corbet Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org This series adds support for building and running code in the Rust programming language under x86_64 UML kernels. It is based on two Pull Requests from the Rust-for-Linux GitHub page: - https://github.com/Rust-for-Linux/linux/pull/766 - https://github.com/Rust-for-Linux/linux/pull/881 The series consists of three patches: the first two set up various compiler options to match both the UML and the X86 CFLAGS. Rust support can be enabled by setting CONFIG_RUST=y, when the suitable Rust compiler and bindgen versions are available (run make rustavaiable to check). LLVM=1 is also required at present with all Rust builds. The whole thing can be built and tested with kunit.py: ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_RUST=y --make_options LLVM=1 (Note that there are no Rust-based KUnit tests upstream yet. The "rust" branch of the Rust-for-Linux GitHub repository does use KUnit for its "doctests", and all of those tests pass under UML with these patches.) This series is currently based on the uml/next branch: I'm happy to rebase it next year once we're past the 6.2 merge window (though it applies cleanly to torvalds/master at the moment). Equally, it should be possible to take these changes in via the rust tree instead, but since it's mostly UML Makefile changes, it probably makes more sense for it to go in via the uml tree. Also note that this series marks UML as a "maintained" architecture for Rust support. It's definitely my intention to keep this working, but if anyone has serious concerns, we can downgrade that. Cheers, -- David David Gow (3): rust: arch/um: Use 'pie' relocation mode under UML rust: arch/um: Disable FP/SIMD instruction to match x86 rust: arch/um: Add support for CONFIG_RUST under x86_64 UML Documentation/rust/arch-support.rst | 2 ++ arch/um/Kconfig | 1 + arch/um/Makefile | 2 ++ arch/x86/Makefile.um | 6 ++++++ 4 files changed, 11 insertions(+) -- 2.39.0.314.g84b9a713c41-goog