From b783601d1a3b3fd468035baf0ce2ead166e0abdc Mon Sep 17 00:00:00 2001 From: Bernhard Beschow Date: Sun, 15 Jun 2025 13:20:36 +0200 Subject: [PATCH] rust: pl011: Add missing logging to match C version Co-developed-by: Paolo Bonzini Signed-off-by: Bernhard Beschow Link: https://lore.kernel.org/r/20250615112037.11992-4-shentey@gmail.com Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs index 92dc295540e..5b53f2649f1 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -305,6 +305,12 @@ impl PL011Registers { } fn write_data_register(&mut self, value: u32) -> bool { + if !self.control.enable_uart() { + log_mask_ln!(Log::GuestError, "PL011 data written to disabled UART"); + } + if !self.control.enable_transmit() { + log_mask_ln!(Log::GuestError, "PL011 data written to disabled TX UART"); + } // interrupts always checked let _ = self.loopback_tx(value.into()); self.int_level |= Interrupt::TX; -- 2.47.2