public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: "Xu, Anthony" <anthony.xu@intel.com>
Cc: Avi Kivity <avi@qumranet.com>, Alexander Graf <agraf@suse.de>,
	Jes Sorensen <jes@sgi.com>,
	kvm@vger.kernel.org, kvm-ia64@vger.kernel.org
Subject: Re: [RFC] kvm irq assignment
Date: Sat, 14 Jun 2008 20:32:01 -0300	[thread overview]
Message-ID: <20080614233201.GA24715@dmt.cnet> (raw)
In-Reply-To: <51CFAB8CB6883745AE7B93B3E084EBE201CC9210@pdsmsx412.ccr.corp.intel.com>

Hi Anthony,

On Fri, Jun 13, 2008 at 02:38:08PM +0800, Xu, Anthony wrote:
> Hi Avi and all
> 
> This is the revised one,
> 
> All PCI devices send interrupt to both PIC and IOAPIC,  
> a). When PIC is enabled and IOAPIC is disabled,  all redirect entries in
> IOAPIC are masked.
> B) When PIC is disabled and IPAPIC is enabled, link entry bit7 is set,
> means this link entry is disable.
> Guest OS need to guarantee PIC and IOAPIC are not enabled in the same
> time. Otherwise cause many suspicious interrupt to guest.
> 
> Test by running guest linux in kvm/ia32 and kvm/ia64.

Interrupt sharing is stable under Linux, PCI hotplug is happy, and
Windows is happy. Ship it!

I had to apply your patch by hand, your mailer eats newlines and other
nasty things, please fix that (or send attached patches).

>  
> +    Name (PICD, 0)
>  
> -    /* PCI Bus definition */
> +    Method(_PIC, 1)
> +    {
> +        Store(Arg0, PICD)
> +    }
> +
> +    /*PCI Bus definition */

Why did you take off the space before the "P" of PCI? Before you ask me,
no, I don't have anything better to do :)

>      Scope(\_SB) {
>          Device(PCI0) {
>              Name (_HID, EisaId ("PNP0A03"))
>              Name (_ADR, 0x00)
>              Name (_UID, 1)
> -            Name(_PRT, Package() {
> +
> +            Method(_PRT,0){
> +                If(PICD){

Put some spaces there too.

> diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
> index a23a466..f96fbb5 100644
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -27,6 +27,8 @@
>  #include "net.h"
>  #include "pc.h"
>  
> +#include "qemu-kvm.h"
> +
>  //#define DEBUG_PCI
>  
>  struct PCIBus {
> @@ -534,12 +536,18 @@ static void pci_set_irq(void *opaque, int irq_num,
> int level)
>      PCIDevice *pci_dev = (PCIDevice *)opaque;
>      PCIBus *bus;
>      int change;
> -
> +#ifdef KVM_CAP_IRQCHIP
> +    int irq;
> +#endif 
>      change = level - pci_dev->irq_state[irq_num];
>      if (!change)
>          return;
>  
>      pci_dev->irq_state[irq_num] = level;
> +#ifdef KVM_CAP_IRQCHIP
> +    irq = ioapic_map_irq(pci_dev->devfn, irq_num);
> +    ioapic_set_irq(opaque, irq, change);
> +#endif

I think you should avoid any changes to pci.c. Perhaps create a new
ioapic_and_pic_map / ioapic_and_pic_set pair of functions and change
pc.c to use that instead of piix_set_irq.

Other than that (and KVM_CAP_IRQCHIP mentioned by Avi, along with making
sure this works with "-no-kvm") looks great.

Regarding the non-PIIX link devices I mentioned, that can be done later
if necessary.


  parent reply	other threads:[~2008-06-14 23:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 16:39 [RFC] kvm irq assignment Xu, Anthony
2008-06-12 19:16 ` Avi Kivity
2008-06-13  2:45   ` Xu, Anthony
2008-06-13  6:38   ` Xu, Anthony
2008-06-13 14:22     ` Avi Kivity
2008-06-16  1:36       ` Xu, Anthony
2008-06-14 23:32     ` Marcelo Tosatti [this message]
2008-06-16  1:34       ` Xu, Anthony
2008-06-16  5:31       ` Xu, Anthony
2008-06-16 15:52         ` Marcelo Tosatti
     [not found]     ` <3073362C-AF0F-4DBC-989C-AAA5E2875BDF@suse.de>
2008-06-16  1:26       ` Xu, Anthony
2008-06-16  5:40       ` Xu, Anthony

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=20080614233201.GA24715@dmt.cnet \
    --to=mtosatti@redhat.com \
    --cc=agraf@suse.de \
    --cc=anthony.xu@intel.com \
    --cc=avi@qumranet.com \
    --cc=jes@sgi.com \
    --cc=kvm-ia64@vger.kernel.org \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox