qemu/semihosting
Keith Packard 978c2bf97b semihosting: Write back semihosting data before completion callback
'lock_user' allocates a host buffer to shadow a target buffer,
'unlock_user' copies that host buffer back to the target and frees the
host memory. If the completion function uses the target buffer, it
must be called after unlock_user to ensure the data are present.

This caused the arm-compatible TARGET_SYS_READC to fail as the
completion function, common_semi_readc_cb, pulled data from the target
buffer which would not have been gotten the console data.

I decided to fix all instances of this pattern instead of just the
console_read function to make things consistent and potentially fix
bugs in other cases.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221012014822.1242170-1-keithp@keithp.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230124180127.1881110-24-alex.bennee@linaro.org>
2023-02-02 11:48:20 +00:00
..
arm-compat-semi.c semihosting/arm-compat-semi: Avoid using hardcoded /tmp 2022-10-31 20:37:58 +00:00
config.c semihosting: Allow optional use of semihosting from userspace 2022-09-13 17:18:21 +01:00
console.c cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
guestfd.c semihosting: Create qemu_semihosting_guestfd_init 2022-06-28 04:36:50 +05:30
Kconfig
meson.build semihosting: Split out semihost_sys_open 2022-06-28 04:35:39 +05:30
syscalls.c semihosting: Write back semihosting data before completion callback 2023-02-02 11:48:20 +00:00
uaccess.c semihosting: Simplify softmmu_lock_user_string 2022-06-28 04:35:06 +05:30