All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] versatile: Push lsi initialization to the end
Date: Mon, 08 Oct 2012 18:39:01 +0200	[thread overview]
Message-ID: <507301A5.8030004@redhat.com> (raw)
In-Reply-To: <CAFEAcA91WRVsHqxho-08=gaOrypT4iAuKESuuiRcEt3QCwRdMw@mail.gmail.com>

Il 08/10/2012 18:33, Peter Maydell ha scritto:
> On 5 October 2012 18:30, Jan Kiszka <jan.kiszka@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

3. bottom halves are an internal concept to the block layer that has
been hijacked by device models.  The bottom half idea is that the code
would run as soon as the current code is done with this subsystem;
ideally, you would instead queue a work item in a thread-pool and the
code would block on the same fine-grained lock as the subsystem that
created the bottom half.  Work items from different subsystems would be
able to run concurrently---of course that's not too helpful while we
have a single lock for the whole iothread...

Stefan's work should be able to kill qemu_bh_new inside the block layer
(replacing it with aio_bh_new), so qemu_bh_new can be repurposed to
something that doesn't conflict with the block layer.

Paolo

      reply	other threads:[~2012-10-08 16:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 17:30 [Qemu-devel] [PATCH] versatile: Push lsi initialization to the end Jan Kiszka
2012-10-05 17:42 ` Peter Maydell
2012-10-05 18:01   ` Jan Kiszka
2012-10-06  2:13     ` Peter Maydell
2012-10-08  6:52       ` Jan Kiszka
2012-10-08 15:18         ` Paolo Bonzini
2012-10-08 15:28           ` Jan Kiszka
2012-10-08 16:02             ` Peter Maydell
2012-10-08 16:28               ` Paolo Bonzini
2012-10-08 16:46                 ` Jan Kiszka
2012-10-08 17:07         ` Aurelien Jarno
2012-10-08 17:09           ` Jan Kiszka
2012-10-08 16:33 ` Peter Maydell
2012-10-08 16:39   ` Paolo Bonzini [this message]

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=507301A5.8030004@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.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.