From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 03/28] semihosting: implement a semihosting console
Date: Fri, 24 May 2019 11:46:43 +0100 [thread overview]
Message-ID: <877eag165o.fsf@zen.linaroharston> (raw)
In-Reply-To: <CAFEAcA_+=7VfvZRc__q9L3vuHO6YgetrjTPAYJx4eo0mAdcPXg@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Thu, 23 May 2019 at 11:39, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This provides two functions for handling console output that handle
>> the common backend behaviour for semihosting.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
>> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
>> index 08363969c14..b2963547c48 100644
>> --- a/include/exec/gdbstub.h
>> +++ b/include/exec/gdbstub.h
>> @@ -44,6 +44,17 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
>> * argument list.
>> */
>> void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
>> +/**
>> + * gdb_do_console_out:
>> + * @gs: guest address of string to send
>> + * @len: length of string
>> + *
>> + * Sends a string to gdb console. Unlike the system call interface
>> + * there is no callback and we assume the system call always
>> + * succeeds.
>> + */
>> +void gdb_do_console_out(target_ulong s, int len);
>
> I'm not sure about the "no callback" part of this API. The operation
> here is genuinely asynchronous and providing no mechanism for the
> caller to be able to say "ok, now wait til it completes" doesn't
> seem like a good plan.
Well the caller doesn't really get a choice. At least in system mode
gdbstub does a vm_stop(RUN_STATE_DEBUG) and brings everything to a halt
anyway. All we've removed is the ability to tack on a callback (which
can get run in all sorts of contexts) when we restart.
I could just drop the API here and allow the semihosting API to call
gdb_do_syscallv directly?
--
Alex Bennée
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 03/28] semihosting: implement a semihosting console
Date: Fri, 24 May 2019 11:46:43 +0100 [thread overview]
Message-ID: <877eag165o.fsf@zen.linaroharston> (raw)
In-Reply-To: <CAFEAcA_+=7VfvZRc__q9L3vuHO6YgetrjTPAYJx4eo0mAdcPXg@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Thu, 23 May 2019 at 11:39, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This provides two functions for handling console output that handle
>> the common backend behaviour for semihosting.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
>> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
>> index 08363969c14..b2963547c48 100644
>> --- a/include/exec/gdbstub.h
>> +++ b/include/exec/gdbstub.h
>> @@ -44,6 +44,17 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
>> * argument list.
>> */
>> void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
>> +/**
>> + * gdb_do_console_out:
>> + * @gs: guest address of string to send
>> + * @len: length of string
>> + *
>> + * Sends a string to gdb console. Unlike the system call interface
>> + * there is no callback and we assume the system call always
>> + * succeeds.
>> + */
>> +void gdb_do_console_out(target_ulong s, int len);
>
> I'm not sure about the "no callback" part of this API. The operation
> here is genuinely asynchronous and providing no mechanism for the
> caller to be able to say "ok, now wait til it completes" doesn't
> seem like a good plan.
Well the caller doesn't really get a choice. At least in system mode
gdbstub does a vm_stop(RUN_STATE_DEBUG) and brings everything to a halt
anyway. All we've removed is the ability to tack on a callback (which
can get run in all sorts of contexts) when we restart.
I could just drop the API here and allow the semihosting API to call
gdb_do_syscallv directly?
--
Alex Bennée
next prev parent reply other threads:[~2019-05-24 10:46 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 10:25 [PATCH v2 00/28] current testing/next queue Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 01/28] semihosting: move semihosting configuration into its own directory Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 15:12 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 02/28] semihosting: introduce CONFIG_SEMIHOSTING Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 15:12 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 03/28] semihosting: implement a semihosting console Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 13:13 ` Peter Maydell
2019-05-23 13:13 ` Peter Maydell
2019-05-24 10:46 ` Alex Bennée [this message]
2019-05-24 10:46 ` Alex Bennée
2019-05-24 10:56 ` Peter Maydell
2019-05-24 10:56 ` Peter Maydell
2019-05-24 11:25 ` Alex Bennée
2019-05-24 11:25 ` Alex Bennée
2019-05-23 10:25 ` [PATCH v2 04/28] semihosting: enable chardev backed output for console Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 15:16 ` Richard Henderson
2019-05-28 9:36 ` Alex Bennée
2019-05-28 9:36 ` Alex Bennée
2019-05-23 10:25 ` [PATCH v2 05/28] target/arm: fixup some of the commentary for arm-semi Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 06/28] target/arm: use the common interface for WRITE0/WRITEC in arm-semi Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 15:12 ` Richard Henderson
2019-05-23 15:12 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 07/28] target/arm: add LOG_UNIMP messages to arm-semi Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 15:18 ` Richard Henderson
2019-05-23 15:18 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 08/28] target/arm: correct return values for WRITE/READ in arm-semi Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 09/28] target/mips: only build mips-semi for softmmu Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 19:52 ` Richard Henderson
2019-05-23 19:52 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 10/28] target/mips: convert UHI_plog to use common semihosting code Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 11/28] MAINTAINERS: update for semihostings new home Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 19:55 ` Richard Henderson
2019-05-23 19:55 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 12/28] tests/docker: add ubuntu 18.04 Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 13/28] tests/docker: Test more components on the Fedora default image Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 14/28] tests/tcg/multiarch: add support for multiarch system tests Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 15/28] tests/tcg/multiarch: add hello world system test Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 16/28] editorconfig: add settings for .s/.S files Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 17/28] tests/tcg/aarch64: add system boot.S Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 20:10 ` Richard Henderson
2019-05-23 10:25 ` [PATCH v2 18/28] tests/tcg/multiarch: move the system memory test Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 19/28] tests/tcg/minilib: support %c format char Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 20/28] tests/tcg/multiarch: expand system memory test to cover more Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 21/28] tests/tcg/alpha: add system boot.S Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 22/28] .travis.yml: enable aarch64-softmmu and alpha-softmmu tcg tests Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 23/28] Makefile: fix coverage-report reference to BUILD_DIR Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 24/28] Makefile: include per-target build directories in coverage report Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 25/28] Makefile.target: support per-target coverage reports Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 26/28] tests/qemu-iotests/group: Re-use the "auto" group for tests that can always run Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-23 10:25 ` [PATCH v2 27/28] tests/qemu-iotests: re-format output to for make check-block Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
2019-05-27 13:43 ` Max Reitz
2019-05-27 13:43 ` [Qemu-devel] " Max Reitz
2019-05-27 16:20 ` Alex Bennée
2019-05-27 16:20 ` [Qemu-devel] " Alex Bennée
2019-05-27 16:53 ` Max Reitz
2019-05-27 16:53 ` [Qemu-devel] " Max Reitz
2019-05-23 10:25 ` [PATCH v2 28/28] tests: Run the iotests during "make check" again Alex Bennée
2019-05-23 10:25 ` [Qemu-devel] " Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877eag165o.fsf@zen.linaroharston \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.