qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: peter.crosthwaite@xilinx.com, stefanha@redhat.com,
	sw@weilnetz.de, jasowang@redhat.com,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	dkoch@verizon.com, alex.williamson@redhat.com, kraxel@redhat.com,
	anthony@codemonkey.ws, Paolo Bonzini <pbonzini@redhat.com>,
	afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 0/3] hw: set irq without selecting INTx pin
Date: Mon, 30 Sep 2013 13:39:09 +0300	[thread overview]
Message-ID: <1380537549.3439.15.camel@localhost.localdomain> (raw)
In-Reply-To: <20130930101035.GB20445@redhat.com>

On Mon, 2013-09-30 at 13:10 +0300, Michael S. Tsirkin wrote:
> On Mon, Sep 30, 2013 at 12:43:20PM +0300, Marcel Apfelbaum wrote:
> > On Mon, 2013-09-30 at 12:14 +0300, Michael S. Tsirkin wrote:
> > > On Mon, Sep 30, 2013 at 11:02:06AM +0200, Paolo Bonzini wrote:
> > > > Il 30/09/2013 10:58, Michael S. Tsirkin ha scritto:
> > > > >>> > > As a next step, can we make pci_set_irq non-inline and make
> > > > >>> > > it call pci_irq_handler directly, and get rid of the irq field?
> > > > >> > What irq field? 
> > > > >     /* IRQ objects for the INTA-INTD pins.  */
> > > > >     qemu_irq *irq;
> > > > > 
> > > > 
> > > > That's still used by devices that use common code for PCI and sysbus
> > > > versions (e.g. USB OHCI and EHCI).
> > > > 
> > > > Paolo
> > > 
> > > Well this work wouldn't be complete without
> > > addressing them anyway.
> > > 
> > > These devices would have to create their own
> > > irq in pci-specific code, along the lines of:
> > 
> > This irq field is used also in places where pci_set_irq(PCIDevice dev, level)
> > can't infer the INTx:
> > - PCIExpress: qemu_set_irq(dev->irq[dev->exp.hpev_intx],dev->exp.hpev_notified);
> 
> Well the spec says, explicitly:
> 6.7.3.4.
>  Software Notification of Hot-Plug Events
> ...
> Note that all other interrupt sources within the same Function will
> assert the same virtual INTx wire
> when requesting service.
> 
> I read this to mean that this is a bug,
> and it should simply use pci_set_irq like all other
> devices.
Thanks!
That means that hpev_intx is not necessary at all.
By the way, aer_intx used by Advanced Error Reporting
is also unnecessary. (6.2.4.1.2 has the same note)

I will remove the above fields from PCIExpressDevice.
Marcel

> > - vmxnet3 device: qemu_set_irq(d->irq[int_idx], 1);
> > 
> > What approach should be used here?
> > 
> > Thanks,
> > Marcel
> > > - s->irq = dev->irq[3];
> > > + s->irq = qemu_allocate_irqs(pci_set_irq, dev, 1);
> > > 
> > > 
> > > If there's more than one device like this, we should add
> > > 
> > > /* Return an irq that calls pci_set_irq internally */
> > > qemu_irq *pci_allocate_irq(PCIDevice *);
> > > 
> > 
> > 

  reply	other threads:[~2013-09-30 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 14:40 [Qemu-devel] [PATCH 0/3] hw: set irq without selecting INTx pin Marcel Apfelbaum
2013-09-29 14:40 ` [Qemu-devel] [PATCH 1/3] hw/pci: " Marcel Apfelbaum
2013-09-29 14:40 ` [Qemu-devel] [PATCH 2/3] hw/pci-bridge: set PCI_INTERRUPT_PIN register before shpc init Marcel Apfelbaum
2013-09-29 14:40 ` [Qemu-devel] [PATCH 3/3] hw: assert/deassert interrupts using pci_set_irq wrapper Marcel Apfelbaum
2013-09-29 15:06 ` [Qemu-devel] [PATCH 0/3] hw: set irq without selecting INTx pin Michael S. Tsirkin
2013-09-29 15:24   ` Marcel Apfelbaum
2013-09-29 15:31     ` Michael S. Tsirkin
2013-09-30  8:14   ` Marcel Apfelbaum
2013-09-30  8:58     ` Michael S. Tsirkin
2013-09-30  9:02       ` Paolo Bonzini
2013-09-30  9:14         ` Michael S. Tsirkin
2013-09-30  9:43           ` Marcel Apfelbaum
2013-09-30 10:10             ` Michael S. Tsirkin
2013-09-30 10:39               ` Marcel Apfelbaum [this message]
2013-09-30 10:58                 ` Paolo Bonzini

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=1380537549.3439.15.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=dkoch@verizon.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).