Skip to contentSkip to conversation

PowerPC: remove broken vsyscall code

PATCH In review Sergei Shtylyov (by way of Sergei Shtylyov <[email protected]>) 3 participants 4 messages Nov 6, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PowerPC: remove broken vsyscall code

Remove vsyscalls that were broken by the PowerPC generic TOD patch, also fixing the build breakage due to its bad rebase.

The patch has been tested on PPC32 only. I had to preserve the data that are made visible to userland via /proc/ppc64/systemcfg on PPC64, however now there are only zeroes there and their affect isn't known to me...

---
This patch is against 2.6.18-hrt-dyntick2 patchset.
For the lack of time on restoring/reimplementing the vsyscall functionality, the best thing I could do is to move the broken code out of the way...

 arch/powerpc/kernel/vdso32/gettimeofday.S |  322 ------------------------------
 arch/powerpc/kernel/vdso64/gettimeofday.S |  252 -----------------------
 arch/powerpc/kernel/asm-offsets.c         |   15 -
 arch/powerpc/kernel/smp.c                 |    2 
 arch/powerpc/kernel/time.c                |    1 
 arch/powerpc/kernel/vdso32/Makefile       |    2 
 arch/powerpc/kernel/vdso32/datapage.S     |   18 -
 arch/powerpc/kernel/vdso32/vdso32.lds.S   |    4 
 arch/powerpc/kernel/vdso64/Makefile       |    2 
 arch/powerpc/kernel/vdso64/datapage.S     |   18 -
 arch/powerpc/kernel/vdso64/vdso64.lds.S   |    4 
 include/asm-powerpc/time.h                |   20 -
 include/asm-powerpc/vdso_datapage.h       |   14 -
 13 files changed, 2 insertions(+), 672 deletions(-)
arch/powerpc/kernel/asm-offsets.c +0 -15
Index: linux-2.6/arch/powerpc/kernel/asm-offsets.c
===================================================================
@@ -251,16 +251,7 @@ int main(void)
 #endif /* ! CONFIG_PPC64 */
 
 	/* datapage offsets for use by vdso */
-	DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp));
-	DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec));
-	DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs));
-	DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec));
-	DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count));
-	DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest));
-	DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime));
 	DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
-	DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
-	DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
 #ifdef CONFIG_PPC64
 	DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64));
 	DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
@@ -281,11 +272,5 @@ int main(void)
 	DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
 	DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
 
-	/* Other bits used by the vdso */
-	DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
-	DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
-	DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
-	DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
-
 	return 0;
 }
arch/powerpc/kernel/smp.c +0 -2
Index: linux-2.6/arch/powerpc/kernel/smp.c
===================================================================
@@ -320,8 +320,6 @@ void smp_call_function_interrupt(void)
 	}
 }
 
-extern struct gettimeofday_struct do_gtod;
-
 struct thread_info *current_set[NR_CPUS];
 
 DECLARE_PER_CPU(unsigned int, pvr);
arch/powerpc/kernel/time.c +0 -1
Index: linux-2.6/arch/powerpc/kernel/time.c
===================================================================
@@ -532,7 +532,6 @@ void timer_interrupt(struct pt_regs * re
 		if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
 			tb_last_jiffy = tb_next_jiffy;
 			do_timer(1);
-			timer_recalc_offset(tb_last_jiffy);
 			timer_check_rtc();
 		}
 		write_sequnlock(&xtime_lock);
arch/powerpc/kernel/vdso32/Makefile +1 -1
Index: linux-2.6/arch/powerpc/kernel/vdso32/Makefile
===================================================================
@@ -1,7 +1,7 @@
 
 # List of files in the vdso, has to be asm only for now
 
-obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
+obj-vdso32 = sigtramp.o datapage.o cacheflush.o note.o
 
 # Build rules
 
arch/powerpc/kernel/vdso32/datapage.S +0 -18
Index: linux-2.6/arch/powerpc/kernel/vdso32/datapage.S
===================================================================
@@ -65,21 +65,3 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_ma
 	blr
   .cfi_endproc
 V_FUNCTION_END(__kernel_get_syscall_map)
-
-/*
- * void unsigned long long  __kernel_get_tbfreq(void);
- *
- * returns the timebase frequency in HZ
- */
-V_FUNCTION_BEGIN(__kernel_get_tbfreq)
-  .cfi_startproc
-	mflr	r12
-  .cfi_register lr,r12
-	bl	__get_datapage@local
-	lwz	r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
-	lwz	r3,CFG_TB_TICKS_PER_SEC(r3)
-	mtlr	r12
-	crclr	cr0*4+so
-	blr
-  .cfi_endproc
-V_FUNCTION_END(__kernel_get_tbfreq)
arch/powerpc/kernel/vdso32/gettimeofday.S deleted +0 -322

322 lines not on this page · raw message

arch/powerpc/kernel/vdso32/vdso32.lds.S +0 -4
Index: linux-2.6/arch/powerpc/kernel/vdso32/vdso32.lds.S
===================================================================
@@ -105,10 +105,6 @@ VERSION
     global:
 	__kernel_datapage_offset; /* Has to be there for the kernel to find */
 	__kernel_get_syscall_map;
-	__kernel_gettimeofday;
-	__kernel_clock_gettime;
-	__kernel_clock_getres;
-	__kernel_get_tbfreq;
 	__kernel_sync_dicache;
 	__kernel_sync_dicache_p5;
 	__kernel_sigtramp32;
arch/powerpc/kernel/vdso64/Makefile +1 -1
Index: linux-2.6/arch/powerpc/kernel/vdso64/Makefile
===================================================================
@@ -1,6 +1,6 @@
 # List of files in the vdso, has to be asm only for now
 
-obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
+obj-vdso64 = sigtramp.o datapage.o cacheflush.o note.o
 
 # Build rules
 
arch/powerpc/kernel/vdso64/datapage.S +0 -18
Index: linux-2.6/arch/powerpc/kernel/vdso64/datapage.S
===================================================================
@@ -65,21 +65,3 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_ma
 	blr
   .cfi_endproc
 V_FUNCTION_END(__kernel_get_syscall_map)
-
-
-/*
- * void unsigned long  __kernel_get_tbfreq(void);
- *
- * returns the timebase frequency in HZ
- */
-V_FUNCTION_BEGIN(__kernel_get_tbfreq)
-  .cfi_startproc
-	mflr	r12
-  .cfi_register lr,r12
-	bl	V_LOCAL_FUNC(__get_datapage)
-	ld	r3,CFG_TB_TICKS_PER_SEC(r3)
-	mtlr	r12
-	crclr	cr0*4+so
-	blr
-  .cfi_endproc
-V_FUNCTION_END(__kernel_get_tbfreq)
arch/powerpc/kernel/vdso64/gettimeofday.S deleted +0 -252

252 lines not on this page · raw message

arch/powerpc/kernel/vdso64/vdso64.lds.S +0 -4
Index: linux-2.6/arch/powerpc/kernel/vdso64/vdso64.lds.S
===================================================================
@@ -105,10 +105,6 @@ VERSION
     global:
 	__kernel_datapage_offset; /* Has to be there for the kernel to find */
 	__kernel_get_syscall_map;
-    	__kernel_gettimeofday;
-	__kernel_clock_gettime;
-	__kernel_clock_getres;
-	__kernel_get_tbfreq;
 	__kernel_sync_dicache;
 	__kernel_sync_dicache_p5;
 	__kernel_sigtramp_rt64;
include/asm-powerpc/time.h +0 -20
Index: linux-2.6/include/asm-powerpc/time.h
===================================================================
@@ -45,26 +45,6 @@ extern unsigned long ppc_proc_freq;
 extern unsigned long ppc_tb_freq;
 #define DEFAULT_TB_FREQ		125000000UL
 
