Skip to content

Commit 5b14454

Browse files
bonzinipm215
authored andcommitted
Revert "hw/char/pl011: Warn when using disabled receiver"
The guest does not control whether characters are sent on the UART. Sending them before the guest happens to boot will now result in a "guest error" log entry that is only because of timing, even if the guest _would_ later setup the receiver correctly. This reverts the bulk of commit abf2b6a, and instead adds a comment about why we don't check the enable bits. Cc: Philippe Mathieu-Daudé <[email protected]> Cc: Peter Maydell <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Message-id: [email protected] [PMM: expanded comment] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
1 parent 9223d68 commit 5b14454

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

hw/char/pl011.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,16 +490,17 @@ static int pl011_can_receive(void *opaque)
490490
unsigned fifo_depth = pl011_get_fifo_depth(s);
491491
unsigned fifo_available = fifo_depth - s->read_count;
492492

493-
if (!(s->cr & CR_UARTEN)) {
494-
qemu_log_mask(LOG_GUEST_ERROR,
495-
"PL011 receiving data on disabled UART\n");
496-
}
497-
if (!(s->cr & CR_RXE)) {
498-
qemu_log_mask(LOG_GUEST_ERROR,
499-
"PL011 receiving data on disabled RX UART\n");
500-
}
501-
trace_pl011_can_receive(s->lcr, s->read_count, fifo_depth, fifo_available);
493+
/*
494+
* In theory we should check the UART and RX enable bits here and
495+
* return 0 if they are not set (so the guest can't receive data
496+
* until you have enabled the UART). In practice we suspect there
497+
* is at least some guest code out there which has been tested only
498+
* on QEMU and which never bothers to enable the UART because we
499+
* historically never enforced that. So we effectively keep the
500+
* UART continuously enabled regardless of the enable bits.
501+
*/
502502

503+
trace_pl011_can_receive(s->lcr, s->read_count, fifo_depth, fifo_available);
503504
return fifo_available;
504505
}
505506

0 commit comments

Comments
 (0)