Am 11. Juni 2025 07:55:20 UTC schrieb Paolo Bonzini <pbonz...@redhat.com>:
>On 6/10/25 22:21, Bernhard Beschow wrote:
>> Now that there is logging support in Rust for QEMU, use it in the pl011
>> device.
>Adding also this to match the C code:
>
>diff --git a/rust/hw/char/pl011/src/device.rs
>b/rust/hw/char/pl011/src/device.rs
>index 42dfa9509dc..e505abfae86 100644
>--- a/rust/hw/char/pl011/src/device.rs
>+++ b/rust/hw/char/pl011/src/device.rs
>@@ -305,6 +305,12 @@ fn read_data_register(&mut self, update: &mut bool) ->
>u32 {
> }
> fn write_data_register(&mut self, value: u32) -> bool {
>+ if !self.control.enable_uart() {
>+ log_mask!(Log::GuestError, "PL011 data written to disabled
>UART\n");
>+ }
>+ if !self.control.enable_transmit() {
>+ log_mask!(Log::GuestError, "PL011 data written to disabled TX
>UART\n");
>+ }
> // interrupts always checked
> let _ = self.loopback_tx(value.into());
> self.int_level |= Interrupt::TX;
>
Will add as separate patch in v3.
Best regards,
Bernhard