diff options
| -rw-r--r-- | arch/x86/entry/vdso/vdso-layout.lds.S | 27 | ||||
| -rw-r--r-- | arch/x86/entry/vdso/vdso2c.c | 8 | ||||
| -rw-r--r-- | arch/x86/include/asm/arch_hweight.h | 10 |
3 files changed, 2 insertions, 43 deletions
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S index acfd5ba7d943..93c6dc7812d0 100644 --- a/arch/x86/entry/vdso/vdso-layout.lds.S +++ b/arch/x86/entry/vdso/vdso-layout.lds.S | |||
| @@ -7,16 +7,6 @@ | |||
| 7 | * This script controls its layout. | 7 | * This script controls its layout. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #if defined(BUILD_VDSO64) | ||
| 11 | # define SHDR_SIZE 64 | ||
| 12 | #elif defined(BUILD_VDSO32) || defined(BUILD_VDSOX32) | ||
| 13 | # define SHDR_SIZE 40 | ||
| 14 | #else | ||
| 15 | # error unknown VDSO target | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #define NUM_FAKE_SHDRS 13 | ||
| 19 | |||
| 20 | SECTIONS | 10 | SECTIONS |
| 21 | { | 11 | { |
| 22 | /* | 12 | /* |
| @@ -60,20 +50,8 @@ SECTIONS | |||
| 60 | *(.bss*) | 50 | *(.bss*) |
| 61 | *(.dynbss*) | 51 | *(.dynbss*) |
| 62 | *(.gnu.linkonce.b.*) | 52 | *(.gnu.linkonce.b.*) |
| 63 | |||
| 64 | /* | ||
| 65 | * Ideally this would live in a C file, but that won't | ||
| 66 | * work cleanly for x32 until we start building the x32 | ||
| 67 | * C code using an x32 toolchain. | ||
| 68 | */ | ||
| 69 | VDSO_FAKE_SECTION_TABLE_START = .; | ||
| 70 | . = . + NUM_FAKE_SHDRS * SHDR_SIZE; | ||
| 71 | VDSO_FAKE_SECTION_TABLE_END = .; | ||
| 72 | } :text | 53 | } :text |
| 73 | 54 | ||
| 74 | .fake_shstrtab : { *(.fake_shstrtab) } :text | ||
| 75 | |||
| 76 | |||
| 77 | .note : { *(.note.*) } :text :note | 55 | .note : { *(.note.*) } :text :note |
| 78 | 56 | ||
| 79 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 57 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| @@ -87,11 +65,6 @@ SECTIONS | |||
| 87 | 65 | ||
| 88 | .text : { *(.text*) } :text =0x90909090, | 66 | .text : { *(.text*) } :text =0x90909090, |
| 89 | 67 | ||
| 90 | /* | ||
| 91 | * At the end so that eu-elflint stays happy when vdso2c strips | ||
| 92 | * these. A better implementation would avoid allocating space | ||
| 93 | * for these. | ||
| 94 | */ | ||
| 95 | .altinstructions : { *(.altinstructions) } :text | 68 | .altinstructions : { *(.altinstructions) } :text |
| 96 | .altinstr_replacement : { *(.altinstr_replacement) } :text | 69 | .altinstr_replacement : { *(.altinstr_replacement) } :text |
| 97 | 70 | ||
diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c index 4674f58581a1..8e470b018512 100644 --- a/arch/x86/entry/vdso/vdso2c.c +++ b/arch/x86/entry/vdso/vdso2c.c | |||
| @@ -76,8 +76,6 @@ enum { | |||
| 76 | sym_hpet_page, | 76 | sym_hpet_page, |
| 77 | sym_pvclock_page, | 77 | sym_pvclock_page, |
| 78 | sym_hvclock_page, | 78 | sym_hvclock_page, |
| 79 | sym_VDSO_FAKE_SECTION_TABLE_START, | ||
| 80 | sym_VDSO_FAKE_SECTION_TABLE_END, | ||
| 81 | }; | 79 | }; |
| 82 | 80 | ||
| 83 | const int special_pages[] = { | 81 | const int special_pages[] = { |
| @@ -98,12 +96,6 @@ struct vdso_sym required_syms[] = { | |||
| 98 | [sym_hpet_page] = {"hpet_page", true}, | 96 | [sym_hpet_page] = {"hpet_page", true}, |
| 99 | [sym_pvclock_page] = {"pvclock_page", true}, | 97 | [sym_pvclock_page] = {"pvclock_page", true}, |
| 100 | [sym_hvclock_page] = {"hvclock_page", true}, | 98 | [sym_hvclock_page] = {"hvclock_page", true}, |
| 101 | [sym_VDSO_FAKE_SECTION_TABLE_START] = { | ||
| 102 | "VDSO_FAKE_SECTION_TABLE_START", false | ||
| 103 | }, | ||
| 104 | [sym_VDSO_FAKE_SECTION_TABLE_END] = { | ||
| 105 | "VDSO_FAKE_SECTION_TABLE_END", false | ||
| 106 | }, | ||
| 107 | {"VDSO32_NOTE_MASK", true}, | 99 | {"VDSO32_NOTE_MASK", true}, |
| 108 | {"__kernel_vsyscall", true}, | 100 | {"__kernel_vsyscall", true}, |
| 109 | {"__kernel_sigreturn", true}, | 101 | {"__kernel_sigreturn", true}, |
diff --git a/arch/x86/include/asm/arch_hweight.h b/arch/x86/include/asm/arch_hweight.h index 34a10b2d5b73..fc0693569f7a 100644 --- a/arch/x86/include/asm/arch_hweight.h +++ b/arch/x86/include/asm/arch_hweight.h | |||
| @@ -5,15 +5,9 @@ | |||
| 5 | #include <asm/cpufeatures.h> | 5 | #include <asm/cpufeatures.h> |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_64BIT | 7 | #ifdef CONFIG_64BIT |
| 8 | /* popcnt %edi, %eax */ | ||
| 9 | #define POPCNT32 ".byte 0xf3,0x0f,0xb8,0xc7" | ||
| 10 | /* popcnt %rdi, %rax */ | ||
| 11 | #define POPCNT64 ".byte 0xf3,0x48,0x0f,0xb8,0xc7" | ||
| 12 | #define REG_IN "D" | 8 | #define REG_IN "D" |
| 13 | #define REG_OUT "a" | 9 | #define REG_OUT "a" |
| 14 | #else | 10 | #else |
| 15 | /* popcnt %eax, %eax */ | ||
| 16 | #define POPCNT32 ".byte 0xf3,0x0f,0xb8,0xc0" | ||
| 17 | #define REG_IN "a" | 11 | #define REG_IN "a" |
| 18 | #define REG_OUT "a" | 12 | #define REG_OUT "a" |
| 19 | #endif | 13 | #endif |
| @@ -24,7 +18,7 @@ static __always_inline unsigned int __arch_hweight32(unsigned int w) | |||
| 24 | { | 18 | { |
| 25 | unsigned int res; | 19 | unsigned int res; |
| 26 | 20 | ||
| 27 | asm (ALTERNATIVE("call __sw_hweight32", POPCNT32, X86_FEATURE_POPCNT) | 21 | asm (ALTERNATIVE("call __sw_hweight32", "popcntl %1, %0", X86_FEATURE_POPCNT) |
| 28 | : "="REG_OUT (res) | 22 | : "="REG_OUT (res) |
| 29 | : REG_IN (w)); | 23 | : REG_IN (w)); |
| 30 | 24 | ||
| @@ -52,7 +46,7 @@ static __always_inline unsigned long __arch_hweight64(__u64 w) | |||
| 52 | { | 46 | { |
| 53 | unsigned long res; | 47 | unsigned long res; |
| 54 | 48 | ||
| 55 | asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT) | 49 | asm (ALTERNATIVE("call __sw_hweight64", "popcntq %1, %0", X86_FEATURE_POPCNT) |
| 56 | : "="REG_OUT (res) | 50 | : "="REG_OUT (res) |
| 57 | : REG_IN (w)); | 51 | : REG_IN (w)); |
| 58 | 52 | ||
