|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] ix86: don't even register bogus clock sources
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1415888232 -3600
# Node ID 49e06ed72c53a183378ec6efc97caf26846678e7
# Parent 78e400792c76811445c6a80dfebdbded116f1aad
ix86: don't even register bogus clock sources
Neither the raw TSC nor the PIT are suitable clock sources under Xen -
don't even build the respective source files. The few things we need
from them can be put in time-xen.c.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
diff -r 78e400792c76 -r 49e06ed72c53 arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile Thu Nov 13 14:55:41 2014 +0100
+++ b/arch/i386/kernel/Makefile Thu Nov 13 15:17:12 2014 +0100
@@ -84,5 +84,5 @@ SYSCFLAGS_vsyscall-syms.o = -r
early_printk-y += ../../x86_64/kernel/early_printk.o
k8-y += ../../x86_64/kernel/k8.o
-disabled-obj-$(CONFIG_XEN) := i8237.o i8259.o reboot.o smpboot.o
+disabled-obj-$(CONFIG_XEN) := i8237.o i8253.o i8259.o reboot.o smpboot.o tsc.o
%/head.o %/head.s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
diff -r 78e400792c76 -r 49e06ed72c53 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c Thu Nov 13 14:55:41 2014 +0100
+++ b/arch/i386/kernel/time-xen.c Thu Nov 13 15:17:12 2014 +0100
@@ -75,6 +75,9 @@
#if defined (__i386__)
#include <asm/i8259.h>
+#include <asm/i8253.h>
+DEFINE_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
#endif
int pit_latch_buggy; /* extern */
@@ -552,11 +555,15 @@ static int set_rtc_mmss(unsigned long no
return retval;
}
+#ifdef CONFIG_X86_64
/* monotonic_clock(): returns # of nanoseconds passed since time_init()
* Note: This function is required to return accurate
* time even in the absence of multiple timer ticks.
*/
unsigned long long monotonic_clock(void)
+#else
+unsigned long long sched_clock(void)
+#endif
{
unsigned int cpu = get_cpu();
struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
@@ -576,9 +583,9 @@ unsigned long long monotonic_clock(void)
return time;
}
+#ifdef CONFIG_X86_64
EXPORT_SYMBOL(monotonic_clock);
-#ifdef __x86_64__
unsigned long long sched_clock(void)
{
return monotonic_clock();
@@ -751,6 +758,27 @@ irqreturn_t timer_interrupt(int irq, voi
return IRQ_HANDLED;
}
+#ifndef CONFIG_X86_64
+
+void __init tsc_init(void)
+{
+ init_cpu_khz();
+ printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
+ cpu_khz / 1000, cpu_khz % 1000);
+
+ use_tsc_delay();
+}
+
+void mark_tsc_unstable(void)
+{
+#ifndef CONFIG_XEN /* XXX Should tell the hypervisor about this fact. */
+ tsc_unstable = 1;
+#endif
+}
+EXPORT_SYMBOL_GPL(mark_tsc_unstable);
+
+#endif
+
static void init_missing_ticks_accounting(unsigned int cpu)
{
struct vcpu_register_runstate_memory_area area;
@@ -939,11 +967,11 @@ void __init time_init(void)
update_wallclock();
+#ifdef CONFIG_X86_64
init_cpu_khz();
printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
cpu_khz / 1000, cpu_khz % 1000);
-#if defined(__x86_64__)
vxtime.mode = VXTIME_TSC;
vxtime.quot = (1000000L << 32) / vxtime_hz;
vxtime.tsc_quot = (1000L << 32) / cpu_khz;
diff -r 78e400792c76 -r 49e06ed72c53 include/asm-i386/mach-xen/asm/processor.h
--- a/include/asm-i386/mach-xen/asm/processor.h Thu Nov 13 14:55:41 2014 +0100
+++ b/include/asm-i386/mach-xen/asm/processor.h Thu Nov 13 15:17:12 2014 +0100
@@ -23,7 +23,7 @@
#include <xen/interface/physdev.h>
/* flag for disabling the tsc */
-extern int tsc_disable;
+#define tsc_disable 0
struct desc_struct {
unsigned long a,b;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |