From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"John Snow" <jsnow@redhat.com>, "Cleber Rosa" <crosa@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"ARM TCG CPUs" <qemu-arm@nongnu.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Junjie Mao" <junjie.mao@intel.com>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Gustavo Romero" <gustavo.romero@linaro.org>,
	rowan.hart@intel.com, "Mads Ynddal" <mads@ynddal.dk>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl
Date: Thu, 15 Aug 2024 14:42:17 +0300	[thread overview]
Message-ID: <20240815-rust-pl011-v7-0-975135e98831@linaro.org> (raw)
Changes
=======
- Incorporated changes by Paolo Bonzini and Junjie Mao as a result of
  discussion on the previous patch series version
- Included two squash patches from
  <20240814090820.1251026-1-junjie.mao@intel.com>
  Junjie Mao (2):
    meson: subprojects: Specify Rust edition by rust_std=20XX
    rust: Specify Rust edition by rust_std=20XX
Outstanding issues
==================
Outstanding issues that are not blocking for merge are:
- Cross-compilation for aarch64 is not possible out-of-the-box because of this bug:
  <https://github.com/rust-lang/rust/issues/125619> in llvm which when
  fixed, must be ported to upstream rust's llvm fork. Since the problem
  is an extraneous symbol we could strip it with objcopy -N|--strip-symbol
