On 5 October 2012 18:30, Jan Kiszka <jan.kis...@siemens.com> wrote:
> This is nasty, but there is no better way given current mux logic:
>
> As setting up the block device will trigger a qemu_bh_poll while there
> are qemu_chr open events in the queue, we have to register the UARTs
> and everything else that might be mux'ed first so that the right active
> frontend is already registered when the bottom-half is finally
> processed.

So I guess this comes down to what the semantics of bottom halves are.
I can see two plausible options:

 1. bottom halves are a mechanism provided by our cpu/device
    simulation framework, and so will never be run before the
    simulation is fully initialised
  * this means devices can register BHs which set irq lines,
    send events to chr mux front ends etc etc
  * it also means that device setup mustn't trigger a bh_poll
    (so we'd need to track down the bit of the block device
    setup that's causing this)

 2. bottom halves are a generic mechanism that you can use
    not just as part of the simulation, and so BHs may run
    as soon as they're registered
  * this would let us use them for arbitrary purposes in init
  * we'd need to audit and fix all the current uses to check
    whether they're safe to run early or if they need to have
    a 'do nothing if simulation not running' check

Any opinions?

-- PMM

Reply via email to