Re: [x86/mm] vsyscall_fn fault in early startup

From: Ingo Molnar
Date: Fri Jan 11 2008 - 02:41:04 EST



* Roland McGrath <roland@xxxxxxxxxx> wrote:

> I bisected my startup problem down to:

i fixed this in my tree yesterday but was held up by another problem
from uploading it. The patch below should apply to the tree you have.

Ingo

-------------->
Subject: x86: fix sched_clock()
From: Ingo Molnar <mingo@xxxxxxx>

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/kernel/rtc.c | 12 ------------
include/asm-x86/msr.h | 11 ++++++++++-
2 files changed, 10 insertions(+), 13 deletions(-)

Index: linux-x86.q/arch/x86/kernel/rtc.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/rtc.c
+++ linux-x86.q/arch/x86/kernel/rtc.c
@@ -195,15 +195,3 @@ int update_persistent_clock(struct times
{
return set_rtc_mmss(now.tv_sec);
}
-
-unsigned long long __vsyscall_fn native_read_tsc(void)
-{
- DECLARE_ARGS(val, low, high);
-
- rdtsc_barrier();
- asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
- rdtsc_barrier();
-
- return EAX_EDX_VAL(val, low, high);
-}
-EXPORT_SYMBOL_GPL(native_read_tsc);
Index: linux-x86.q/include/asm-x86/msr.h
===================================================================
--- linux-x86.q.orig/include/asm-x86/msr.h
+++ linux-x86.q/include/asm-x86/msr.h
@@ -91,7 +91,16 @@ static inline int native_write_msr_safe(
return err;
}

-extern unsigned long long native_read_tsc(void);
+static __always_inline unsigned long long native_read_tsc(void)
+{
+ DECLARE_ARGS(val, low, high);
+
+ rdtsc_barrier();
+ asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
+ rdtsc_barrier();
+
+ return EAX_EDX_VAL(val, low, high);
+}

static inline unsigned long long native_read_pmc(int counter)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/