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-changelog

[Xen-changelog] [xen-unstable] linux: Use new time hypercalls.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] linux: Use new time hypercalls.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Mar 2007 13:30:15 -0800
Delivery-date: Fri, 09 Mar 2007 13:30:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173468984 0
# Node ID cedf9e4ac6ff6c3541d90b2ad5db6e224e3e574d
# Parent  83756471416f861ddd70a3de0ab187ac1d5c2b17
linux: Use new time hypercalls.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c |   26 +++++++++++++++++++++--
 linux-2.6-xen-sparse/drivers/xen/Kconfig         |    7 ++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff -r 83756471416f -r cedf9e4ac6ff 
linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Fri Mar 09 19:34:52 
2007 +0000
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Fri Mar 09 19:36:24 
2007 +0000
@@ -907,6 +907,10 @@ static void setup_cpu0_timer_irq(void)
        BUG_ON(per_cpu(timer_irq, 0) < 0);
 }
 
+static struct vcpu_set_periodic_timer xen_set_periodic_tick = {
+       .period_ns = NS_PER_TICK
+};
+
 void __init time_init(void)
 {
 #ifdef CONFIG_HPET_TIMER
@@ -919,6 +923,10 @@ void __init time_init(void)
                return;
        }
 #endif
+
+       HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0,
+                          &xen_set_periodic_tick);
+
        get_time_values_from_xen(0);
 
        processed_system_time = per_cpu(shadow_time, 0).system_timestamp;
@@ -976,8 +984,10 @@ EXPORT_SYMBOL(jiffies_to_st);
  */
 static void stop_hz_timer(void)
 {
+       struct vcpu_set_singleshot_timer singleshot;
        unsigned int cpu = smp_processor_id();
        unsigned long j;
+       int rc;
 
        cpu_set(cpu, nohz_cpu_mask);
 
@@ -997,8 +1007,15 @@ static void stop_hz_timer(void)
                j = jiffies + 1;
        }
 
-       if (HYPERVISOR_set_timer_op(jiffies_to_st(j)) != 0)
-               BUG();
+       singleshot.timeout_abs_ns = jiffies_to_st(j);
+       rc = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &singleshot);
+#ifdef XEN_COMPAT_030004
+       if (rc) {
+               BUG_ON(rc != -ENOSYS);
+               rc = HYPERVISOR_set_timer_op(singleshot.timeout_abs_ns);
+       }
+#endif
+       BUG_ON(rc);
 }
 
 static void start_hz_timer(void)
@@ -1030,6 +1047,8 @@ void time_resume(void)
        init_cpu_khz();
 
        for_each_online_cpu(cpu) {
+               HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+                                  &xen_set_periodic_tick);
                get_time_values_from_xen(cpu);
                per_cpu(processed_system_time, cpu) =
                        per_cpu(shadow_time, 0).system_timestamp;
@@ -1049,6 +1068,9 @@ int local_setup_timer(unsigned int cpu)
        int seq, irq;
 
        BUG_ON(cpu == 0);
+
+       HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+                          &xen_set_periodic_tick);
 
        do {
                seq = read_seqbegin(&xtime_lock);
diff -r 83756471416f -r cedf9e4ac6ff linux-2.6-xen-sparse/drivers/xen/Kconfig
--- a/linux-2.6-xen-sparse/drivers/xen/Kconfig  Fri Mar 09 19:34:52 2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig  Fri Mar 09 19:36:24 2007 +0000
@@ -227,6 +227,9 @@ choice
        config XEN_COMPAT_030002_AND_LATER
                bool "3.0.2 and later"
 
+       config XEN_COMPAT_030004_AND_LATER
+               bool "3.0.4 and later"
+
        config XEN_COMPAT_LATEST_ONLY
                bool "no compatibility code"
 
@@ -236,6 +239,10 @@ config XEN_COMPAT_030002
        bool
        default XEN_COMPAT_030002_AND_LATER
 
+config XEN_COMPAT_030004
+       bool
+       default XEN_COMPAT_030002_AND_LATER || XEN_COMPAT_030004_AND_LATER
+
 endmenu
 
 config HAVE_IRQ_IGNORE_UNHANDLED

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] linux: Use new time hypercalls., Xen patchbot-unstable <=