All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Date: Sun, 24 Aug 2008 09:22:10 +0000	[thread overview]
Message-ID: <48B12842.5090308@qumranet.com> (raw)
In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDC01845A2E@pdsmsx415.ccr.corp.intel.com>

Zhang, Xiantao wrote:
> Hi, Avi
>    Please help to apply this patch. It will fix kvm/ia64's networking
> issue. 
> Thanks
> Xiantao
> From fe6e28ce9295acba107438979fe6ead0d24f7e20 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Fri, 22 Aug 2008 17:14:15 +0800
> Subject: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
>
> kvm/ia64's IRQ may >16, but current Qemu can't support it.
> Here we implment a IRQ map function to solve this issue to
> enable its networking.
>
> Signed-off-by: Anthony Xu <anthony.xu@intel.com>
> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu/hw/ipf.c |   24 ++++++++++++++++++++++++
>  qemu/hw/pci.c |    9 +++++++++
>  2 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c
> index b11e328..ffa7843 100644
> --- a/qemu/hw/ipf.c
> +++ b/qemu/hw/ipf.c
> @@ -672,3 +672,27 @@ QEMUMachine ipf_machine = {
>      ipf_init_pci,
>      VGA_RAM_SIZE + VGA_RAM_SIZE,
>  };
> +
> +#define IOAPIC_NUM_PINS 48
> +
> +static int ioapic_irq_count[IOAPIC_NUM_PINS];
> +
> +int ioapic_map_irq(int devfn, int irq_num)
> +{
> +    int irq, dev;
> +    dev = devfn >> 3;
> +    irq = ((((dev << 2) + (dev >> 3) + irq_num) & 31) + 16);
> +    return irq;
> +}
> +
> +void ioapic_set_irq(void *opaque, int vector, int level)
> +{
> +    if( level )
>   

if (level)

> +        ioapic_irq_count[vector] += 1;
> +    else
> +        ioapic_irq_count[vector] -= 1;
> +
> +    if (kvm_enabled())
> +	if (kvm_set_irq(vector, ioapic_irq_count[vector] = 0))
> +	    return;
> +}
>   

Please move this to pci.c.  This can be made to work for x86 too.

> diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
> index 92683d1..fac58c5 100644
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -544,6 +544,15 @@ static void pci_set_irq(void *opaque, int irq_num,
> int level)
>          return;
>  
>      pci_dev->irq_state[irq_num] = level;
> +#if defined(TARGET_IA64)
> +{   int irq;
> +    extern int ioapic_map_irq(int devfn, int irq_num);
> +    extern void ioapic_set_irq(void *opaque, int vector, int level);
>   

Use headers instead (or move the functions here).

> +    
> +    irq = ioapic_map_irq(pci_dev->devfn, irq_num);
> +    ioapic_set_irq(NULL, irq, level);
> +}
>   


> +#endif
>      for (;;) {
>          bus = pci_dev->bus;
>          irq_num = bus->map_irq(pci_dev, irq_num);
>   


-- 
error compiling committee.c: too many arguments to function


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@qumranet.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Cc: kvm-ia64@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
Date: Sun, 24 Aug 2008 12:22:10 +0300	[thread overview]
Message-ID: <48B12842.5090308@qumranet.com> (raw)
In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDC01845A2E@pdsmsx415.ccr.corp.intel.com>

Zhang, Xiantao wrote:
> Hi, Avi
>    Please help to apply this patch. It will fix kvm/ia64's networking
> issue. 
> Thanks
> Xiantao
> From fe6e28ce9295acba107438979fe6ead0d24f7e20 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Fri, 22 Aug 2008 17:14:15 +0800
> Subject: [PATCH] KVM: Qemu: Enable kvm/ia64's network.
>
> kvm/ia64's IRQ may >16, but current Qemu can't support it.
> Here we implment a IRQ map function to solve this issue to
> enable its networking.
>
> Signed-off-by: Anthony Xu <anthony.xu@intel.com>
> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
> ---
>  qemu/hw/ipf.c |   24 ++++++++++++++++++++++++
>  qemu/hw/pci.c |    9 +++++++++
>  2 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c
> index b11e328..ffa7843 100644
> --- a/qemu/hw/ipf.c
> +++ b/qemu/hw/ipf.c
> @@ -672,3 +672,27 @@ QEMUMachine ipf_machine = {
>      ipf_init_pci,
>      VGA_RAM_SIZE + VGA_RAM_SIZE,
>  };
> +
> +#define IOAPIC_NUM_PINS 48
> +
> +static int ioapic_irq_count[IOAPIC_NUM_PINS];
> +
> +int ioapic_map_irq(int devfn, int irq_num)
> +{
> +    int irq, dev;
> +    dev = devfn >> 3;
> +    irq = ((((dev << 2) + (dev >> 3) + irq_num) & 31) + 16);
> +    return irq;
> +}
> +
> +void ioapic_set_irq(void *opaque, int vector, int level)
> +{
> +    if( level )
>   

if (level)

> +        ioapic_irq_count[vector] += 1;
> +    else
> +        ioapic_irq_count[vector] -= 1;
> +
> +    if (kvm_enabled())
> +	if (kvm_set_irq(vector, ioapic_irq_count[vector] == 0))
> +	    return;
> +}
>   

Please move this to pci.c.  This can be made to work for x86 too.

> diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
> index 92683d1..fac58c5 100644
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -544,6 +544,15 @@ static void pci_set_irq(void *opaque, int irq_num,
> int level)
>          return;
>  
>      pci_dev->irq_state[irq_num] = level;
> +#if defined(TARGET_IA64)
> +{   int irq;
> +    extern int ioapic_map_irq(int devfn, int irq_num);
> +    extern void ioapic_set_irq(void *opaque, int vector, int level);
>   

Use headers instead (or move the functions here).

> +    
> +    irq = ioapic_map_irq(pci_dev->devfn, irq_num);
> +    ioapic_set_irq(NULL, irq, level);
> +}
>   


> +#endif
>      for (;;) {
>          bus = pci_dev->bus;
>          irq_num = bus->map_irq(pci_dev, irq_num);
>   


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-08-24  9:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  9:36 [PATCH] KVM: Qemu: Enable kvm/ia64's network Zhang, Xiantao
2008-08-22  9:36 ` Zhang, Xiantao
2008-08-24  9:22 ` Avi Kivity [this message]
2008-08-24  9:22   ` Avi Kivity
2008-08-24  9:35 ` Zhang, Xiantao
2008-08-24  9:35   ` Zhang, Xiantao
2008-08-24  9:50 ` Avi Kivity
2008-08-24  9:50   ` Avi Kivity
2008-08-25  1:53 ` Zhang, Xiantao
2008-08-25  1:53   ` Zhang, Xiantao
2008-08-25 11:35 ` Avi Kivity
2008-08-25 11:35   ` Avi Kivity

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=48B12842.5090308@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-ia64@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 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.