WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Xen 4.1.2 HVM guest realtek nic problems (eth0 8

To: Keir Fraser <keir.xen@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Xen 4.1.2 HVM guest realtek nic problems (eth0 8139cp transmit queue timed out)
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 7 Nov 2011 12:02:03 +0000
Cc: "xen@xxxxxxxxxxxxxxxxxxxxxxx" <xen@xxxxxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Stefano
Delivery-date: Mon, 07 Nov 2011 04:06:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAD88F26.24242%keir.xen@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CAD88F26.24242%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Thu, 3 Nov 2011, Keir Fraser wrote:
> On 03/11/2011 18:07, "Pasi Kärkkäinen" <pasik@xxxxxx> wrote:
> 
> > On Tue, Nov 01, 2011 at 10:56:06PM +0200, Pasi Kärkkäinen wrote:
> >> On Mon, Oct 31, 2011 at 09:29:24PM +0200, Pasi Kärkkäinen wrote:
> >>> On Mon, Oct 31, 2011 at 12:24:14PM -0700, Boris Derzhavets wrote:
> >>>>    Seems to related
> >>>> 
> >>>>    https://bugs.launchpad.net/ubuntu/+source/xen/+bug/854829
> >>>> 
> >>> 
> >>> Thanks, that seems to be the same bug.
> >>> 
> >>> Is the bugfix patch from xen-unstable going to backported to
> >>> xen-4.1-testing.hg ?
> >>> (4.1 backported patch available on ubuntu's launchpad above..)
> >>> 
> >> 
> >> So the Ubuntu backport from xen-unstable to Xen 4.1.1 is here:
> >> https://launchpadlibrarian.net/81948978/xen-pirq-resubmit-irq.patch
> >> 
> >> It seems to be shipping in Ubuntu 11.10 xen 4.1.1-2ubuntu4.1 packages.
> >> 
> >> Does that patch look suitable to be applied to xen-4.1-testing.hg ?
> >> This bug should be fixed for Xen 4.1.3.
> > 
> > Any comments? 
> 
> This looks like a backport of Stefano's xen-unstable c/s 24007. I would like
> him to submit/ack the backport, as it is not a trivial backport of the
> xen-unstable patch.

I would rather use the following backport. Compared to the other one it
returns EINVAL in PHYSDEVOP_irq_status_query when the arguments are not
correct.

---

diff -r 8c2d76193eaf xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Wed Nov 02 15:02:18 2011 +0000
+++ b/xen/arch/x86/physdev.c    Mon Nov 07 11:58:28 2011 +0000
@@ -261,6 +261,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
+        spin_lock(&v->domain->event_lock);
         if ( v->domain->arch.pirq_eoi_map )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
@@ -268,6 +269,19 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = pirq_guest_eoi(v->domain, eoi.irq);
         else
             ret = 0;
+        if ( is_hvm_domain(v->domain) &&
+                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
+        {
+            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
+            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
+
+            /* if this is a level irq and count > 0, send another
+             * notification */ 
+            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
+                    && hvm_irq->gsi_assert_count[gsi] )
+                send_guest_pirq(v->domain, eoi.irq);
+        }
+        spin_unlock(&v->domain->event_lock);
         break;
     }
 
@@ -323,9 +337,10 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
         irq_status_query.flags = 0;
         if ( is_hvm_domain(v->domain) &&
-             domain_pirq_to_irq(v->domain, irq) <= 0 )
+                domain_pirq_to_irq(v->domain, irq) <= 0 &&
+                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
         {
-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+            ret = -EINVAL;
             break;
         }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>