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

[Xen-devel] Re: [PATCH] xen: disable PV spinlocks on HVM

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] xen: disable PV spinlocks on HVM
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 8 Sep 2011 13:45:15 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 08 Sep 2011 05:37:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E67E10A.3020809@xxxxxxxx>
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: <1315327307-392-1-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <4E67E10A.3020809@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 7 Sep 2011, Jeremy Fitzhardinge wrote:
> On 09/06/2011 09:41 AM, stefano.stabellini@xxxxxxxxxxxxx wrote:
> > From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> >
> > PV spinlocks cannot possibly work with the current code because they are
> > enabled after pvops patching has already been done, and because PV
> > spinlocks use a different data structure than native spinlocks so we
> > cannot switch between them dynamically. A spinlock that has been taken
> > once by the native code (__ticket_spin_lock) cannot be taken by
> > __xen_spin_lock even after it has been released.
> >
> > Reported-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> > ---
> >  arch/x86/xen/smp.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> > index e79dbb9..51339b4 100644
> > --- a/arch/x86/xen/smp.c
> > +++ b/arch/x86/xen/smp.c
> > @@ -522,7 +522,6 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned 
> > int max_cpus)
> >     WARN_ON(xen_smp_intr_init(0));
> >  
> >     xen_init_lock_cpu(0);
> > -   xen_init_spinlocks();
> >  }
> 
> Should I add this back here on the pv ticketlock branch?
 
I think that Konrad is going to pick it up and send it as an important
bug fix, CC'ing stable too.
However I also have another patch to enable PV spinlock on HVM again,
that relies on your pv ticket lock work. This one should probably go
at the end of your series (appended).

---


xen: initialize PV spinlocks for HVM guests before patching is done

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 51339b4..e24e9a2 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -551,4 +551,5 @@ void __init xen_hvm_smp_init(void)
        smp_ops.cpu_die = xen_hvm_cpu_die;
        smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
        smp_ops.send_call_func_single_ipi = 
xen_smp_send_call_function_single_ipi;
+       xen_init_spinlocks();
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>