[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Semihost SYS_READC implementation (v6)
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] Semihost SYS_READC implementation (v6) |
Date: |
Tue, 17 Dec 2019 11:04:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
On 17/12/19 10:51, Alex Bennée wrote:
>>> Secondly if the vCPU is paused (via console or gdbstub) we need to
>>> unwind from our blocking position and be in a position to restart
>>> cleanly.
>> Perhaps if fifo8_is_empty(&c->fifo) the CPU could update the PC back to
>> the SVC instruction and enter a halted state? Perhaps with a new
>> CPU_INTERRUPT_* flag that would be checked in arm_cpu_has_work.
> I don't think the PC has been updated at this point - but we don't want
> that logic in the common semihosting code. If we cpu_loop_exit the
> exception is still in effect and will re-run when we start again.
So that would work? cpu_loop_exit if the FIFO is empty, reentering via
cpu_interrupt and clearing the interrupt signal in do_arm_semihosting.
> What we really want to do is fall back to the same halting semantics
> that leave us in qemu_wait_io_event until there is something to process.
> Is there any particular reason a blocking semihosting event isn't like
> any other IO event?
The "io" in wait_io_event really stands for "iothread". Usually in
system emulation "waiting for I/O events" means "waiting for an
interrupt" with a halt instruction (for ARM, WFE/WFI), hence my suggestion.
Thanks,
Paolo
- Re: [PATCH] Semihost SYS_READC implementation (v6), Alex Bennée, 2019/12/17
- Re: [PATCH] Semihost SYS_READC implementation (v6), Paolo Bonzini, 2019/12/17
- Re: [PATCH] Semihost SYS_READC implementation (v6), Alex Bennée, 2019/12/17
- Re: [PATCH] Semihost SYS_READC implementation (v6),
Paolo Bonzini <=
- [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Alex Bennée, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Paolo Bonzini, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Alex Bennée, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Paolo Bonzini, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Alex Bennée, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Paolo Bonzini, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Paolo Bonzini, 2019/12/17
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Alex Bennée, 2019/12/18
- Re: [RFC PATCH] semihosting: suspend recieving CPU when blocked (HACK, WIP), Paolo Bonzini, 2019/12/18