[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] d36f16: qdev: make properties array "const"
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] d36f16: qdev: make properties array "const" |
Date: |
Wed, 06 Nov 2024 13:33:34 -0800 |
Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: d36f165d9523a5d151f11888938fcc66a6dd10df
https://github.com/qemu/qemu/commit/d36f165d9523a5d151f11888938fcc66a6dd10df
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M hw/core/qdev-properties.c
M include/hw/qdev-core.h
M include/hw/qdev-properties.h
M system/qdev-monitor.c
Log Message:
-----------
qdev: make properties array "const"
Constify all accesses to qdev properties, except for the
ObjectPropertyAccessor itself. This makes it possible to place them in
read-only memory, and also lets Rust bindings switch from "static mut"
arrays to "static"; which is advantageous, because mutable statics are
highly discouraged.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: b278b60d517688b5f136be9d5f2f499eaf804002
https://github.com/qemu/qemu/commit/b278b60d517688b5f136be9d5f2f499eaf804002
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/wrapper.h
Log Message:
-----------
rust/wrapper.h: define memory_order enum
Add stub definition of memory_order enum in wrapper.h.
Creating Rust bindings from C code is done by passing the wrapper.h
header to `bindgen`. This fails when library dependencies that use
compiler headers are enabled, and the libclang that bindgen detects does
not match the expected clang version. So far this has only been observed
with the memory_order enum symbols from stdatomic.h. If we add the enum
definition to wrapper.h ourselves, the error does not happen.
Before this commit, if the mismatch happened the following error could
come up:
/usr/include/liburing/barrier.h:72:10: error: use of undeclared identifier
'memory_order_release'
/usr/include/liburing/barrier.h:75:9: error: use of undeclared identifier
'memory_order_acquire'
/usr/include/liburing/barrier.h:75:9: error: use of undeclared identifier
'memory_order_acquire'
/usr/include/liburing/barrier.h:68:9: error: use of undeclared identifier
'memory_order_relaxed'
/usr/include/liburing/barrier.h:65:17: error: use of undeclared identifier
'memory_order_relaxed'
/usr/include/liburing/barrier.h:75:9: error: use of undeclared identifier
'memory_order_acquire'
/usr/include/liburing/barrier.h:75:9: error: use of undeclared identifier
'memory_order_acquire'
/usr/include/liburing/barrier.h:72:10: error: use of undeclared identifier
'memory_order_release'
panicked at
[..]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-cli-0.70.1/main.rs:45:36:
Unable to generate bindings
To fix this (on my system) I would have to export CLANG_PATH and
LIBCLANG_PATH:
export CLANG_PATH=/bin/clang-17
export LIBCLANG_PATH=/usr/lib/llvm-17/lib
With these changes applied, bindgen is successful with both the
environment variables set and unset.
Since we're not using those symbols in the bindings (they are only used
by dependencies) this does not affect the generated bindings in any way.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link:
https://lore.kernel.org/r/20241027-rust-wrapper-stdatomic-v2-1-dab27bbf93ea@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: ca5aa28e244ee3dfe0dd6c76c7c33ce78f25beed
https://github.com/qemu/qemu/commit/ca5aa28e244ee3dfe0dd6c76c7c33ce78f25beed
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M MAINTAINERS
M hw/arm/Kconfig
M meson.build
M rust/Kconfig
R rust/hw/Kconfig
R rust/hw/char/Kconfig
R rust/hw/char/meson.build
R rust/hw/char/pl011/.gitignore
R rust/hw/char/pl011/Cargo.lock
R rust/hw/char/pl011/Cargo.toml
R rust/hw/char/pl011/README.md
R rust/hw/char/pl011/meson.build
R rust/hw/char/pl011/src/device.rs
R rust/hw/char/pl011/src/device_class.rs
R rust/hw/char/pl011/src/lib.rs
R rust/hw/char/pl011/src/memory_ops.rs
R rust/hw/meson.build
M rust/meson.build
M scripts/archive-source.sh
M scripts/make-release
R scripts/rust/rust_root_crate.sh
M subprojects/.gitignore
R subprojects/arbitrary-int-1-rs.wrap
R subprojects/bilge-0.2-rs.wrap
R subprojects/bilge-impl-0.2-rs.wrap
R subprojects/either-1-rs.wrap
R subprojects/itertools-0.11-rs.wrap
R subprojects/packagefiles/arbitrary-int-1-rs/meson.build
R subprojects/packagefiles/bilge-0.2-rs/meson.build
R subprojects/packagefiles/bilge-impl-0.2-rs/meson.build
R subprojects/packagefiles/either-1-rs/meson.build
R subprojects/packagefiles/itertools-0.11-rs/meson.build
R subprojects/packagefiles/proc-macro-error-1-rs/meson.build
R subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build
R subprojects/packagefiles/unicode-ident-1-rs/meson.build
R subprojects/proc-macro-error-1-rs.wrap
R subprojects/proc-macro-error-attr-1-rs.wrap
Log Message:
-----------
Revert "rust: add PL011 device model"
Patch was applied with invalid authorship by accident, which confuses
git tooling that look at git blame for contributors etc.
Patch will be re-applied with correct authorship right after this
commit.
This reverts commit d0f0cd5b1f7e9780753344548e17ad4df9fcf5d8.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-1-051e7a25b978@linaro.org
Commit: 37fdb2f56a90c7d5ea7093b920a7bf72c03aff17
https://github.com/qemu/qemu/commit/37fdb2f56a90c7d5ea7093b920a7bf72c03aff17
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M MAINTAINERS
M hw/arm/Kconfig
M meson.build
M rust/Kconfig
A rust/hw/Kconfig
A rust/hw/char/Kconfig
A rust/hw/char/meson.build
A rust/hw/char/pl011/.gitignore
A rust/hw/char/pl011/Cargo.lock
A rust/hw/char/pl011/Cargo.toml
A rust/hw/char/pl011/README.md
A rust/hw/char/pl011/meson.build
A rust/hw/char/pl011/src/device.rs
A rust/hw/char/pl011/src/device_class.rs
A rust/hw/char/pl011/src/lib.rs
A rust/hw/char/pl011/src/memory_ops.rs
A rust/hw/meson.build
M rust/meson.build
M scripts/archive-source.sh
M scripts/make-release
A scripts/rust/rust_root_crate.sh
M subprojects/.gitignore
A subprojects/arbitrary-int-1-rs.wrap
A subprojects/bilge-0.2-rs.wrap
A subprojects/bilge-impl-0.2-rs.wrap
A subprojects/either-1-rs.wrap
A subprojects/itertools-0.11-rs.wrap
A subprojects/packagefiles/arbitrary-int-1-rs/meson.build
A subprojects/packagefiles/bilge-0.2-rs/meson.build
A subprojects/packagefiles/bilge-impl-0.2-rs/meson.build
A subprojects/packagefiles/either-1-rs/meson.build
A subprojects/packagefiles/itertools-0.11-rs/meson.build
A subprojects/packagefiles/proc-macro-error-1-rs/meson.build
A subprojects/packagefiles/proc-macro-error-attr-1-rs/meson.build
A subprojects/packagefiles/unicode-ident-1-rs/meson.build
A subprojects/proc-macro-error-1-rs.wrap
A subprojects/proc-macro-error-attr-1-rs.wrap
Log Message:
-----------
rust: add PL011 device model
This commit adds a re-implementation of hw/char/pl011.c in Rust.
How to build:
1. Configure a QEMU build with:
--enable-system --target-list=aarch64-softmmu --enable-rust
2. Launching a VM with qemu-system-aarch64 should use the Rust version
of the pl011 device
Co-authored-by: Junjie Mao <junjie.mao@intel.com>
Co-authored-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-2-051e7a25b978@linaro.org
Commit: be3fc97a09535f65214b8ec3485452f94e830594
https://github.com/qemu/qemu/commit/be3fc97a09535f65214b8ec3485452f94e830594
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/qemu-api-macros/meson.build
Log Message:
-----------
meson: import rust module into a global variable
Tested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: d1e526c170d6e485851ab99237fb11cdaa7faccf
https://github.com/qemu/qemu/commit/d1e526c170d6e485851ab99237fb11cdaa7faccf
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
Log Message:
-----------
meson: remove repeated search for rust_root_crate.sh
Avoid repeated lines of the form
Program scripts/rust/rust_root_crate.sh found: YES
(/home/pbonzini/work/upstream/qemu/scripts/rust/rust_root_crate.sh)
in the meson logs.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 7b72c7dd0d4dbbcc8a909533a5c70e9935b201c3
https://github.com/qemu/qemu/commit/7b72c7dd0d4dbbcc8a909533a5c70e9935b201c3
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/qemu-api/meson.build
M rust/qemu-api/src/device_class.rs
Log Message:
-----------
meson: pass rustc_args when building all crates
rustc_args is needed to smooth the difference in warnings between the various
versions of rustc. Always include those arguments.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: b00bf4edeec97a21bf682c8bde7d6a4557058f5c
https://github.com/qemu/qemu/commit/b00bf4edeec97a21bf682c8bde7d6a4557058f5c
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/Kconfig
Log Message:
-----------
rust: do not always select X_PL011_RUST
Right now the Rust pl011 device is included in all QEMU system
emulator binaries if --enable-rust is passed. This is not needed
since the board logic in hw/arm/Kconfig will pick it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 00ed18de3537c783add0be5ea1e0a84979f6f63b
https://github.com/qemu/qemu/commit/00ed18de3537c783add0be5ea1e0a84979f6f63b
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/qemu-api/src/definitions.rs
Log Message:
-----------
rust: do not use --no-size_t-is-usize
This is not necessary and makes it harder to write code that is
portable between 32- and 64-bit systems: it adds extra casts even
though size_of, align_of or offset_of already return the right type.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 2eb6274d12b92eb57dc6fa0516c4248509f4a66a
https://github.com/qemu/qemu/commit/2eb6274d12b92eb57dc6fa0516c4248509f4a66a
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/memory_ops.rs
M rust/qemu-api/src/definitions.rs
M rust/qemu-api/src/device_class.rs
Log Message:
-----------
rust: remove uses of #[no_mangle]
Mangled symbols do not cause any issue; disabling mangling is only useful if
C headers reference the Rust function, which is not the case here.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 4f7521916d12e07d25d5175f2da9614624344a7b
https://github.com/qemu/qemu/commit/4f7521916d12e07d25d5175f2da9614624344a7b
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api-macros/src/lib.rs
M rust/qemu-api/src/definitions.rs
Log Message:
-----------
rust: modernize link_section usage for ELF platforms
Some newer ABI implementations do not provide .ctors; and while
some linkers rewrite .ctors into .init_array, not all of them do.
Use the newer .init_array ABI, which works more reliably, and
apply it to all non-Apple, non-Windows platforms.
This is similar to how the ctor crate operates; without this change,
"#[derive(Object)]" does not work on Fedora 41.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: cde3c425d16f6d0c8e6f47940ef5152b9021f3f2
https://github.com/qemu/qemu/commit/cde3c425d16f6d0c8e6f47940ef5152b9021f3f2
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/qemu-api/meson.build
M rust/qemu-api/src/lib.rs
R rust/qemu-api/src/tests.rs
A rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: build integration test for the qemu_api crate
Adjust the integration test to compile with a subset of QEMU object
files, and make it actually create an object of the class it defines.
Follow the Rust filesystem conventions, where tests go in tests/ if
they use the library in the same way any other code would.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: e90d470733d3d2ca185a0b379ef8773601f60cfb
https://github.com/qemu/qemu/commit/e90d470733d3d2ca185a0b379ef8773601f60cfb
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api-macros/src/lib.rs
M rust/qemu-api/src/definitions.rs
Log Message:
-----------
rust: cleanup module_init!, use it from #[derive(Object)]
Remove the duplicate code by using the module_init! macro; at the same time,
simplify how module_init! is used, by taking inspiration from the implementation
of #[derive(Object)].
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 03a573b960dae735847e6b6877b5cc3d07466e94
https://github.com/qemu/qemu/commit/03a573b960dae735847e6b6877b5cc3d07466e94
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api/src/device_class.rs
Log Message:
-----------
rust: clean up define_property macro
Use the "struct update" syntax to initialize most of the fields to zero,
and simplify the handmade type-checking of $name.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: c92c447ff04ca6a5b80da2930d87637b34713b8c
https://github.com/qemu/qemu/commit/c92c447ff04ca6a5b80da2930d87637b34713b8c
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api/src/device_class.rs
Log Message:
-----------
rust: make properties array immutable
Now that device_class_set_props() takes a const pointer, the only part of
"define_property!" that needs to be non-const is the call to try_into().
This in turn will only break if offset_of returns a value with the most
significant bit set (i.e. a struct size that is >=2^31 or >= 2^63,
respectively on 32- and 64-bit system), which is impossible.
Just use a cast and clean everything up to remove the run-time
initialization. This also removes a use of OnceLock, which was only
stabilized in 1.70.0.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 6e50bde1e1c8edc70145fb87b21b0d0843250600
https://github.com/qemu/qemu/commit/6e50bde1e1c8edc70145fb87b21b0d0843250600
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/memory_ops.rs
M rust/qemu-api/meson.build
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/src/lib.rs
A rust/qemu-api/src/zeroable.rs
Log Message:
-----------
rust: provide safe wrapper for MaybeUninit::zeroed()
MaybeUninit::zeroed() is handy, but it introduces unsafe (and has a
pretty heavy syntax in general). Introduce a trait that provides the
same functionality while staying within safe Rust.
In addition, MaybeUninit::zeroed() is not available as a "const"
function until Rust 1.75.0, so this also prepares for having handwritten
implementations of the trait until we can assume that version.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: f60f3670fd15edaa9dc6471dde26703b4417b815
https://github.com/qemu/qemu/commit/f60f3670fd15edaa9dc6471dde26703b4417b815
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust: do not use TYPE_CHARDEV unnecessarily
In the invocation of qdev_prop_set_chr(), "chardev" is the name of a
property rather than a type and has to match the name of the property
in device_class.rs. Do not use TYPE_CHARDEV here, just like in the C
version of pl011_create.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 0a65e4124ad9c6dab594d738cac31fd32d19402c
https://github.com/qemu/qemu/commit/0a65e4124ad9c6dab594d738cac31fd32d19402c
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api/meson.build
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/src/lib.rs
A rust/qemu-api/src/vmstate.rs
M rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: add definitions for vmstate
Add a new qemu_api module, `vmstate`. Declare a bunch of Rust
macros declared that are equivalent in spirit to the C macros in
include/migration/vmstate.h.
For example the Rust of equivalent of the C macro:
VMSTATE_UINT32(field_name, struct_name)
is:
vmstate_uint32!(field_name, StructName)
This breathtaking development will allow us to reach feature parity between
the Rust and C pl011 implementations.
Extracted from a patch by Manos Pitsidianakis
(https://lore.kernel.org/qemu-devel/20241024-rust-round-2-v1-4-051e7a25b978@linaro.org/).
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 113c66885280bb20296969d780be54fbd42213ad
https://github.com/qemu/qemu/commit/113c66885280bb20296969d780be54fbd42213ad
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device_class.rs
Log Message:
-----------
rust/pl011: fix default value for migrate-clock
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 93243319db276bb424b7f9ad0bdfa8dc4b3368bd
https://github.com/qemu/qemu/commit/93243319db276bb424b7f9ad0bdfa8dc4b3368bd
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust/pl011: add support for migration
Declare the vmstate description of the PL011 device.
Based on a patch by Manos Pitsidianakis
(https://lore.kernel.org/qemu-devel/20241024-rust-round-2-v1-4-051e7a25b978@linaro.org/).
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-4-051e7a25b978@linaro.org
Commit: 2e57bb6b27214fa96e3a340b342d8f653a92e8f9
https://github.com/qemu/qemu/commit/2e57bb6b27214fa96e3a340b342d8f653a92e8f9
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust/pl011: move CLK_NAME static to function scope
We do not need to have CLK_NAME public nor a static. No functional change.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-5-051e7a25b978@linaro.org
Commit: 2e06e72d2e37093301683dcee5e55d129b5f57a7
https://github.com/qemu/qemu/commit/2e06e72d2e37093301683dcee5e55d129b5f57a7
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust/pl011: add TYPE_PL011_LUMINARY device
Add a device specialization for the Luminary UART device.
This commit adds a DeviceId enum that utilizes the Index trait to return
different bytes depending on what device id the UART has (Arm -default-
or Luminary)
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Zhao Liu <zhao1.liu@intel.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-6-051e7a25b978@linaro.org
Commit: d38723f568db5abd2cd83df64df83580be4f0d9e
https://github.com/qemu/qemu/commit/d38723f568db5abd2cd83df64df83580be4f0d9e
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust/pl011: remove commented out C code
This code juxtaposed what should be happening according to the C device
model but is not needed now that this has been reviewed (I hope) and its
validity checked against what the C device does (I hope, again).
No functional change.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-8-051e7a25b978@linaro.org
Commit: 230b710bf4337335e17721f68e59ce2f590bbeec
https://github.com/qemu/qemu/commit/230b710bf4337335e17721f68e59ce2f590bbeec
Author: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust/pl011: Use correct masks for IBRD and FBRD
Port fix from commit cd247eae16ab1b9ce97fd34c000c1b883feeda45
"hw/char/pl011: Use correct masks for IBRD and FBRD"
Related issue: <https://gitlab.com/qemu-project/qemu/-/issues/2610>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link:
https://lore.kernel.org/r/20241024-rust-round-2-v1-9-051e7a25b978@linaro.org
Commit: 64644bc4eab2f21d2c225d6a0970a959b00e8efa
https://github.com/qemu/qemu/commit/64644bc4eab2f21d2c225d6a0970a959b00e8efa
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M .gitattributes
M subprojects/bilge-impl-0.2-rs.wrap
A subprojects/packagefiles/bilge-impl-1.63.0.patch
Log Message:
-----------
rust: patch bilge-impl to allow compilation with 1.63.0
Apply a patch that removes "let ... else" constructs, replacing them with
"if let ... else" or "let ... = match ...". "let ... else" was stabilized in
Rust 1.65.0.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 646b5378e0ff4b369ea7cc050689c1c65ed041a7
https://github.com/qemu/qemu/commit/646b5378e0ff4b369ea7cc050689c1c65ed041a7
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M subprojects/packagefiles/proc-macro2-1-rs/meson.build
Log Message:
-----------
rust: fix cfgs of proc-macro2 for 1.63.0
Replay the configuration that would be computed by build.rs when compiling
on a 1.63.0 compiler.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 9f7d4520d679364f7ca95b7ddb899ff084e7d7c6
https://github.com/qemu/qemu/commit/9f7d4520d679364f7ca95b7ddb899ff084e7d7c6
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/lib.rs
M rust/hw/char/pl011/src/memory_ops.rs
M rust/qemu-api/src/definitions.rs
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/src/lib.rs
M rust/qemu-api/src/vmstate.rs
M rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: use std::os::raw instead of core::ffi
core::ffi::c_* types were introduced in Rust 1.64.0. Use the older types
in std::os::raw, which are now aliases of the types in core::ffi. There is
no need to compile QEMU as no_std, so this is acceptable as long as we support
a version of Debian with Rust 1.63.0.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 718e255f0a97cf43939ae2e90ba4673ae9a8bd2f
https://github.com/qemu/qemu/commit/718e255f0a97cf43939ae2e90ba4673ae9a8bd2f
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
M rust/qemu-api/meson.build
A rust/qemu-api/src/c_str.rs
M rust/qemu-api/src/lib.rs
M rust/qemu-api/src/vmstate.rs
M rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: introduce a c_str macro
This allows CStr constants to be defined easily on Rust 1.63.0, while
checking that there are no embedded NULs. c"" literals were only
stabilized in Rust 1.77.0.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: c6ea723da9acd63fb4ef2350318168bf4645835e
https://github.com/qemu/qemu/commit/c6ea723da9acd63fb4ef2350318168bf4645835e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M .gitlab-ci.d/buildtest.yml
M meson.build
M meson_options.txt
M scripts/meson-buildoptions.sh
Log Message:
-----------
rust: silence unknown warnings for the sake of old compilers
Occasionally, we may need to silence warnings and clippy lints that
were only introduced in newer Rust compiler versions. However, this
would fail when compiling with an older rustc:
error: unknown lint: `non_local_definitions`
--> rust/qemu-api/rust-qemu-api-tests.p/structured/offset_of.rs:79:17
So by default we need to block the unknown_lints warning. To avoid
misspelled lints or other similar issues, re-enable it in the CI job
that uses nightly rust.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 907d2bbb80d6180fa27a719536844fd096fa0157
https://github.com/qemu/qemu/commit/907d2bbb80d6180fa27a719536844fd096fa0157
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/hw/char/pl011/Cargo.lock
M rust/qemu-api-macros/Cargo.lock
M rust/qemu-api/Cargo.lock
M rust/qemu-api/Cargo.toml
Log Message:
-----------
rust: synchronize dependencies between subprojects and Cargo.lock
The next commit will introduce a new build.rs dependency for rust/qemu-api,
version_check. Before adding it, ensure that all dependencies are
synchronized between the Meson- and cargo-based build systems.
Note that it's not clear whether in the long term we'll use Cargo for
anything; it seems that the three main uses (clippy, rustfmt, rustdoc)
can all be invoked manually---either via glue code in QEMU, or by
extending Meson to gain the relevant functionality. However, for
the time being we're stuck with Cargo so it should at least look at
the same code as the rest of the build system.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 39c8faefb5e9bf1265cf754f43a17a4ac092d7a3
https://github.com/qemu/qemu/commit/39c8faefb5e9bf1265cf754f43a17a4ac092d7a3
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
A rust/Cargo.lock
A rust/Cargo.toml
R rust/hw/char/pl011/Cargo.lock
M rust/hw/char/pl011/Cargo.toml
R rust/qemu-api-macros/Cargo.lock
M rust/qemu-api-macros/Cargo.toml
R rust/qemu-api/Cargo.lock
M rust/qemu-api/Cargo.toml
Log Message:
-----------
rust: create a cargo workspace
Workspaces allows tracking dependencies for multiple crates at once,
by having a single Cargo.lock file at the top of the rust/ tree.
Because QEMU's Cargo.lock files have to be synchronized with the versions
of crates in subprojects/, using a workspace avoids the need to copy
over the Cargo.lock file when adding a new device (and thus a new crate)
under rust/hw/.
In addition, workspaces let cargo download and build dependencies just
once. While right now we have one leaf crate (hw/char/pl011), this
will not be the case once more devices are added.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: f3518400882022ddcbe1148abf2165917a7b4640
https://github.com/qemu/qemu/commit/f3518400882022ddcbe1148abf2165917a7b4640
Author: Junjie Mao <junjie.mao@hotmail.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/Cargo.lock
M rust/hw/char/pl011/src/device.rs
M rust/qemu-api-macros/Cargo.toml
M rust/qemu-api-macros/src/lib.rs
M rust/qemu-api/Cargo.toml
M rust/qemu-api/build.rs
M rust/qemu-api/meson.build
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/src/lib.rs
A rust/qemu-api/src/offset_of.rs
M rust/qemu-api/src/vmstate.rs
M rust/qemu-api/tests/tests.rs
M subprojects/packagefiles/syn-2-rs/meson.build
Log Message:
-----------
rust: introduce alternative implementation of offset_of!
offset_of! was stabilized in Rust 1.77.0. Use an alternative implemenation
that was found on the Rust forums, and whose author agreed to license as
MIT for use in QEMU.
The alternative allows only one level of field access, but apart
from this can be used just by replacing core::mem::offset_of! with
qemu_api::offset_of!.
The actual implementation of offset_of! is done in a declarative macro,
but for simplicity and to avoid introducing an extra level of indentation,
the trigger is a procedural macro #[derive(offsets)].
The procedural macro is perhaps a bit overengineered, but it helps
introducing some idioms that will be useful in the future as well.
Signed-off-by: Junjie Mao <junjie.mao@hotmail.com>
Co-developed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: bb42965dd417042d171ecf98cb470c430b592134
https://github.com/qemu/qemu/commit/bb42965dd417042d171ecf98cb470c430b592134
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M rust/qemu-api/src/zeroable.rs
Log Message:
-----------
rust: do not use MaybeUninit::zeroed()
MaybeUninit::zeroed() is handy but is not available as a "const" function
until Rust 1.75.0.
Remove the default implementation of Zeroable::ZERO, and write by hand
the definitions for those types that need it. It may be possible to
add automatic implementation of the trait, via a procedural macro and/or
a trick similar to offset_of!, but do it the easy way for now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: e2b3905b6612d23365ef1c9e01112f5e17900f20
https://github.com/qemu/qemu/commit/e2b3905b6612d23365ef1c9e01112f5e17900f20
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
Log Message:
-----------
rust: clean up detection of the language
Disable the detection code altogether if have_system == false.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 4fe146926fd50a9a2f5591fedc46c7aef7b4bd32
https://github.com/qemu/qemu/commit/4fe146926fd50a9a2f5591fedc46c7aef7b4bd32
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
Log Message:
-----------
rust: allow version 1.63.0 of rustc
All constructs introduced by newer versions of Rust have been removed.
Apart from Debian 12, all other supported Linux distributions have
rustc 1.75.0 or newer. This means that they only lack c"" literals
and stable offset_of!.
Tested-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: ce4a144cf817d401592918faa86f4903d3c78c3e
https://github.com/qemu/qemu/commit/ce4a144cf817d401592918faa86f4903d3c78c3e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-05 (Tue, 05 Nov 2024)
Changed paths:
M meson.build
M rust/hw/char/pl011/src/device.rs
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: do not use --generate-cstr
--generate-cstr is a good idea and generally the right thing to do,
but it is not available in Debian 12 and Ubuntu 22.04. Work around
the absence.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: c2988dfbb0ecd30496625f8fb1afc52a74304259
https://github.com/qemu/qemu/commit/c2988dfbb0ecd30496625f8fb1afc52a74304259
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-06 (Wed, 06 Nov 2024)
Changed paths:
M docs/about/build-platforms.rst
M meson.build
Log Message:
-----------
rust: allow older version of bindgen
Cope with the old version that is provided in Debian 12.
--size_t-is-usize is needed on bindgen <0.61.0, and it was removed in
bindgen 0.65.0, so check for it in meson.build.
--merge-extern-blocks was added in 0.61.0.
--formatter rustfmt was added in 0.65.0 and is the default, so remove it.
Apart from Debian 12 and Ubuntu 22.04, all other supported distros have
version 0.66.x of bindgen or newer (or do not have bindgen at all).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 5b1b5a8ae40d3fcbc3f9ede3fe9227064f9a480f
https://github.com/qemu/qemu/commit/5b1b5a8ae40d3fcbc3f9ede3fe9227064f9a480f
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-06 (Wed, 06 Nov 2024)
Changed paths:
M meson.build
Log Message:
-----------
rust: make rustfmt optional
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: 951f71ad67bd474aba6925529daf45b747aac86e
https://github.com/qemu/qemu/commit/951f71ad67bd474aba6925529daf45b747aac86e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2024-11-06 (Wed, 06 Nov 2024)
Changed paths:
M scripts/ci/setup/ubuntu/ubuntu-2204-aarch64.yaml
M scripts/ci/setup/ubuntu/ubuntu-2204-s390x.yaml
M tests/docker/dockerfiles/ubuntu2204.docker
M tests/lcitool/mappings.yml
M tests/lcitool/refresh
Log Message:
-----------
dockerfiles: install bindgen from cargo on Ubuntu 22.04
Because Ubuntu 22.04 has a very old version of bindgen, that
does not have the important option --allowlist-file, it will
not be able to use --enable-rust out of the box. Instead,
install the latest version of bindgen-cli via "cargo install"
in the container, following QEMU's own documentation.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Commit: a1dacb66915eb7d08a0596cc97068a37c39930d3
https://github.com/qemu/qemu/commit/a1dacb66915eb7d08a0596cc97068a37c39930d3
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2024-11-06 (Wed, 06 Nov 2024)
Changed paths:
M .gitattributes
M .gitlab-ci.d/buildtest.yml
M docs/about/build-platforms.rst
M hw/core/qdev-properties.c
M include/hw/qdev-core.h
M include/hw/qdev-properties.h
M meson.build
M meson_options.txt
A rust/Cargo.lock
A rust/Cargo.toml
M rust/hw/char/Kconfig
R rust/hw/char/pl011/Cargo.lock
M rust/hw/char/pl011/Cargo.toml
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
M rust/hw/char/pl011/src/memory_ops.rs
R rust/qemu-api-macros/Cargo.lock
M rust/qemu-api-macros/Cargo.toml
M rust/qemu-api-macros/meson.build
M rust/qemu-api-macros/src/lib.rs
R rust/qemu-api/Cargo.lock
M rust/qemu-api/Cargo.toml
M rust/qemu-api/build.rs
M rust/qemu-api/meson.build
A rust/qemu-api/src/c_str.rs
M rust/qemu-api/src/definitions.rs
M rust/qemu-api/src/device_class.rs
M rust/qemu-api/src/lib.rs
A rust/qemu-api/src/offset_of.rs
R rust/qemu-api/src/tests.rs
A rust/qemu-api/src/vmstate.rs
A rust/qemu-api/src/zeroable.rs
A rust/qemu-api/tests/tests.rs
M rust/wrapper.h
M scripts/ci/setup/ubuntu/ubuntu-2204-aarch64.yaml
M scripts/ci/setup/ubuntu/ubuntu-2204-s390x.yaml
M scripts/meson-buildoptions.sh
M subprojects/bilge-impl-0.2-rs.wrap
A subprojects/packagefiles/bilge-impl-1.63.0.patch
M subprojects/packagefiles/proc-macro2-1-rs/meson.build
M subprojects/packagefiles/syn-2-rs/meson.build
M system/qdev-monitor.c
M tests/docker/dockerfiles/ubuntu2204.docker
M tests/lcitool/mappings.yml
M tests/lcitool/refresh
Log Message:
-----------
Merge tag 'for-upstream-rust' of https://gitlab.com/bonzini/qemu into staging
* 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
# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmcrrtIUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroPIBwf/W0Jo87UauGYufhEmoPvWG1EAQEqP
# EzNTzem9Iw92VdiSTkAtED0/TSd8RBJOwDfjjusVXZtuMPwpRNgXaFhYTT5gFTMj
# Nk3NZGaX/mbNrtdrukdx9mvUWeovytdZDZccTNkpc3oyiqY9NEz06wZ0tCNJEot6
# qO3dEtKXTOQTdx2R3o0oS+2OFDGEEPxZ0PuXN3sClN4iZhGfcIDsjGAWxEh6mCDy
# VxqKPdax1Ig1w7M+JMclnpOsVHwcefjHiToNPwhCEGelJ9BZilkViuvBzsVRJJz3
# ptYyywBE0FT8MiKQ/wyf7U64qoizJuIgHoQnUGj98hdgvbUUiW5jcBNY3A==
# =s591
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 06 Nov 2024 18:00:50 GMT
# gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* tag 'for-upstream-rust' of https://gitlab.com/bonzini/qemu: (39 commits)
dockerfiles: install bindgen from cargo on Ubuntu 22.04
rust: make rustfmt optional
rust: allow older version of bindgen
rust: do not use --generate-cstr
rust: allow version 1.63.0 of rustc
rust: clean up detection of the language
rust: do not use MaybeUninit::zeroed()
rust: introduce alternative implementation of offset_of!
rust: create a cargo workspace
rust: synchronize dependencies between subprojects and Cargo.lock
rust: silence unknown warnings for the sake of old compilers
rust: introduce a c_str macro
rust: use std::os::raw instead of core::ffi
rust: fix cfgs of proc-macro2 for 1.63.0
rust: patch bilge-impl to allow compilation with 1.63.0
rust/pl011: Use correct masks for IBRD and FBRD
rust/pl011: remove commented out C code
rust/pl011: add TYPE_PL011_LUMINARY device
rust/pl011: move CLK_NAME static to function scope
rust/pl011: add support for migration
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Compare: https://github.com/qemu/qemu/compare/63dc36944383...a1dacb66915e
To unsubscribe from these emails, change your notification settings at
https://github.com/qemu/qemu/settings/notifications
- [Qemu-commits] [qemu/qemu] d36f16: qdev: make properties array "const",
Peter Maydell <=