- Adding more than one Rust device ends up with duplicate symbols from
  rust std library because we are linking as whole archives because...
  constructors are stripped by the linker otherwise :( It can be worked
  around if a single Rust library is built with all the devices as
  dependencies which is then linked to qemu. The fix is a small change
  which I will add either in a next version or when a new Rust device is
  added.
Previous version was: <rust-pl011-rfc-v6.git.manos.pitsidianakis@linaro.org>
---
Hello everyone,
This series adds:
- build system support for the Rust compiler
- a small Rust library, qemu-api, which includes bindings to QEMU's C
  interface generated with bindgen
- a proof of concept ARM PL011 device implementation in Rust, chosen for
  its low complexity. The device is used in the arm virt machine if qemu
  is compiled with rust enabled (./configure --enable-rust [...])
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
Manos Pitsidianakis (5):
      build-sys: Add rust feature option
      rust: add bindgen step as a meson dependency
      .gitattributes: add Rust diff and merge attributes
      rust: add crate to expose bindings and interfaces
      rust: add PL011 device model
Paolo Bonzini (2):
      Require meson version 1.5.0
      configure, meson: detect Rust toolchain
 MAINTAINERS                                        |  20 +
 configure                                          |  50 +-
 meson.build                                        |  77 ++-
 rust/wrapper.h                                     |  39 ++
 .gitattributes                                     |   3 +
 Kconfig                                            |   1 +
 Kconfig.host                                       |   3 +
 hw/arm/Kconfig                                     |  33 +-
 meson_options.txt                                  |   3 +
 python/scripts/vendor.py                           |   4 +-
 python/wheels/meson-1.2.3-py3-none-any.whl         | Bin 964928 -> 0 bytes
 python/wheels/meson-1.5.0-py3-none-any.whl         | Bin 0 -> 959846 bytes
 pythondeps.toml                                    |   2 +-
 rust/.gitignore                                    |   3 +
 rust/Kconfig                                       |   1 +
 rust/hw/Kconfig                                    |   2 +
 rust/hw/char/Kconfig                               |   3 +
 rust/hw/char/meson.build                           |   1 +
 rust/hw/char/pl011/.gitignore                      |   2 +
 rust/hw/char/pl011/Cargo.lock                      | 125 +++++
 rust/hw/char/pl011/Cargo.toml                      |  26 +
 rust/hw/char/pl011/README.md                       |  31 ++
 rust/hw/char/pl011/meson.build                     |  21 +
 rust/hw/char/pl011/rustfmt.toml                    |   1 +
 rust/hw/char/pl011/src/definitions.rs              |  26 +
 rust/hw/char/pl011/src/device.rs                   | 586 +++++++++++++++++++++
 rust/hw/char/pl011/src/device_class.rs             |  58 ++
 rust/hw/char/pl011/src/lib.rs                      | 584 ++++++++++++++++++++
 rust/hw/char/pl011/src/memory_ops.rs               |  56 ++
 rust/hw/meson.build                                |   1 +
 rust/meson.build                                   |  11 +
 rust/qemu-api/.gitignore                           |   2 +
 rust/qemu-api/Cargo.lock                           |   7 +
 rust/qemu-api/Cargo.toml                           |  23 +
 rust/qemu-api/README.md                            |  17 +
 rust/qemu-api/build.rs                             |  13 +
 rust/qemu-api/meson.build                          |  17 +
 rust/qemu-api/rustfmt.toml                         |   1 +
 rust/qemu-api/src/bindings.rs                      |   7 +
 rust/qemu-api/src/definitions.rs                   | 108 ++++
 rust/qemu-api/src/device_class.rs                  | 128 +++++
 rust/qemu-api/src/lib.rs                           | 100 ++++
 rust/qemu-api/src/tests.rs                         |  48 ++
 rust/rustfmt.toml                                  |   7 +
 scripts/archive-source.sh                          |   5 +-
 scripts/make-release                               |   5 +-
 scripts/meson-buildoptions.sh                      |   3 +
 scripts/rustc_args.py                              |  84 +++
 subprojects/.gitignore                             |  11 +
 subprojects/arbitrary-int-1-rs.wrap                |   7 +
 subprojects/bilge-0.2-rs.wrap                      |   7 +
 subprojects/bilge-impl-0.2-rs.wrap                 |   7 +
 subprojects/either-1-rs.wrap                       |   7 +
 subprojects/itertools-0.11-rs.wrap                 |   7 +
 .../packagefiles/arbitrary-int-1-rs/meson.build    |  19 +
 subprojects/packagefiles/bilge-0.2-rs/meson.build  |  29 +
 .../packagefiles/bilge-impl-0.2-rs/meson.build     |  45 ++
 subprojects/packagefiles/either-1-rs/meson.build   |  24 +
 .../packagefiles/itertools-0.11-rs/meson.build     |  30 ++
 .../packagefiles/proc-macro-error-1-rs/meson.build |  40 ++
 .../proc-macro-error-attr-1-rs/meson.build         |  32 ++
 .../packagefiles/proc-macro2-1-rs/meson.build      |  31 ++
 subprojects/packagefiles/quote-1-rs/meson.build    |  29 +
 subprojects/packagefiles/syn-2-rs/meson.build      |  40 ++
 .../packagefiles/unicode-ident-1-rs/meson.build    |  20 +
 subprojects/proc-macro-error-1-rs.wrap             |   7 +
 subprojects/proc-macro-error-attr-1-rs.wrap        |   7 +
 subprojects/proc-macro2-1-rs.wrap                  |   7 +
 subprojects/quote-1-rs.wrap                        |   7 +
 subprojects/syn-2-rs.wrap                          |   7 +
 subprojects/unicode-ident-1-rs.wrap                |   7 +
 tests/lcitool/mappings.yml                         |   2 +-
 72 files changed, 2756 insertions(+), 21 deletions(-)
---
base-commit: a733f37aef3b7d1d33bfe2716af88cdfd67ba64e
change-id: 20240814-rust-pl011-v7
Best regards,
--
γαῖα πυρί μιχθήτω
next             reply	other threads:[~2024-08-15 11:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 11:42 Manos Pitsidianakis [this message]
2024-08-15 11:42 ` [PATCH v7 1/7] Require meson version 1.5.0 Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 2/7] build-sys: Add rust feature option Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 3/7] configure, meson: detect Rust toolchain Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 4/7] rust: add bindgen step as a meson dependency Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 5/7] .gitattributes: add Rust diff and merge attributes Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 6/7] rust: add crate to expose bindings and interfaces Manos Pitsidianakis
2024-08-15 14:01   ` Philippe Mathieu-Daudé
2024-08-15 14:50     ` Manos Pitsidianakis
2024-08-15 15:06     ` Daniel P. Berrangé
2024-08-16  8:34       ` Philippe Mathieu-Daudé
2024-08-21  7:24         ` Manos Pitsidianakis
2024-08-16  8:26   ` Junjie Mao
2024-08-15 11:42 ` [PATCH v7 7/7] rust: add PL011 device model Manos Pitsidianakis
2024-08-15 17:10 ` [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl Peter Maydell
2024-08-16  8:06 ` Junjie Mao
2024-08-16  8:17   ` Manos Pitsidianakis
2024-08-19  4:09     ` Junjie Mao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20240815-rust-pl011-v7-0-975135e98831@linaro.org \
    --to=manos.pitsidianakis@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=gustavo.romero@linaro.org \
    --cc=jsnow@redhat.com \
    --cc=junjie.mao@intel.com \
    --cc=mads@ynddal.dk \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rowan.hart@intel.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).