[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 07/13] semihosting: Don't copy buffer after console_write()
From: |
Alex Bennée |
Subject: |
[PATCH v1 07/13] semihosting: Don't copy buffer after console_write() |
Date: |
Mon, 25 Jul 2022 15:05:14 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
The console_write() semihosting function outputs guest data from a
buffer; it doesn't update that buffer. It therefore doesn't need to
pass a length value to unlock_user(), but can pass 0, meaning "do not
copy any data back to the guest memory".
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220719121110.225657-3-peter.maydell@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
semihosting/syscalls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c
index 4847f66c02..508a0ad88c 100644
--- a/semihosting/syscalls.c
+++ b/semihosting/syscalls.c
@@ -627,7 +627,7 @@ static void console_write(CPUState *cs,
gdb_syscall_complete_cb complete,
}
ret = qemu_semihosting_console_write(ptr, len);
complete(cs, ret ? ret : -1, ret ? 0 : EIO);
- unlock_user(ptr, buf, ret);
+ unlock_user(ptr, buf, 0);
}
static void console_fstat(CPUState *cs, gdb_syscall_complete_cb complete,
--
2.30.2
- [PATCH v1 00/13] fixes for 7.1 (testing, docs, semihosting), Alex Bennée, 2022/07/25
- [PATCH v1 01/13] tests: refresh to latest libvirt-ci module, Alex Bennée, 2022/07/25
- [PATCH v1 02/13] gitlab: show testlog.txt contents when cirrus/custom-runner jobs fail, Alex Bennée, 2022/07/25
- [PATCH v1 04/13] .cirrus.yml: Change winsymlinks to 'native', Alex Bennée, 2022/07/25
- [PATCH v1 05/13] .gitlab-ci.d/windows.yml: Enable native Windows symlink, Alex Bennée, 2022/07/25
- [PATCH v1 06/13] semihosting: Don't return negative values on qemu_semihosting_console_write() failure, Alex Bennée, 2022/07/25
- [PATCH v1 07/13] semihosting: Don't copy buffer after console_write(),
Alex Bennée <=
- [PATCH v1 08/13] semihosting: Check for errors on SET_ARG(), Alex Bennée, 2022/07/25
- [PATCH v1 11/13] tests/tcg/s390x: Test unaligned accesses to lowcore, Alex Bennée, 2022/07/25
- [PATCH v1 10/13] qapi: Add exit-failure PanicAction, Alex Bennée, 2022/07/25
- [PATCH v1 13/13] qemu-options: bring the kernel and image options together, Alex Bennée, 2022/07/25
- [PATCH v1 12/13] docs/devel: fix description of OBJECT_DECLARE_SIMPLE_TYPE, Alex Bennée, 2022/07/25
- [PATCH v1 03/13] gitlab: drop 'containers-layer2' stage, Alex Bennée, 2022/07/25
- [PATCH v1 09/13] semihosting: Fix handling of buffer in TARGET_SYS_TMPNAM, Alex Bennée, 2022/07/25