forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/lin…
…ux/kernel/git/tip/tip Pull x86 vdso changes from Peter Anvin: "This is the revamp of the 32-bit vdso and the associated cleanups. This adds timekeeping support to the 32-bit vdso that we already have in the 64-bit vdso. Although 32-bit x86 is legacy, it is likely to remain in the embedded space for a very long time to come. This removes the traditional COMPAT_VDSO support; the configuration variable is reused for simply removing the 32-bit vdso, which will produce correct results but obviously suffer a performance penalty. Only one beta version of glibc was affected, but that version was unfortunately included in one OpenSUSE release. This is not the end of the vdso cleanups. Stefani and Andy have agreed to continue work for the next kernel cycle; in fact Andy has already produced another set of cleanups that came too late for this cycle. An incidental, but arguably important, change is that this ensures that unused space in the VVAR page is properly zeroed. It wasn't before, and would contain whatever garbage was left in memory by BIOS or the bootloader. Since the VVAR page is accessible to user space this had the potential of information leaks" * 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) x86, vdso: Fix the symbol versions on the 32-bit vDSO x86, vdso, build: Don't rebuild 32-bit vdsos on every make x86, vdso: Actually discard the .discard sections x86, vdso: Fix size of get_unmapped_area() x86, vdso: Finish removing VDSO32_PRELINK x86, vdso: Move more vdso definitions into vdso.h x86: Load the 32-bit vdso in place, just like the 64-bit vdsos x86, vdso32: handle 32 bit vDSO larger one page x86, vdso32: Disable stack protector, adjust optimizations x86, vdso: Zero-pad the VVAR page x86, vdso: Add 32 bit VDSO time support for 64 bit kernel x86, vdso: Add 32 bit VDSO time support for 32 bit kernel x86, vdso: Patch alternatives in the 32-bit VDSO x86, vdso: Introduce VVAR marco for vdso32 x86, vdso: Cleanup __vdso_gettimeofday() x86, vdso: Replace VVAR(vsyscall_gtod_data) by gtod macro x86, vdso: __vdso_clock_gettime() cleanup x86, vdso: Revamp vclock_gettime.c mm: Add new func _install_special_mapping() to mmap.c x86, vdso: Make vsyscall_gtod_data handling x86 generic ...
- Loading branch information
Showing
30 changed files
with
617 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef _ASM_X86_VDSO32_H | ||
#define _ASM_X86_VDSO32_H | ||
|
||
#define VDSO_BASE_PAGE 0 | ||
#define VDSO_VVAR_PAGE 1 | ||
#define VDSO_HPET_PAGE 2 | ||
#define VDSO_PAGES 3 | ||
#define VDSO_PREV_PAGES 2 | ||
#define VDSO_OFFSET(x) ((x) * PAGE_SIZE) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,73 @@ | ||
#ifndef _ASM_X86_VGTOD_H | ||
#define _ASM_X86_VGTOD_H | ||
|
||
#include <asm/vsyscall.h> | ||
#include <linux/compiler.h> | ||
#include <linux/clocksource.h> | ||
|
||
#ifdef BUILD_VDSO32_64 | ||
typedef u64 gtod_long_t; | ||
#else | ||
typedef unsigned long gtod_long_t; | ||
#endif | ||
/* | ||
* vsyscall_gtod_data will be accessed by 32 and 64 bit code at the same time | ||
* so be carefull by modifying this structure. | ||
*/ | ||
struct vsyscall_gtod_data { | ||
seqcount_t seq; | ||
unsigned seq; | ||
|
||
struct { /* extract of a clocksource struct */ | ||
int vclock_mode; | ||
cycle_t cycle_last; | ||
cycle_t mask; | ||
u32 mult; | ||
u32 shift; | ||
} clock; | ||
int vclock_mode; | ||
cycle_t cycle_last; | ||
cycle_t mask; | ||
u32 mult; | ||
u32 shift; | ||
|
||
/* open coded 'struct timespec' */ | ||
time_t wall_time_sec; | ||
u64 wall_time_snsec; | ||
gtod_long_t wall_time_sec; | ||
gtod_long_t monotonic_time_sec; | ||
u64 monotonic_time_snsec; | ||
time_t monotonic_time_sec; | ||
gtod_long_t wall_time_coarse_sec; | ||
gtod_long_t wall_time_coarse_nsec; | ||
gtod_long_t monotonic_time_coarse_sec; | ||
gtod_long_t monotonic_time_coarse_nsec; | ||
|
||
struct timezone sys_tz; | ||
struct timespec wall_time_coarse; | ||
struct timespec monotonic_time_coarse; | ||
int tz_minuteswest; | ||
int tz_dsttime; | ||
}; | ||
extern struct vsyscall_gtod_data vsyscall_gtod_data; | ||
|
||
static inline unsigned gtod_read_begin(const struct vsyscall_gtod_data *s) | ||
{ | ||
unsigned ret; | ||
|
||
repeat: | ||
ret = ACCESS_ONCE(s->seq); | ||
if (unlikely(ret & 1)) { | ||
cpu_relax(); | ||
goto repeat; | ||
} | ||
smp_rmb(); | ||
return ret; | ||
} | ||
|
||
static inline int gtod_read_retry(const struct vsyscall_gtod_data *s, | ||
unsigned start) | ||
{ | ||
smp_rmb(); | ||
return unlikely(s->seq != start); | ||
} | ||
|
||
static inline void gtod_write_begin(struct vsyscall_gtod_data *s) | ||
{ | ||
++s->seq; | ||
smp_wmb(); | ||
} | ||
|
||
static inline void gtod_write_end(struct vsyscall_gtod_data *s) | ||
{ | ||
smp_wmb(); | ||
++s->seq; | ||
} | ||
|
||
#endif /* _ASM_X86_VGTOD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.