Messages in this thread Patch in this message | | | Date | Fri, 11 Jan 2008 08:40:38 +0100 | From | Ingo Molnar <> | Subject | Re: [x86/mm] vsyscall_fn fault in early startup |
| |
* Roland McGrath <roland@redhat.com> 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@elte.hu>
Signed-off-by: Ingo Molnar <mingo@elte.hu> --- 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) {
| |