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] xen: PV on HVM: support PV spinlocks

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] xen: PV on HVM: support PV spinlocks
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 13 Aug 2010 20:06:43 +0100
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Delivery-date: Fri, 13 Aug 2010 12:07:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
xen: PV on HVM: support PV spinlocks

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

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 6f53453..5643c43 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1290,6 +1290,8 @@ static int __cpuinit xen_hvm_cpu_notify(struct 
notifier_block *self,
        switch (action) {
        case CPU_UP_PREPARE:
                per_cpu(xen_vcpu, cpu) = 
&HYPERVISOR_shared_info->vcpu_info[cpu];
+               if (xen_have_vector_callback)
+                       xen_init_lock_cpu(cpu);
                break;
        default:
                break;
@@ -1301,6 +1303,20 @@ static struct notifier_block __cpuinitdata 
xen_hvm_cpu_notifier = {
        .notifier_call  = xen_hvm_cpu_notify,
 };
 
+static void xen_hvm_spinlock_init(void)
+{
+       if (!xen_have_vector_callback)
+               return
+       xen_init_lock_cpu(0);
+       xen_init_spinlocks();
+}
+
+static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus)
+{
+       xen_hvm_spinlock_init();
+       native_smp_prepare_cpus(max_cpus);
+}
+
 static void __init xen_hvm_guest_init(void)
 {
        int r;
@@ -1320,6 +1336,7 @@ static void __init xen_hvm_guest_init(void)
        x86_init.irqs.intr_init = xen_init_IRQ;
        xen_hvm_init_time_ops();
        xen_hvm_init_mmu_ops();
+       smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
 }
 
 static bool __init xen_hvm_platform(void)

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

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