All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Avi Kivity <avi@redhat.com>
Cc: Lucas Meneghel Rodrigues <lmr@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Blue Swirl <blauwirbel@gmail.com>, Jan Kiszka <jan.kiszka@web.de>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] pc: Clean up PIC-to-APIC IRQ path
Date: Mon, 5 Sep 2011 11:22:05 +0200	[thread overview]
Message-ID: <20110905092205.GC26890@edde.se.axis.com> (raw)
In-Reply-To: <4E648D75.3000303@redhat.com>

On Mon, Sep 05, 2011 at 11:51:01AM +0300, Avi Kivity wrote:
> On 09/05/2011 11:38 AM, Edgar E. Iglesias wrote:
> > >
> > >  We shouldn't really use the term IRQ as it's confusing.  I like the term
> > >  "pin" better because that describes what we're really talking about.
> > >
> > >  qemu_irq is designed oddly today because is represents something that is
> > >  intrinsically state (whether a pin is high or low) with an edge
> > >  notification with the assumption that the state is held somewhere else
> > >  (which is usually true).
> >
> > I don't agree. That's not what qemu_irq represents.
> > It represents a wire, a mechanism to drive changes through logic paths
> > between state. It is intrinsically stateless.
> >
> > It may be the case that it is missused in some places, or that it isn't
> > always the best thing to use to represent what ever you need to represent,
> > so that you want to complement with other mechanisms.
> > But universally replacing it with a stateful alternative seems wrong to me.
> >
> 
> I agree that qemu_irq is inherently stateless.  But I do think there 
> should be a way for the sink to query the line level.  Whether it is 
> implemented as a cache of the last qemu_set() level, or with callbacks 
> that query the underlying state is not important, but we can't just rely 
> on edge triggers.

I think it is important. Because you need to at least be able to mark the
places were there is state. The cache at the sink sounds more right to me.
An IRQ line, can at the same time have multiple states through its
path between source device and the final sink. Every device that needs to
model state should implement/mark it or maybe connect the the generic caching
sink version and devices that manipulate the level but dont have state,
shouldn't.

> (real hardware can query a line at any time, yes?)

IMO, the "query" is just an upside-down way of thinking of it.

What happens is, you change some state, and the state drives changes through
a logic path towards new state that picks up the updated value etc etc.
Quering is like going (for bus accesses): OK, here's my VGA framebuffer
address, lets do a get back through the bus and see what the CPU wants to
write to this location?

According to the query view, you would add state to the memory regions so
that an MMIO device only gets a xxx_access call, and does a query back to
the core to figure out what's going on. Possible? I'm sure it is. Correct?
who knows. But IMO, a very upside-down way of thinking of it.

Cheers

  parent reply	other threads:[~2011-09-05  9:22 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 14:16 [Qemu-devel] [PATCH] pc: Clean up PIC-to-APIC IRQ path Jan Kiszka
2011-08-28  7:10 ` Blue Swirl
2011-08-28  9:08   ` Jan Kiszka
2011-08-29 19:25 ` Anthony Liguori
2011-08-29 21:06   ` Jan Kiszka
2011-08-29 21:13     ` Avi Kivity
2011-08-29 21:18       ` Jan Kiszka
2011-08-30 19:19       ` Blue Swirl
2011-08-30 19:28         ` Jan Kiszka
2011-08-30 19:43           ` Blue Swirl
2011-08-31  8:25           ` Peter Maydell
2011-08-31 10:53             ` Jan Kiszka
2011-08-31 17:41               ` Blue Swirl
2011-08-31 18:17                 ` Jan Kiszka
2011-08-31 19:44                   ` Blue Swirl
2011-09-04 10:33                     ` Blue Swirl
2011-09-04 12:25                     ` Gleb Natapov
2011-09-03 19:54               ` Anthony Liguori
2011-09-04 12:13                 ` Jan Kiszka
2011-09-04 13:32                   ` Anthony Liguori
2011-09-04 13:36                     ` Jan Kiszka
2011-09-04 13:41                       ` Anthony Liguori
2011-09-04 13:49                         ` Jan Kiszka
2011-09-04 13:57                           ` Anthony Liguori
2011-09-04 14:37                             ` Anthony Liguori
2011-09-04 15:20                               ` Blue Swirl
2011-09-04 15:31                                 ` Anthony Liguori
2011-09-04 15:44                                   ` Blue Swirl
2011-09-05 10:44                             ` Edgar E. Iglesias
2011-09-04 14:12                         ` Avi Kivity
2011-09-04 14:43                           ` Anthony Liguori
2011-09-04 15:03                             ` Avi Kivity
2011-09-04 15:19                               ` Anthony Liguori
2011-09-04 15:34                                 ` Avi Kivity
2011-09-04 15:27                             ` Blue Swirl
2011-09-04 12:17               ` Avi Kivity
2011-09-04 12:37                 ` Jan Kiszka
2011-09-04 12:43                   ` Avi Kivity
2011-09-04 13:38                   ` Anthony Liguori
2011-09-04 13:42                     ` Jan Kiszka
2011-09-04 13:55                       ` Anthony Liguori
2011-09-04 13:35                 ` Anthony Liguori
2011-08-31  8:28         ` Avi Kivity
2011-08-31 16:59           ` Blue Swirl
2011-08-31 18:04             ` Edgar E. Iglesias
2011-08-31 18:28               ` Jan Kiszka
2011-09-01  5:58             ` Avi Kivity
2011-09-03 20:07               ` Anthony Liguori
2011-09-03 21:10                 ` Blue Swirl
2011-09-03 21:41                   ` Anthony Liguori
2011-09-04  9:27                     ` Blue Swirl
2011-09-03 19:53             ` Anthony Liguori
2011-09-03 21:01               ` Blue Swirl
2011-09-04 14:49                 ` Anthony Liguori
2011-09-05  8:38               ` Edgar E. Iglesias
2011-09-05  8:51                 ` Avi Kivity
2011-09-05  9:02                   ` Peter Maydell
2011-09-05  9:14                     ` Avi Kivity
2011-09-05  9:22                   ` Edgar E. Iglesias [this message]
2011-09-05  9:28                     ` Avi Kivity
2011-09-05 10:47                       ` Edgar E. Iglesias
2011-09-05 19:36                 ` Blue Swirl
2011-09-06  7:46                   ` Avi Kivity
2011-09-01  9:08 ` [Qemu-devel] [PATCH v2] pc: Fix and clean " Jan Kiszka
2011-09-03  8:58   ` Blue Swirl
2011-09-03 11:17     ` Jan Kiszka
2011-09-03 11:37       ` Blue Swirl
2011-09-03 18:14         ` Jan Kiszka

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=20110905092205.GC26890@edde.se.axis.com \
    --to=edgar.iglesias@gmail.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=kraxel@redhat.com \
    --cc=lmr@redhat.com \
    --cc=mtosatti@redhat.com \
    --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.