-/*
- * By putting all of this stuff into a single struct we 
- * reduce the number of cache lines touched by do_gettimeofday.
- * Both by collecting all of the data in one cache line and
- * by touching only one TOC entry on ppc64.
- */
-struct gettimeofday_vars {
-	u64 tb_to_xs;
-	u64 stamp_xsec;
-	u64 tb_orig_stamp;
-};
-
-struct gettimeofday_struct {
-	unsigned long tb_ticks_per_sec;
-	struct gettimeofday_vars vars[2];
-	struct gettimeofday_vars * volatile varp;
-	unsigned      var_idx;
-	unsigned      tb_to_us;
-};
-
 struct div_result {
 	u64 result_high;
 	u64 result_low;
include/asm-powerpc/vdso_datapage.h +0 -14
Index: linux-2.6/include/asm-powerpc/vdso_datapage.h
===================================================================
@@ -74,11 +74,6 @@ struct vdso_data {
 	__u32 icache_size;		/* L1 i-cache size		0x68 */
 	__u32 icache_line_size;		/* L1 i-cache line size		0x6C */
 
-	/* those additional ones don't have to be located anywhere
-	 * special as they were not part of the original systemcfg
-	 */
-	__s32 wtom_clock_sec;			/* Wall to monotonic clock */
-	__s32 wtom_clock_nsec;
    	__u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls  */
    	__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
 };
@@ -89,15 +84,6 @@ struct vdso_data {
  * And here is the simpler 32 bits version
  */
 struct vdso_data {
-	__u64 tb_orig_stamp;		/* Timebase at boot		0x30 */
-	__u64 tb_ticks_per_sec;		/* Timebase tics / sec		0x38 */
-	__u64 tb_to_xs;			/* Inverse of TB to 2^20	0x40 */
-	__u64 stamp_xsec;		/*				0x48 */
-	__u32 tb_update_count;		/* Timebase atomicity ctr	0x50 */
-	__u32 tz_minuteswest;		/* Minutes west of Greenwich	0x58 */
-	__u32 tz_dsttime;		/* Type of dst correction	0x5C */
-	__s32 wtom_clock_sec;			/* Wall to monotonic clock */
-	__s32 wtom_clock_nsec;
    	__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
 };
 
#1 lore raw
Quoted 8 lines · Sergei Shtylyov

Remove vsyscalls that were broken by the PowerPC generic TOD patch, also fixing the build breakage due to its bad rebase.

The patch has been tested on PPC32 only. I had to preserve the data that are made visible to userland via /proc/ppc64/systemcfg on PPC64, however now there are only zeroes there and their affect isn't known to me...

There is simply no way this will happen !

Ben.

#2 lore raw
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 8 lines · Sergei Shtylyov

Remove vsyscalls that were broken by the PowerPC generic TOD patch, also fixing the build breakage due to its bad rebase.

The patch has been tested on PPC32 only. I had to preserve the data that are made visible to userland via /proc/ppc64/systemcfg on PPC64, however now there are only zeroes there and their affect isn't known to me...

There is simply no way this will happen !

I believe this is just a short-term fix so the ppc tod/rt code can be tested. I do plan on getting the ppc vsyscall working before we push any ppc tod changes to mainline.

thanks
-john

#3 lore raw
Quoted 9 lines · john stultz
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Sergei Shtylyov

Remove vsyscalls that were broken by the PowerPC generic TOD patch, also fixing the build breakage due to its bad rebase.

The patch has been tested on PPC32 only. I had to preserve the data that are made visible to userland via /proc/ppc64/systemcfg on PPC64, however now there are only zeroes there and their affect isn't known to me...

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

There is simply no way this will happen !

I believe this is just a short-term fix so the ppc tod/rt code can be tested. I do plan on getting the ppc vsyscall working before we push any ppc tod changes to mainline.

Ok.

Ben.