-
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.
x86: Load the 32-bit vdso in place, just like the 64-bit vdsos
This replaces a decent amount of incomprehensible and buggy code with much more straightforward code. It also brings the 32-bit vdso more in line with the 64-bit vdsos, so maybe someday they can share even more code. This wastes a small amount of kernel .data and .text space, but it avoids a couple of allocations on startup, so it should be more or less a wash memory-wise. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Cc: Stefani Seibold <stefani@seibold.net> Link: http://lkml.kernel.org/r/b8093933fad09ce181edb08a61dcd5d2592e9814.1395352498.git.luto@amacapital.net Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
- Loading branch information
Andy Lutomirski
authored and
H. Peter Anvin
committed
Mar 20, 2014
1 parent
4e40112
commit b67e612
Showing
7 changed files
with
70 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
#include <asm/page_types.h> | ||
#include <linux/linkage.h> | ||
#include "vdso_image.h" | ||
|
||
__PAGE_ALIGNED_DATA | ||
|
||
.globl vdso_start, vdso_end | ||
.align PAGE_SIZE | ||
vdso_start: | ||
.incbin "arch/x86/vdso/vdso.so" | ||
vdso_end: | ||
.align PAGE_SIZE /* extra data here leaks to userspace. */ | ||
|
||
.previous | ||
|
||
.globl vdso_pages | ||
.bss | ||
.align 8 | ||
.type vdso_pages, @object | ||
vdso_pages: | ||
.zero (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE * 8 | ||
.size vdso_pages, .-vdso_pages | ||
DEFINE_VDSO_IMAGE(vdso, "arch/x86/vdso/vdso.so") |
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 |
---|---|---|
@@ -1,22 +1,9 @@ | ||
#include <linux/init.h> | ||
#include "vdso_image.h" | ||
|
||
__INITDATA | ||
DEFINE_VDSO_IMAGE(vdso32_int80, "arch/x86/vdso/vdso32-int80.so") | ||
|
||
.globl vdso32_int80_start, vdso32_int80_end | ||
vdso32_int80_start: | ||
.incbin "arch/x86/vdso/vdso32-int80.so" | ||
vdso32_int80_end: | ||
|
||
.globl vdso32_syscall_start, vdso32_syscall_end | ||
vdso32_syscall_start: | ||
#ifdef CONFIG_COMPAT | ||
.incbin "arch/x86/vdso/vdso32-syscall.so" | ||
DEFINE_VDSO_IMAGE(vdso32_syscall, "arch/x86/vdso/vdso32-syscall.so") | ||
#endif | ||
vdso32_syscall_end: | ||
|
||
.globl vdso32_sysenter_start, vdso32_sysenter_end | ||
vdso32_sysenter_start: | ||
.incbin "arch/x86/vdso/vdso32-sysenter.so" | ||
vdso32_sysenter_end: | ||
|
||
__FINIT | ||
DEFINE_VDSO_IMAGE(vdso32_sysenter, "arch/x86/vdso/vdso32-sysenter.so") |
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,30 @@ | ||
#ifndef _VDSO_IMAGE_H | ||
#define _VDSO_IMAGE_H | ||
|
||
#include <asm/page_types.h> | ||
#include <linux/linkage.h> | ||
|
||
#define DEFINE_VDSO_IMAGE(symname, filename) \ | ||
__PAGE_ALIGNED_DATA ; \ | ||
.globl symname##_start, symname##_end ; \ | ||
.align PAGE_SIZE ; \ | ||
symname##_start: ; \ | ||
.incbin filename ; \ | ||
symname##_end: ; \ | ||
.align PAGE_SIZE /* extra data here leaks to userspace. */ ; \ | ||
\ | ||
.previous ; \ | ||
\ | ||
.globl symname##_pages ; \ | ||
.bss ; \ | ||
.align 8 ; \ | ||
.type symname##_pages, @object ; \ | ||
symname##_pages: ; \ | ||
.zero (symname##_end - symname##_start + PAGE_SIZE - 1) / PAGE_SIZE * (BITS_PER_LONG / 8) ; \ | ||
.size symname##_pages, .-symname##_pages | ||
|
||
#define DECLARE_VDSO_IMAGE(symname) \ | ||
extern char symname##_start[], symname##_end[]; \ | ||
extern struct page *symname##_pages[] | ||
|
||
#endif /* _VDSO_IMAGE_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
#include <asm/page_types.h> | ||
#include <linux/linkage.h> | ||
#include "vdso_image.h" | ||
|
||
__PAGE_ALIGNED_DATA | ||
|
||
.globl vdsox32_start, vdsox32_end | ||
.align PAGE_SIZE | ||
vdsox32_start: | ||
.incbin "arch/x86/vdso/vdsox32.so" | ||
vdsox32_end: | ||
.align PAGE_SIZE /* extra data here leaks to userspace. */ | ||
|
||
.previous | ||
|
||
.globl vdsox32_pages | ||
.bss | ||
.align 8 | ||
.type vdsox32_pages, @object | ||
vdsox32_pages: | ||
.zero (vdsox32_end - vdsox32_start + PAGE_SIZE - 1) / PAGE_SIZE * 8 | ||
.size vdsox32_pages, .-vdsox32_pages | ||
DEFINE_VDSO_IMAGE(vdsox32, "arch/x86/vdso/vdsox32.so") |
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