[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/2] target/xtensa: Use semihosting/syscalls.h
From: |
Alex Bennée |
Subject: |
Re: [PATCH v5 2/2] target/xtensa: Use semihosting/syscalls.h |
Date: |
Wed, 29 Jun 2022 11:02:27 +0100 |
User-agent: |
mu4e 1.7.27; emacs 28.1.50 |
Max Filippov <jcmvbkbc@gmail.com> writes:
> On Wed, Jun 29, 2022 at 1:09 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>> Richard Henderson <richard.henderson@linaro.org> writes:
>> > On 6/28/22 19:08, Max Filippov wrote:
>> >> On Tue, Jun 28, 2022 at 4:43 AM Richard Henderson
>> >> <richard.henderson@linaro.org> wrote:
>
>> >>> }
>> >>> - if (serial_hd(0)) {
>> >>> - xtensa_sim_open_console(serial_hd(0));
>> >>> - }
>> >> I've noticed that with this change '-serial stdio' and its variants
>> >> are still
>> >> accepted in the command line, but now they do nothing.
>> >
>> > Pardon? They certainly will do something, via writes to the serial
>> > hardware.
>> >
>> >
>> >> This quiet
>> >> change of behavior is unfortunate. I wonder if it would be acceptable
>> >> to map the '-serial stdio' option in the presence of '-semihosting' to
>> >> something like '-chardev stdio,id=id1 -semihosting-config chardev=id1'?
>> >
>> > I dunno. I'm wary of having xtensa be unique here. Alex, thoughts?
>>
>> Is semihosting *the* serial hardware for xtensa-sim or is it overriding
>> another serial interface? I'm wary of adding more magical behaviour for
>> -serial as it can be confusing enough already what actually gets routed
>> to it if not doing everything explicitly.
>
> There's no notion of 'serial hardware' for the xtensa-sim, all it has is
> the three standard stdio file descriptors.
Which are accessed via semihosting calls? Are they implicitly mapped to
3 chardev devices for stdin, stdout and stderr?
> But it was convenient thinking
> of them as a serial port. I agree that no magic is needed here, but
> the change shouldn't be quiet eiter, so xtensa-sim should warn (or
> maybe even quit with an error code) when it sees the -serial option.
If the default chardevs already map to the 3 FDs then perhaps -serial
should be invalid because it is more explicit to use -chardev to
redirect the stream you want somewhere else. However I don't see them at
the moment:
➜ ./qemu-system-xtensa -M sim -semihosting -S -display none -monitor stdio
QEMU 7.0.50 monitor - type 'help' for more information
(qemu) info chardev
compat_monitor0: filename=stdio
parallel0: filename=vc
--
Alex Bennée
Re: [PATCH v5 0/2] target/xtensa: semihosting cleanup, Max Filippov, 2022/06/28