From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Junjie Mao" <junjie.mao@hotmail.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Zhao Liu" <zhao1.liu@intel.com>
Subject: [PULL 00/40] Rust changes for QEMU 9.2 soft freeze
Date: Mon, 4 Nov 2024 18:26:39 +0100 [thread overview]
Message-ID: <20241104172721.180255-1-pbonzini@redhat.com> (raw)
The following changes since commit 15195de6a93438be99fdf9a90992c4228527130d:
ci: enable rust in the Fedora system build job (2024-10-30 16:30:56 +0100)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream-rust
for you to fetch changes up to d20feaa9a5af597bd20630d041e5dc7808612be1:
ci: enable rust in the Debian and Ubuntu system build job (2024-10-31 18:39:52 +0100)
----------------------------------------------------------------
* rust: cleanups
* rust: integration tests
* rust/pl011: add support for migration
* rust/pl011: add TYPE_PL011_LUMINARY device
* rust: add support for older compilers and bindgen
* rust: enable rust in the Debian, Fedora and Ubuntu system build job
----------------------------------------------------------------
This pull request enables Rust in QEMU's CI infrastructure, as a
first step towards collaborative development of Rust features. It matches
the plan that I mentioned last Thursday at
https://lore.kernel.org/qemu-devel/CABgObfb7=ZxgiasgB=dE8yV+bhd5-pd51n4qGpP8OFNBS3iMXQ@mail.gmail.com/.
There is a lot of new code in here that is specifically from me. Because of
the worry that new Rust code may introduce hidden technical debt, others have
reviewed all the Rust code in here, with the exception of the mostly trivial
https://lore.kernel.org/qemu-devel/20241025160209.194307-17-pbonzini@redhat.com/.
The changes focus on CI integration and compilation infrastructure:
* support for older Rust versions as found in QEMU's Debian bookworm and
Ubuntu CI targets. Workarounds for older Rust compiler versions are grouped
together for future cleanup.
* passing qtests with --enable-rust testing support: the pl011 code is closer
to parity with the C version, though still experimental.
Regarding toolchain compatibility: Michael Tokarev expressed some
doubts about supporting the old toolchain in Debian bookworm. However,
even trixie (currently in "testing") would require workarounds, mostly
due to lack of stable "offset_of!" support, so maintaining bookworm
compatibility seemed reasonable.
I am also working on a documentation patch that explains the more recent
features that would be nice to have.
Note that the Rust code still contains what is technically undefined
behavior (also known as "unsound code", i.e. unsafe code that does not
respect aliasing rules). Fixing this and other aspects will be easier
with the CI infrastructure in place. For example bindings, static checking
and improved developer ergonomics (e.g., clippy and rustfmt integration),
documentation generation would all be valid starting points.
For developers testing locally with --enable-rust, run "meson subprojects
update --reset" after pulling and before building. Meson does not do this
step automatically due to it being potentially destructive. This should
only affect this initial stabilization period, but a fix is in progress
(I first need to check with the Meson folks whether my script is using
stable interfaces).
Paolo
Junjie Mao (1):
rust: introduce alternative implementation of offset_of!
Manos Pitsidianakis (9):
rust/wrapper.h: define memory_order enum
Revert "rust: add PL011 device model"
rust: add PL011 device model
rust: add definitions for vmstate
rust/pl011: add support for migration
rust/pl011: move CLK_NAME static to function scope
rust/pl011: add TYPE_PL011_LUMINARY device
rust/pl011: remove commented out C code
rust/pl011: Use correct masks for IBRD and FBRD
Paolo Bonzini (30):
qdev: make properties array "const"
meson: import rust module into a global variable
meson: remove repeated search for rust_root_crate.sh
meson: pass rustc_args when building all crates
rust: do not always select X_PL011_RUST
rust: do not use --no-size_t-is-usize
rust: remove uses of #[no_mangle]
rust: modernize link_section usage for ELF platforms
rust: build integration test for the qemu_api crate
rust: cleanup module_init!, use it from #[derive(Object)]
rust: clean up define_property macro
rust: make properties array immutable
rust: provide safe wrapper for MaybeUninit::zeroed()
rust: do not use TYPE_CHARDEV unnecessarily
rust/pl011: fix default value for migrate-clock
rust: patch bilge-impl to allow compilation with 1.63.0
rust: fix cfgs of proc-macro2 for 1.63.0
rust: use std::os::raw instead of core::ffi
rust: introduce a c_str macro
rust: silence unknown warnings for the sake of old compilers
rust: synchronize dependencies between subprojects and Cargo.lock
rust: create a cargo workspace
rust: do not use MaybeUninit::zeroed()
rust: clean up detection of the language
rust: allow version 1.63.0 of rustc
rust: do not use --generate-cstr
rust: allow older version of bindgen
rust: make rustfmt optional
dockerfiles: install bindgen from cargo on Ubuntu 22.04
ci: enable rust in the Debian and Ubuntu system build job
docs/about/build-platforms.rst | 12 +
meson.build | 135 +++++---
include/hw/qdev-core.h | 4 +-
include/hw/qdev-properties.h | 4 +-
rust/wrapper.h | 17 +
hw/core/qdev-properties.c | 26 +-
system/qdev-monitor.c | 2 +-
.gitattributes | 2 +
.gitlab-ci.d/buildtest.yml | 6 +-
meson_options.txt | 2 +
rust/{hw/char/pl011 => }/Cargo.lock | 4 +
rust/Cargo.toml | 7 +
rust/hw/char/Kconfig | 1 -
rust/hw/char/pl011/Cargo.toml | 3 -
rust/hw/char/pl011/src/device.rs | 162 +++++++---
rust/hw/char/pl011/src/device_class.rs | 80 ++++-
rust/hw/char/pl011/src/lib.rs | 6 +-
rust/hw/char/pl011/src/memory_ops.rs | 24 +-
rust/qemu-api-macros/Cargo.lock | 47 ---
rust/qemu-api-macros/Cargo.toml | 5 +-
rust/qemu-api-macros/meson.build | 2 +-
rust/qemu-api-macros/src/lib.rs | 103 ++++--
rust/qemu-api/Cargo.lock | 7 -
rust/qemu-api/Cargo.toml | 10 +-
rust/qemu-api/build.rs | 9 +
rust/qemu-api/meson.build | 44 ++-
rust/qemu-api/src/c_str.rs | 53 +++
rust/qemu-api/src/definitions.rs | 68 ++--
rust/qemu-api/src/device_class.rs | 114 ++-----
rust/qemu-api/src/lib.rs | 23 +-
rust/qemu-api/src/offset_of.rs | 161 +++++++++
rust/qemu-api/src/tests.rs | 49 ---
rust/qemu-api/src/vmstate.rs | 360 +++++++++++++++++++++
rust/qemu-api/src/zeroable.rs | 86 +++++
rust/qemu-api/tests/tests.rs | 79 +++++
scripts/ci/setup/ubuntu/ubuntu-2204-aarch64.yaml | 1 -
scripts/ci/setup/ubuntu/ubuntu-2204-s390x.yaml | 1 -
scripts/meson-buildoptions.sh | 4 +
subprojects/bilge-impl-0.2-rs.wrap | 1 +
subprojects/packagefiles/bilge-impl-1.63.0.patch | 45 +++
.../packagefiles/proc-macro2-1-rs/meson.build | 4 +-
subprojects/packagefiles/syn-2-rs/meson.build | 1 +
tests/docker/dockerfiles/ubuntu2204.docker | 6 +-
tests/lcitool/mappings.yml | 4 +
tests/lcitool/refresh | 11 +-
45 files changed, 1379 insertions(+), 416 deletions(-)
--
2.47.0
next reply other threads:[~2024-11-04 17:35 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 17:26 Paolo Bonzini [this message]
2024-11-04 17:26 ` [PULL 01/40] qdev: make properties array "const" Paolo Bonzini
2024-11-04 17:26 ` [PULL 02/40] rust/wrapper.h: define memory_order enum Paolo Bonzini
2024-11-04 17:26 ` [PULL 03/40] Revert "rust: add PL011 device model" Paolo Bonzini
2024-11-04 17:26 ` [PULL 04/40] rust: add PL011 device model Paolo Bonzini
2024-11-04 17:26 ` [PULL 05/40] meson: import rust module into a global variable Paolo Bonzini
2024-11-04 17:26 ` [PULL 06/40] meson: remove repeated search for rust_root_crate.sh Paolo Bonzini
2024-11-04 17:26 ` [PULL 07/40] meson: pass rustc_args when building all crates Paolo Bonzini
2024-11-04 17:26 ` [PULL 08/40] rust: do not always select X_PL011_RUST Paolo Bonzini
2024-11-04 17:26 ` [PULL 09/40] rust: do not use --no-size_t-is-usize Paolo Bonzini
2024-11-04 17:26 ` [PULL 10/40] rust: remove uses of #[no_mangle] Paolo Bonzini
2024-11-04 17:26 ` [PULL 11/40] rust: modernize link_section usage for ELF platforms Paolo Bonzini
2024-11-04 17:26 ` [PULL 12/40] rust: build integration test for the qemu_api crate Paolo Bonzini
2024-12-19 9:53 ` Bernhard Beschow
2024-12-19 11:22 ` Paolo Bonzini
2024-12-20 10:42 ` Paolo Bonzini
2024-12-21 18:49 ` Bernhard Beschow
2024-11-04 17:26 ` [PULL 13/40] rust: cleanup module_init!, use it from #[derive(Object)] Paolo Bonzini
2024-11-04 17:26 ` [PULL 14/40] rust: clean up define_property macro Paolo Bonzini
2024-11-04 17:26 ` [PULL 15/40] rust: make properties array immutable Paolo Bonzini
2024-11-04 17:26 ` [PULL 16/40] rust: provide safe wrapper for MaybeUninit::zeroed() Paolo Bonzini
2024-11-04 17:26 ` [PULL 17/40] rust: do not use TYPE_CHARDEV unnecessarily Paolo Bonzini
2024-11-04 17:26 ` [PULL 18/40] rust: add definitions for vmstate Paolo Bonzini
2024-11-04 17:26 ` [PULL 19/40] rust/pl011: fix default value for migrate-clock Paolo Bonzini
2024-11-04 17:26 ` [PULL 20/40] rust/pl011: add support for migration Paolo Bonzini
2024-11-04 17:27 ` [PULL 21/40] rust/pl011: move CLK_NAME static to function scope Paolo Bonzini
2024-11-04 17:27 ` [PULL 22/40] rust/pl011: add TYPE_PL011_LUMINARY device Paolo Bonzini
2024-11-04 17:27 ` [PULL 23/40] rust/pl011: remove commented out C code Paolo Bonzini
2024-11-04 17:27 ` [PULL 24/40] rust/pl011: Use correct masks for IBRD and FBRD Paolo Bonzini
2024-11-04 17:27 ` [PULL 25/40] rust: patch bilge-impl to allow compilation with 1.63.0 Paolo Bonzini
2024-11-04 17:27 ` [PULL 26/40] rust: fix cfgs of proc-macro2 for 1.63.0 Paolo Bonzini
2024-11-04 17:27 ` [PULL 27/40] rust: use std::os::raw instead of core::ffi Paolo Bonzini
2024-11-04 17:27 ` [PULL 28/40] rust: introduce a c_str macro Paolo Bonzini
2024-11-04 17:27 ` [PULL 29/40] rust: silence unknown warnings for the sake of old compilers Paolo Bonzini
2024-11-04 17:27 ` [PULL 30/40] rust: synchronize dependencies between subprojects and Cargo.lock Paolo Bonzini
2024-11-04 17:27 ` [PULL 31/40] rust: create a cargo workspace Paolo Bonzini
2024-11-04 17:27 ` [PULL 32/40] rust: introduce alternative implementation of offset_of! Paolo Bonzini
2024-11-07 11:28 ` Manos Pitsidianakis
2024-11-07 11:31 ` Paolo Bonzini
2024-11-07 12:44 ` Manos Pitsidianakis
2024-11-04 17:27 ` [PULL 33/40] rust: do not use MaybeUninit::zeroed() Paolo Bonzini
2024-11-04 17:27 ` [PULL 34/40] rust: clean up detection of the language Paolo Bonzini
2024-11-04 17:27 ` [PULL 35/40] rust: allow version 1.63.0 of rustc Paolo Bonzini
2024-11-04 17:27 ` [PULL 36/40] rust: do not use --generate-cstr Paolo Bonzini
2024-11-04 17:27 ` [PULL 37/40] rust: allow older version of bindgen Paolo Bonzini
2024-11-04 17:27 ` [PULL 38/40] rust: make rustfmt optional Paolo Bonzini
2024-11-04 17:27 ` [PULL 39/40] dockerfiles: install bindgen from cargo on Ubuntu 22.04 Paolo Bonzini
2024-11-04 17:27 ` [PULL 40/40] ci: enable rust in the Debian and Ubuntu system build job Paolo Bonzini
2024-11-06 13:10 ` [PULL 00/40] Rust changes for QEMU 9.2 soft freeze Peter Maydell
2024-11-06 13:14 ` Paolo Bonzini
2024-11-06 14:59 ` Peter Maydell
2024-11-06 16:27 ` Paolo Bonzini
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=20241104172721.180255-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=junjie.mao@hotmail.com \
--cc=kwolf@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--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).