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] [RFC][PATCH 05/10] xen/hybrid: Add PV halt support

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Subject: [Xen-devel] [RFC][PATCH 05/10] xen/hybrid: Add PV halt support
From: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
Date: Wed, 16 Sep 2009 16:42:26 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Eddie Dong <eddie.dong@xxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Sheng Yang <sheng@xxxxxxxxxxxxxxx>
Delivery-date: Wed, 16 Sep 2009 01:45:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1253090551-7969-1-git-send-email-sheng@xxxxxxxxxxxxxxx>
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: <1253090551-7969-1-git-send-email-sheng@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |    2 ++
 arch/x86/xen/irq.c       |   10 ++++++++++
 arch/x86/xen/xen-ops.h   |    1 +
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b290d65..b95c696 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1122,5 +1122,7 @@ void __init xen_start_hybrid(void)
        r = init_hybrid_info();
        if (r < 0)
                return;
+
+       xen_hybrid_init_irq_ops();
 }
 
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index cfd1779..52885c1 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -98,6 +98,10 @@ PV_CALLEE_SAVE_REGS_THUNK(xen_irq_enable);
 
 static void xen_safe_halt(void)
 {
+       /* Do local_irq_enable() explicitly in hybrid guest */
+       if (xen_hybrid_enabled())
+               local_irq_enable();
+
        /* Blocking includes an implicit local_irq_enable(). */
        if (HYPERVISOR_sched_op(SCHEDOP_block, NULL) != 0)
                BUG();
@@ -130,3 +134,9 @@ void __init xen_init_irq_ops()
 {
        pv_irq_ops = xen_irq_ops;
 }
+
+void __init xen_hybrid_init_irq_ops(void)
+{
+       pv_irq_ops.safe_halt = xen_safe_halt;
+       pv_irq_ops.halt = xen_halt;
+}
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index ca6596b..9bb90d5 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -43,6 +43,7 @@ void xen_vcpu_restore(void);
 void __init xen_build_dynamic_phys_to_machine(void);
 
 void xen_init_irq_ops(void);
+void xen_hybrid_init_irq_ops(void);
 void xen_setup_timer(int cpu);
 void xen_teardown_timer(int cpu);
 cycle_t xen_clocksource_read(void);
-- 
1.5.4.5


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