diff options
author | Evgeny Iakovlev <eiakovlev@linux.microsoft.com> | 2023-01-23 17:23:01 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-02-03 12:59:22 +0000 |
commit | 13ea96fa34bcb6076f42a41194ab363c945e4b07 (patch) | |
tree | c172454cc1ebd58928b72d6f3aa8261e5b884bcc /hmp-commands.hx | |
parent | 9d88935cb19f8f8e7291026efe23862316ff2510 (diff) | |
download | qemu-13ea96fa34bcb6076f42a41194ab363c945e4b07.zip qemu-13ea96fa34bcb6076f42a41194ab363c945e4b07.tar.gz qemu-13ea96fa34bcb6076f42a41194ab363c945e4b07.tar.bz2 |
hw/char/pl011: add post_load hook for backwards-compatibility
Previous change slightly modified the way we handle data writes when
FIFO is disabled. Previously we kept incrementing read_pos and were
storing data at that position, although we only have a
single-register-deep FIFO now. Then we changed it to always store data
at pos 0.
If guest disables FIFO and the proceeds to read data, it will work out
fine, because we still read from current read_pos before setting it to
0.
However, to make code less fragile, introduce a post_load hook for
PL011State and move fixup read FIFO state when FIFO is disabled. Since
we are introducing a post_load hook, also do some sanity checking on
untrusted incoming input state.
Signed-off-by: Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
Message-id: 20230123162304.26254-3-eiakovlev@linux.microsoft.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hmp-commands.hx')
0 files changed, 0 insertions, 0 deletions