qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rust: Kconfig: factor out Rust vs C impl choice
@ 2025-03-19 19:31 Peter Maydell
  2025-03-19 19:31 ` [PATCH 1/2] rust: Kconfig: Factor out whether PL011 is Rust or C Peter Maydell
  2025-03-19 19:31 ` [PATCH 2/2] rust: Kconfig: Factor out whether HPET " Peter Maydell
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2025-03-19 19:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust, Paolo Bonzini, Tanish Desai

This patchset fixes a compilation failure if CONFIG_VMAPPLE is
enabled in a Rust build, which happens because hw/vmapple/Kconfig
didn't have the "pick the Rust PL011 if Rust is enabled" logic in it.
Rather than just adding that to yet another PL011-using board
model, this patchset refactors how we handle devices which have
both a Rust and C implementation in Kconfig:
 * CONFIG_PL011 is "do we have/want a PL011 of some kind"
 * CONFIG_PL011_C is the C impl
 * CONFIG_X_PL011_RUST is the rust impl
 * selecting CONFIG_PL011 pulls in one impl or the other
   depending on whether the build has Rust enabled or not

For the PL011, this lets us drop a lot of duplicate logic
in Kconfig files for boards; for HPET this simplifies
places in code that have ifdefs for "do we have an HPET?".

NB: I think this should be OK but haven't been able to do
complete testing because currently in head-of-git
"make check-functional" doesn't pass for arm with Rust
enabled due to a different issue.

thanks
-- PMM

Peter Maydell (2):
  rust: Kconfig: Factor out whether PL011 is Rust or C
  rust: Kconfig: Factor out whether HPET is Rust or C

 configs/devices/i386-softmmu/default.mak |  1 -
 hw/i386/fw_cfg.c                         |  2 +-
 hw/i386/pc.c                             |  2 +-
 hw/arm/Kconfig                           | 30 ++++++++----------------
 hw/char/Kconfig                          |  6 +++++
 hw/char/meson.build                      |  2 +-
 hw/timer/Kconfig                         |  8 ++++++-
 hw/timer/meson.build                     |  2 +-
 rust/hw/timer/Kconfig                    |  1 -
 tests/qtest/meson.build                  |  3 +--
 10 files changed, 28 insertions(+), 29 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-19 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19 19:31 [PATCH 0/2] rust: Kconfig: factor out Rust vs C impl choice Peter Maydell
2025-03-19 19:31 ` [PATCH 1/2] rust: Kconfig: Factor out whether PL011 is Rust or C Peter Maydell
2025-03-19 21:08   ` Philippe Mathieu-Daudé
2025-03-19 19:31 ` [PATCH 2/2] rust: Kconfig: Factor out whether HPET " Peter Maydell

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).