diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:59:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:59:56 -0400 |
commit | da849abeb86ddaa093b0935fde595e8e4dd21ffc (patch) | |
tree | f985f6b1858f3abce274f267bfde051810215ed0 | |
parent | 21a32816b2e13eafb6d8a4589a84c6e629adc392 (diff) | |
parent | 371c394af27ab7d1e58a66bc19d9f1f3ac1f67b4 (diff) |
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, binutils, xen: Fix another wrong size directive
x86: Remove dead config option X86_CPU
x86: Really print supported CPUs if PROCESSOR_SELECT=y
x86: Fix a bogus unwind annotation in lib/semaphore_32.S
um, x86-64: Fix UML build after adding CFI annotations to lib/rwsem_64.S
x86: Remove unused bits from lib/thunk_*.S
x86: Use {push,pop}_cfi in more places
x86-64: Add CFI annotations to lib/rwsem_64.S
x86, asm: Cleanup unnecssary macros in asm-offsets.c
x86, system.h: Drop unused __SAVE/__RESTORE macros
x86: Use bitmap library functions
x86: Partly unify asm-offsets_{32,64}.c
x86: Reduce back the alignment of the per-CPU data section
-rw-r--r-- | arch/um/Kconfig.x86 | 5 | ||||
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/Kconfig.cpu | 5 | ||||
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 27 | ||||
-rw-r--r-- | arch/x86/include/asm/frame.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/system.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets.c | 65 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 69 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_64.c | 90 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 5 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 2 | ||||
-rw-r--r-- | arch/x86/kernel/head_32.S | 8 | ||||
-rw-r--r-- | arch/x86/kernel/ioport.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/x86/lib/atomic64_386_32.S | 6 | ||||
-rw-r--r-- | arch/x86/lib/atomic64_cx8_32.S | 6 | ||||
-rw-r--r-- | arch/x86/lib/checksum_32.S | 63 | ||||
-rw-r--r-- | arch/x86/lib/rwsem_64.S | 56 | ||||
-rw-r--r-- | arch/x86/lib/semaphore_32.S | 38 | ||||
-rw-r--r-- | arch/x86/lib/thunk_32.S | 18 | ||||
-rw-r--r-- | arch/x86/lib/thunk_64.S | 27 | ||||
-rw-r--r-- | arch/x86/xen/xen-head.S | 4 |
23 files changed, 186 insertions, 344 deletions
diff --git a/arch/um/Kconfig.x86 b/arch/um/Kconfig.x86 index 5ee328099c63..02fb017fed47 100644 --- a/arch/um/Kconfig.x86 +++ b/arch/um/Kconfig.x86 | |||
@@ -10,6 +10,8 @@ endmenu | |||
10 | 10 | ||
11 | config UML_X86 | 11 | config UML_X86 |
12 | def_bool y | 12 | def_bool y |
13 | select GENERIC_FIND_FIRST_BIT | ||
14 | select GENERIC_FIND_NEXT_BIT | ||
13 | 15 | ||
14 | config 64BIT | 16 | config 64BIT |
15 | bool | 17 | bool |
@@ -19,6 +21,9 @@ config X86_32 | |||
19 | def_bool !64BIT | 21 | def_bool !64BIT |
20 | select HAVE_AOUT | 22 | select HAVE_AOUT |
21 | 23 | ||
24 | config X86_64 | ||
25 | def_bool 64BIT | ||
26 | |||
22 | config RWSEM_XCHGADD_ALGORITHM | 27 | config RWSEM_XCHGADD_ALGORITHM |
23 | def_bool X86_XADD | 28 | def_bool X86_XADD |
24 | 29 | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index d5ed94d30aad..43214e303294 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -64,6 +64,8 @@ config X86 | |||
64 | select HAVE_TEXT_POKE_SMP | 64 | select HAVE_TEXT_POKE_SMP |
65 | select HAVE_GENERIC_HARDIRQS | 65 | select HAVE_GENERIC_HARDIRQS |
66 | select HAVE_SPARSE_IRQ | 66 | select HAVE_SPARSE_IRQ |
67 | select GENERIC_FIND_FIRST_BIT | ||
68 | select GENERIC_FIND_NEXT_BIT | ||
67 | select GENERIC_IRQ_PROBE | 69 | select GENERIC_IRQ_PROBE |
68 | select GENERIC_PENDING_IRQ if SMP | 70 | select GENERIC_PENDING_IRQ if SMP |
69 | select USE_GENERIC_SMP_HELPERS if SMP | 71 | select USE_GENERIC_SMP_HELPERS if SMP |
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 283c5a6a03a6..ed47e6e1747f 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
@@ -294,11 +294,6 @@ config X86_GENERIC | |||
294 | 294 | ||
295 | endif | 295 | endif |
296 | 296 | ||
297 | config X86_CPU | ||
298 | def_bool y | ||
299 | select GENERIC_FIND_FIRST_BIT | ||
300 | select GENERIC_FIND_NEXT_BIT | ||
301 | |||
302 | # | 297 | # |
303 | # Define implied options from the CPU selection here | 298 | # Define implied options from the CPU selection here |
304 | config X86_INTERNODE_CACHE_SHIFT | 299 | config X86_INTERNODE_CACHE_SHIFT |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 2f0d7b450150..430312ba6e3f 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -128,26 +128,20 @@ ENTRY(ia32_sysenter_target) | |||
128 | */ | 128 | */ |
129 | ENABLE_INTERRUPTS(CLBR_NONE) | 129 | ENABLE_INTERRUPTS(CLBR_NONE) |
130 | movl %ebp,%ebp /* zero extension */ | 130 | movl %ebp,%ebp /* zero extension */ |
131 | pushq $__USER32_DS | 131 | pushq_cfi $__USER32_DS |
132 | CFI_ADJUST_CFA_OFFSET 8 | ||
133 | /*CFI_REL_OFFSET ss,0*/ | 132 | /*CFI_REL_OFFSET ss,0*/ |
134 | pushq %rbp | 133 | pushq_cfi %rbp |
135 | CFI_ADJUST_CFA_OFFSET 8 | ||
136 | CFI_REL_OFFSET rsp,0 | 134 | CFI_REL_OFFSET rsp,0 |
137 | pushfq | 135 | pushfq_cfi |
138 | CFI_ADJUST_CFA_OFFSET 8 | ||
139 | /*CFI_REL_OFFSET rflags,0*/ | 136 | /*CFI_REL_OFFSET rflags,0*/ |
140 | movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d | 137 | movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d |
141 | CFI_REGISTER rip,r10 | 138 | CFI_REGISTER rip,r10 |
142 | pushq $__USER32_CS | 139 | pushq_cfi $__USER32_CS |
143 | CFI_ADJUST_CFA_OFFSET 8 | ||
144 | /*CFI_REL_OFFSET cs,0*/ | 140 | /*CFI_REL_OFFSET cs,0*/ |
145 | movl %eax, %eax | 141 | movl %eax, %eax |
146 | pushq %r10 | 142 | pushq_cfi %r10 |
147 | CFI_ADJUST_CFA_OFFSET 8 | ||
148 | CFI_REL_OFFSET rip,0 | 143 | CFI_REL_OFFSET rip,0 |
149 | pushq %rax | 144 | pushq_cfi %rax |
150 | CFI_ADJUST_CFA_OFFSET 8 | ||
151 | cld | 145 | cld |
152 | SAVE_ARGS 0,0,1 | 146 | SAVE_ARGS 0,0,1 |
153 | /* no need to do an access_ok check here because rbp has been | 147 | /* no need to do an access_ok check here because rbp has been |
@@ -184,11 +178,9 @@ sysexit_from_sys_call: | |||
184 | xorq %r9,%r9 | 178 | xorq %r9,%r9 |
185 | xorq %r10,%r10 | 179 | xorq %r10,%r10 |
186 | xorq %r11,%r11 | 180 | xorq %r11,%r11 |
187 | popfq | 181 | popfq_cfi |
188 | CFI_ADJUST_CFA_OFFSET -8 | ||
189 | /*CFI_RESTORE rflags*/ | 182 | /*CFI_RESTORE rflags*/ |
190 | popq %rcx /* User %esp */ | 183 | popq_cfi %rcx /* User %esp */ |
191 | CFI_ADJUST_CFA_OFFSET -8 | ||
192 | CFI_REGISTER rsp,rcx | 184 | CFI_REGISTER rsp,rcx |
193 | TRACE_IRQS_ON | 185 | TRACE_IRQS_ON |
194 | ENABLE_INTERRUPTS_SYSEXIT32 | 186 | ENABLE_INTERRUPTS_SYSEXIT32 |
@@ -423,8 +415,7 @@ ENTRY(ia32_syscall) | |||
423 | */ | 415 | */ |
424 | ENABLE_INTERRUPTS(CLBR_NONE) | 416 | ENABLE_INTERRUPTS(CLBR_NONE) |
425 | movl %eax,%eax | 417 | movl %eax,%eax |
426 | pushq %rax | 418 | pushq_cfi %rax |
427 | CFI_ADJUST_CFA_OFFSET 8 | ||
428 | cld | 419 | cld |
429 | /* note the registers are not zero extended to the sf. | 420 | /* note the registers are not zero extended to the sf. |
430 | this could be a problem. */ | 421 | this could be a problem. */ |
diff --git a/arch/x86/include/asm/frame.h b/arch/x86/include/asm/frame.h index 06850a7194e1..2c6fc9e62812 100644 --- a/arch/x86/include/asm/frame.h +++ b/arch/x86/include/asm/frame.h | |||
@@ -7,14 +7,12 @@ | |||
7 | frame pointer later */ | 7 | frame pointer later */ |
8 | #ifdef CONFIG_FRAME_POINTER | 8 | #ifdef CONFIG_FRAME_POINTER |
9 | .macro FRAME | 9 | .macro FRAME |
10 | pushl %ebp | 10 | pushl_cfi %ebp |
11 | CFI_ADJUST_CFA_OFFSET 4 | ||
12 | CFI_REL_OFFSET ebp,0 | 11 | CFI_REL_OFFSET ebp,0 |
13 | movl %esp,%ebp | 12 | movl %esp,%ebp |
14 | .endm | 13 | .endm |
15 | .macro ENDFRAME | 14 | .macro ENDFRAME |
16 | popl %ebp | 15 | popl_cfi %ebp |
17 | CFI_ADJUST_CFA_OFFSET -4 | ||
18 | CFI_RESTORE ebp | 16 | CFI_RESTORE ebp |
19 | .endm | 17 | .endm |
20 | #else | 18 | #else |
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index 33ecc3ea8782..12569e691ce3 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h | |||
@@ -98,8 +98,6 @@ do { \ | |||
98 | */ | 98 | */ |
99 | #define HAVE_DISABLE_HLT | 99 | #define HAVE_DISABLE_HLT |
100 | #else | 100 | #else |
101 | #define __SAVE(reg, offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t" | ||
102 | #define __RESTORE(reg, offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" | ||
103 | 101 | ||
104 | /* frame pointer must be last for get_wchan */ | 102 | /* frame pointer must be last for get_wchan */ |
105 | #define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t" | 103 | #define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t" |
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index cfa82c899f47..4f13fafc5264 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c | |||
@@ -1,5 +1,70 @@ | |||
1 | /* | ||
2 | * Generate definitions needed by assembly language modules. | ||
3 | * This code generates raw asm output which is post-processed to extract | ||
4 | * and format the required data. | ||
5 | */ | ||
6 | #define COMPILE_OFFSETS | ||
7 | |||
8 | #include <linux/crypto.h> | ||
9 | #include <linux/sched.h> | ||
10 | #include <linux/stddef.h> | ||
11 | #include <linux/hardirq.h> | ||
12 | #include <linux/suspend.h> | ||
13 | #include <linux/kbuild.h> | ||
14 | #include <asm/processor.h> | ||
15 | #include <asm/thread_info.h> | ||
16 | #include <asm/sigframe.h> | ||
17 | #include <asm/bootparam.h> | ||
18 | #include <asm/suspend.h> | ||
19 | |||
20 | #ifdef CONFIG_XEN | ||
21 | #include <xen/interface/xen.h> | ||
22 | #endif | ||
23 | |||
1 | #ifdef CONFIG_X86_32 | 24 | #ifdef CONFIG_X86_32 |
2 | # include "asm-offsets_32.c" | 25 | # include "asm-offsets_32.c" |
3 | #else | 26 | #else |
4 | # include "asm-offsets_64.c" | 27 | # include "asm-offsets_64.c" |
5 | #endif | 28 | #endif |
29 | |||
30 | void common(void) { | ||
31 | BLANK(); | ||
32 | OFFSET(TI_flags, thread_info, flags); | ||
33 | OFFSET(TI_status, thread_info, status); | ||
34 | OFFSET(TI_addr_limit, thread_info, addr_limit); | ||
35 | OFFSET(TI_preempt_count, thread_info, preempt_count); | ||
36 | |||
37 | BLANK(); | ||
38 | OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); | ||
39 | |||
40 | BLANK(); | ||
41 | OFFSET(pbe_address, pbe, address); | ||
42 | OFFSET(pbe_orig_address, pbe, orig_address); | ||
43 | OFFSET(pbe_next, pbe, next); | ||
44 | |||
45 | #ifdef CONFIG_PARAVIRT | ||
46 | BLANK(); | ||
47 | OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); | ||
48 | OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops); | ||
49 | OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops); | ||
50 | OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable); | ||
51 | OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable); | ||
52 | OFFSET(PV_CPU_iret, pv_cpu_ops, iret); | ||
53 | OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit); | ||
54 | OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0); | ||
55 | OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2); | ||
56 | #endif | ||
57 | |||
58 | #ifdef CONFIG_XEN | ||
59 | BLANK(); | ||
60 | OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); | ||
61 | OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); | ||
62 | #endif | ||
63 | |||
64 | BLANK(); | ||
65 | OFFSET(BP_scratch, boot_params, scratch); | ||
66 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); | ||
67 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); | ||
68 | OFFSET(BP_version, boot_params, hdr.version); | ||
69 | OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment); | ||
70 | } | ||
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index 1a4088dda37a..c29d631af6fc 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c | |||
@@ -1,26 +1,4 @@ | |||
1 | /* | ||
2 | * Generate definitions needed by assembly language modules. | ||
3 | * This code generates raw asm output which is post-processed | ||
4 | * to extract and format the required data. | ||
5 | */ | ||
6 | |||
7 | #include <linux/crypto.h> | ||
8 | #include <linux/sched.h> | ||
9 | #include <linux/signal.h> | ||
10 | #include <linux/personality.h> | ||
11 | #include <linux/suspend.h> | ||
12 | #include <linux/kbuild.h> | ||
13 | #include <asm/ucontext.h> | 1 | #include <asm/ucontext.h> |
14 | #include <asm/sigframe.h> | ||
15 | #include <asm/pgtable.h> | ||
16 | #include <asm/fixmap.h> | ||
17 | #include <asm/processor.h> | ||
18 | #include <asm/thread_info.h> | ||
19 | #include <asm/bootparam.h> | ||
20 | #include <asm/elf.h> | ||
21 | #include <asm/suspend.h> | ||
22 | |||
23 | #include <xen/interface/xen.h> | ||
24 | 2 | ||
25 | #include <linux/lguest.h> | 3 | #include <linux/lguest.h> |
26 | #include "../../../drivers/lguest/lg.h" | 4 | #include "../../../drivers/lguest/lg.h" |
@@ -51,21 +29,10 @@ void foo(void) | |||
51 | OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); | 29 | OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); |
52 | BLANK(); | 30 | BLANK(); |
53 | 31 | ||
54 | OFFSET(TI_task, thread_info, task); | ||
55 | OFFSET(TI_exec_domain, thread_info, exec_domain); | ||
56 | OFFSET(TI_flags, thread_info, flags); | ||
57 | OFFSET(TI_status, thread_info, status); | ||
58 | OFFSET(TI_preempt_count, thread_info, preempt_count); | ||
59 | OFFSET(TI_addr_limit, thread_info, addr_limit); | ||
60 | OFFSET(TI_restart_block, thread_info, restart_block); | ||
61 | OFFSET(TI_sysenter_return, thread_info, sysenter_return); | 32 | OFFSET(TI_sysenter_return, thread_info, sysenter_return); |
62 | OFFSET(TI_cpu, thread_info, cpu); | 33 | OFFSET(TI_cpu, thread_info, cpu); |
63 | BLANK(); | 34 | BLANK(); |
64 | 35 | ||
65 | OFFSET(GDS_size, desc_ptr, size); | ||
66 | OFFSET(GDS_address, desc_ptr, address); | ||
67 | BLANK(); | ||
68 | |||
69 | OFFSET(PT_EBX, pt_regs, bx); | 36 | OFFSET(PT_EBX, pt_regs, bx); |
70 | OFFSET(PT_ECX, pt_regs, cx); | 37 | OFFSET(PT_ECX, pt_regs, cx); |
71 | OFFSET(PT_EDX, pt_regs, dx); | 38 | OFFSET(PT_EDX, pt_regs, dx); |
@@ -85,42 +52,13 @@ void foo(void) | |||
85 | OFFSET(PT_OLDSS, pt_regs, ss); | 52 | OFFSET(PT_OLDSS, pt_regs, ss); |
86 | BLANK(); | 53 | BLANK(); |
87 | 54 | ||
88 | OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); | ||
89 | OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); | 55 | OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); |
90 | BLANK(); | 56 | BLANK(); |
91 | 57 | ||
92 | OFFSET(pbe_address, pbe, address); | ||
93 | OFFSET(pbe_orig_address, pbe, orig_address); | ||
94 | OFFSET(pbe_next, pbe, next); | ||
95 | |||
96 | /* Offset from the sysenter stack to tss.sp0 */ | 58 | /* Offset from the sysenter stack to tss.sp0 */ |
97 | DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) - | 59 | DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) - |
98 | sizeof(struct tss_struct)); | 60 | sizeof(struct tss_struct)); |
99 | 61 | ||
100 | DEFINE(PAGE_SIZE_asm, PAGE_SIZE); | ||
101 | DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT); | ||
102 | DEFINE(THREAD_SIZE_asm, THREAD_SIZE); | ||
103 | |||
104 | OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); | ||
105 | |||
106 | #ifdef CONFIG_PARAVIRT | ||
107 | BLANK(); | ||
108 | OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); | ||
109 | OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops); | ||
110 | OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops); | ||
111 | OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable); | ||
112 | OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable); | ||
113 | OFFSET(PV_CPU_iret, pv_cpu_ops, iret); | ||
114 | OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit); | ||
115 | OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0); | ||
116 | #endif | ||
117 | |||
118 | #ifdef CONFIG_XEN | ||
119 | BLANK(); | ||
120 | OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); | ||
121 | OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); | ||
122 | #endif | ||
123 | |||
124 | #if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE) | 62 | #if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE) |
125 | BLANK(); | 63 | BLANK(); |
126 | OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); | 64 | OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); |
@@ -139,11 +77,4 @@ void foo(void) | |||
139 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); | 77 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); |
140 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); | 78 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); |
141 | #endif | 79 | #endif |
142 | |||
143 | BLANK(); | ||
144 | OFFSET(BP_scratch, boot_params, scratch); | ||
145 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); | ||
146 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); | ||
147 | OFFSET(BP_version, boot_params, hdr.version); | ||
148 | OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment); | ||
149 | } | 80 | } |
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 4a6aeedcd965..e72a1194af22 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c | |||
@@ -1,27 +1,4 @@ | |||
1 | /* | ||
2 | * Generate definitions needed by assembly language modules. | ||
3 | * This code generates raw asm output which is post-processed to extract | ||
4 | * and format the required data. | ||
5 | */ | ||
6 | #define COMPILE_OFFSETS | ||
7 | |||
8 | #include <linux/crypto.h> | ||
9 | #include <linux/sched.h> | ||
10 | #include <linux/stddef.h> | ||
11 | #include <linux/errno.h> | ||
12 | #include <linux/hardirq.h> | ||
13 | #include <linux/suspend.h> | ||
14 | #include <linux/kbuild.h> | ||
15 | #include <asm/processor.h> | ||
16 | #include <asm/segment.h> | ||
17 | #include <asm/thread_info.h> | ||
18 | #include <asm/ia32.h> | 1 | #include <asm/ia32.h> |
19 | #include <asm/bootparam.h> | ||
20 | #include <asm/suspend.h> | ||
21 | |||
22 | #include <xen/interface/xen.h> | ||
23 | |||
24 | #include <asm/sigframe.h> | ||
25 | 2 | ||
26 | #define __NO_STUBS 1 | 3 | #define __NO_STUBS 1 |
27 | #undef __SYSCALL | 4 | #undef __SYSCALL |
@@ -33,41 +10,19 @@ static char syscalls[] = { | |||
33 | 10 | ||
34 | int main(void) | 11 | int main(void) |
35 | { | 12 | { |
36 | #define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry)) | ||
37 | ENTRY(state); | ||
38 | ENTRY(flags); | ||
39 | ENTRY(pid); | ||
40 | BLANK(); | ||
41 | #undef ENTRY | ||
42 | #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) | ||
43 | ENTRY(flags); | ||
44 | ENTRY(addr_limit); | ||
45 | ENTRY(preempt_count); | ||
46 | ENTRY(status); | ||
47 | #ifdef CONFIG_IA32_EMULATION | ||
48 | ENTRY(sysenter_return); | ||
49 | #endif | ||
50 | BLANK(); | ||
51 | #undef ENTRY | ||
52 | #ifdef CONFIG_PARAVIRT | 13 | #ifdef CONFIG_PARAVIRT |
53 | BLANK(); | ||
54 | OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); | ||
55 | OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops); | ||
56 | OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops); | ||
57 | OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable); | ||
58 | OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable); | ||
59 | OFFSET(PV_IRQ_adjust_exception_frame, pv_irq_ops, adjust_exception_frame); | 14 | OFFSET(PV_IRQ_adjust_exception_frame, pv_irq_ops, adjust_exception_frame); |
60 | OFFSET(PV_CPU_iret, pv_cpu_ops, iret); | ||
61 | OFFSET(PV_CPU_usergs_sysret32, pv_cpu_ops, usergs_sysret32); | 15 | OFFSET(PV_CPU_usergs_sysret32, pv_cpu_ops, usergs_sysret32); |
62 | OFFSET(PV_CPU_usergs_sysret64, pv_cpu_ops, usergs_sysret64); | 16 | OFFSET(PV_CPU_usergs_sysret64, pv_cpu_ops, usergs_sysret64); |
63 | OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit); | ||
64 | OFFSET(PV_CPU_swapgs, pv_cpu_ops, swapgs); | 17 | OFFSET(PV_CPU_swapgs, pv_cpu_ops, swapgs); |
65 | OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2); | 18 | BLANK(); |
66 | #endif | 19 | #endif |
67 | 20 | ||
68 | |||
69 | #ifdef CONFIG_IA32_EMULATION | 21 | #ifdef CONFIG_IA32_EMULATION |
70 | #define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry)) | 22 | OFFSET(TI_sysenter_return, thread_info, sysenter_return); |
23 | BLANK(); | ||
24 | |||
25 | #define ENTRY(entry) OFFSET(IA32_SIGCONTEXT_ ## entry, sigcontext_ia32, entry) | ||
71 | ENTRY(ax); | 26 | ENTRY(ax); |
72 | ENTRY(bx); | 27 | ENTRY(bx); |
73 | ENTRY(cx); | 28 | ENTRY(cx); |
@@ -79,15 +34,12 @@ int main(void) | |||
79 | ENTRY(ip); | 34 | ENTRY(ip); |
80 | BLANK(); | 35 | BLANK(); |
81 | #undef ENTRY | 36 | #undef ENTRY |
82 | DEFINE(IA32_RT_SIGFRAME_sigcontext, | 37 | |
83 | offsetof (struct rt_sigframe_ia32, uc.uc_mcontext)); | 38 | OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext); |
84 | BLANK(); | 39 | BLANK(); |
85 | #endif | 40 | #endif |
86 | DEFINE(pbe_address, offsetof(struct pbe, address)); | 41 | |
87 | DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); | 42 | #define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry) |
88 | DEFINE(pbe_next, offsetof(struct pbe, next)); | ||
89 | BLANK(); | ||
90 | #define ENTRY(entry) DEFINE(pt_regs_ ## entry, offsetof(struct pt_regs, entry)) | ||
91 | ENTRY(bx); | 43 | ENTRY(bx); |
92 | ENTRY(bx); | 44 | ENTRY(bx); |
93 | ENTRY(cx); | 45 | ENTRY(cx); |
@@ -107,7 +59,8 @@ int main(void) | |||
107 | ENTRY(flags); | 59 | ENTRY(flags); |
108 | BLANK(); | 60 | BLANK(); |
109 | #undef ENTRY | 61 | #undef ENTRY |
110 | #define ENTRY(entry) DEFINE(saved_context_ ## entry, offsetof(struct saved_context, entry)) | 62 | |
63 | #define ENTRY(entry) OFFSET(saved_context_ ## entry, saved_context, entry) | ||
111 | ENTRY(cr0); | 64 | ENTRY(cr0); |
112 | ENTRY(cr2); | 65 | ENTRY(cr2); |
113 | ENTRY(cr3); | 66 | ENTRY(cr3); |
@@ -115,26 +68,11 @@ int main(void) | |||
115 | ENTRY(cr8); | 68 | ENTRY(cr8); |
116 | BLANK(); | 69 | BLANK(); |
117 | #undef ENTRY | 70 | #undef ENTRY |
118 | DEFINE(TSS_ist, offsetof(struct tss_struct, x86_tss.ist)); | ||
119 | BLANK(); | ||
120 | DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); | ||
121 | BLANK(); | ||
122 | DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); | ||
123 | 71 | ||
72 | OFFSET(TSS_ist, tss_struct, x86_tss.ist); | ||
124 | BLANK(); | 73 | BLANK(); |
125 | OFFSET(BP_scratch, boot_params, scratch); | ||
126 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); | ||
127 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); | ||
128 | OFFSET(BP_version, boot_params, hdr.version); | ||
129 | OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment); | ||
130 | 74 | ||
131 | BLANK(); | 75 | DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); |
132 | DEFINE(PAGE_SIZE_asm, PAGE_SIZE); | 76 | |
133 | #ifdef CONFIG_XEN | ||
134 | BLANK(); | ||
135 | OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); | ||
136 | OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); | ||
137 | #undef ENTRY | ||
138 | #endif | ||
139 | return 0; | 77 | return 0; |
140 | } | 78 | } |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 1d59834396bd..5d98c46f876d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -675,7 +675,7 @@ void __init early_cpu_init(void) | |||
675 | const struct cpu_dev *const *cdev; | 675 | const struct cpu_dev *const *cdev; |
676 | int count = 0; | 676 | int count = 0; |
677 | 677 | ||
678 | #ifdef PROCESSOR_SELECT | 678 | #ifdef CONFIG_PROCESSOR_SELECT |
679 | printk(KERN_INFO "KERNEL supported cpus:\n"); | 679 | printk(KERN_INFO "KERNEL supported cpus:\n"); |
680 | #endif | 680 | #endif |
681 | 681 | ||
@@ -687,7 +687,7 @@ void __init early_cpu_init(void) | |||
687 | cpu_devs[count] = cpudev; | 687 | cpu_devs[count] = cpudev; |
688 | count++; | 688 | count++; |
689 | 689 | ||
690 | #ifdef PROCESSOR_SELECT | 690 | #ifdef CONFIG_PROCESSOR_SELECT |
691 | { | 691 | { |
692 | unsigned int j; | 692 | unsigned int j; |
693 | 693 | ||
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index f5accf8eaa78..fa41f7298c84 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -397,7 +397,7 @@ sysenter_past_esp: | |||
397 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words | 397 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words |
398 | * pushed above; +8 corresponds to copy_thread's esp0 setting. | 398 | * pushed above; +8 corresponds to copy_thread's esp0 setting. |
399 | */ | 399 | */ |
400 | pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp) | 400 | pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp) |
401 | CFI_REL_OFFSET eip, 0 | 401 | CFI_REL_OFFSET eip, 0 |
402 | 402 | ||
403 | pushl_cfi %eax | 403 | pushl_cfi %eax |
@@ -1411,8 +1411,7 @@ END(general_protection) | |||
1411 | #ifdef CONFIG_KVM_GUEST | 1411 | #ifdef CONFIG_KVM_GUEST |
1412 | ENTRY(async_page_fault) | 1412 | ENTRY(async_page_fault) |
1413 | RING0_EC_FRAME | 1413 | RING0_EC_FRAME |
1414 | pushl $do_async_page_fault | 1414 | pushl_cfi $do_async_page_fault |
1415 | CFI_ADJUST_CFA_OFFSET 4 | ||
1416 | jmp error_code | 1415 | jmp error_code |
1417 | CFI_ENDPROC | 1416 | CFI_ENDPROC |
1418 | END(apf_page_fault) | 1417 | END(apf_page_fault) |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 0a0ed794edb2..c32cbbcff7b9 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1250,7 +1250,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) | |||
1250 | decl PER_CPU_VAR(irq_count) | 1250 | decl PER_CPU_VAR(irq_count) |
1251 | jmp error_exit | 1251 | jmp error_exit |
1252 | CFI_ENDPROC | 1252 | CFI_ENDPROC |
1253 | END(do_hypervisor_callback) | 1253 | END(xen_do_hypervisor_callback) |
1254 | 1254 | ||
1255 | /* | 1255 | /* |
1256 | * Hypervisor uses this for application faults while it executes. | 1256 | * Hypervisor uses this for application faults while it executes. |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 767d6c43de37..187aa63b321f 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT | |||
73 | */ | 73 | */ |
74 | KERNEL_PAGES = LOWMEM_PAGES | 74 | KERNEL_PAGES = LOWMEM_PAGES |
75 | 75 | ||
76 | INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm | 76 | INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE |
77 | RESERVE_BRK(pagetables, INIT_MAP_SIZE) | 77 | RESERVE_BRK(pagetables, INIT_MAP_SIZE) |
78 | 78 | ||
79 | /* | 79 | /* |
@@ -623,7 +623,7 @@ ENTRY(initial_code) | |||
623 | * BSS section | 623 | * BSS section |
624 | */ | 624 | */ |
625 | __PAGE_ALIGNED_BSS | 625 | __PAGE_ALIGNED_BSS |
626 | .align PAGE_SIZE_asm | 626 | .align PAGE_SIZE |
627 | #ifdef CONFIG_X86_PAE | 627 | #ifdef CONFIG_X86_PAE |
628 | initial_pg_pmd: | 628 | initial_pg_pmd: |
629 | .fill 1024*KPMDS,4,0 | 629 | .fill 1024*KPMDS,4,0 |
@@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir) | |||
644 | #ifdef CONFIG_X86_PAE | 644 | #ifdef CONFIG_X86_PAE |
645 | __PAGE_ALIGNED_DATA | 645 | __PAGE_ALIGNED_DATA |
646 | /* Page-aligned for the benefit of paravirt? */ | 646 | /* Page-aligned for the benefit of paravirt? */ |
647 | .align PAGE_SIZE_asm | 647 | .align PAGE_SIZE |
648 | ENTRY(initial_page_table) | 648 | ENTRY(initial_page_table) |
649 | .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ | 649 | .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ |
650 | # if KPMDS == 3 | 650 | # if KPMDS == 3 |
@@ -662,7 +662,7 @@ ENTRY(initial_page_table) | |||
662 | # else | 662 | # else |
663 | # error "Kernel PMDs should be 1, 2 or 3" | 663 | # error "Kernel PMDs should be 1, 2 or 3" |
664 | # endif | 664 | # endif |
665 | .align PAGE_SIZE_asm /* needs to be page-sized too */ | 665 | .align PAGE_SIZE /* needs to be page-sized too */ |
666 | #endif | 666 | #endif |
667 | 667 | ||
668 | .data | 668 | .data |
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 8eec0ec59af2..8c968974253d 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c | |||
@@ -14,22 +14,9 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/thread_info.h> | 15 | #include <linux/thread_info.h> |
16 | #include <linux/syscalls.h> | 16 | #include <linux/syscalls.h> |
17 | #include <linux/bitmap.h> | ||
17 | #include <asm/syscalls.h> | 18 | #include <asm/syscalls.h> |
18 | 19 | ||
19 | /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ | ||
20 | static void set_bitmap(unsigned long *bitmap, unsigned int base, | ||
21 | unsigned int extent, int new_value) | ||
22 | { | ||
23 | unsigned int i; | ||
24 | |||
25 | for (i = base; i < base + extent; i++) { | ||
26 | if (new_value) | ||
27 | __set_bit(i, bitmap); | ||
28 | else | ||
29 | __clear_bit(i, bitmap); | ||
30 | } | ||
31 | } | ||
32 | |||
33 | /* | 20 | /* |
34 | * this changes the io permissions bitmap in the current task. | 21 | * this changes the io permissions bitmap in the current task. |
35 | */ | 22 | */ |
@@ -69,7 +56,10 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) | |||
69 | */ | 56 | */ |
70 | tss = &per_cpu(init_tss, get_cpu()); | 57 | tss = &per_cpu(init_tss, get_cpu()); |
71 | 58 | ||
72 | set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); | 59 | if (turn_on) |
60 | bitmap_clear(t->io_bitmap_ptr, from, num); | ||
61 | else | ||
62 | bitmap_set(t->io_bitmap_ptr, from, num); | ||
73 | 63 | ||
74 | /* | 64 | /* |
75 | * Search for a (possibly new) maximum. This is simple and stupid, | 65 | * Search for a (possibly new) maximum. This is simple and stupid, |
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 6d4341d5c52a..0381e1f3baed 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -306,7 +306,7 @@ SECTIONS | |||
306 | } | 306 | } |
307 | 307 | ||
308 | #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) | 308 | #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) |
309 | PERCPU(THREAD_SIZE) | 309 | PERCPU(PAGE_SIZE) |
310 | #endif | 310 | #endif |
311 | 311 | ||
312 | . = ALIGN(PAGE_SIZE); | 312 | . = ALIGN(PAGE_SIZE); |
diff --git a/arch/x86/lib/atomic64_386_32.S b/arch/x86/lib/atomic64_386_32.S index 2cda60a06e65..e8e7e0d06f42 100644 --- a/arch/x86/lib/atomic64_386_32.S +++ b/arch/x86/lib/atomic64_386_32.S | |||
@@ -15,14 +15,12 @@ | |||
15 | 15 | ||
16 | /* if you want SMP support, implement these with real spinlocks */ | 16 | /* if you want SMP support, implement these with real spinlocks */ |
17 | .macro LOCK reg | 17 | .macro LOCK reg |
18 | pushfl | 18 | pushfl_cfi |
19 | CFI_ADJUST_CFA_OFFSET 4 | ||
20 | cli | 19 | cli |
21 | .endm | 20 | .endm |
22 | 21 | ||
23 | .macro UNLOCK reg | 22 | .macro UNLOCK reg |
24 | popfl | 23 | popfl_cfi |
25 | CFI_ADJUST_CFA_OFFSET -4 | ||
26 | .endm | 24 | .endm |
27 | 25 | ||
28 | #define BEGIN(op) \ | 26 | #define BEGIN(op) \ |
diff --git a/arch/x86/lib/atomic64_cx8_32.S b/arch/x86/lib/atomic64_cx8_32.S index 71e080de3352..391a083674b4 100644 --- a/arch/x86/lib/atomic64_cx8_32.S +++ b/arch/x86/lib/atomic64_cx8_32.S | |||
@@ -14,14 +14,12 @@ | |||
14 | #include <asm/dwarf2.h> | 14 | #include <asm/dwarf2.h> |
15 | 15 | ||
16 | .macro SAVE reg | 16 | .macro SAVE reg |
17 | pushl %\reg | 17 | pushl_cfi %\reg |
18 | CFI_ADJUST_CFA_OFFSET 4 | ||
19 | CFI_REL_OFFSET \reg, 0 | 18 | CFI_REL_OFFSET \reg, 0 |
20 | .endm | 19 | .endm |
21 | 20 | ||
22 | .macro RESTORE reg | 21 | .macro RESTORE reg |
23 | popl %\reg | 22 | popl_cfi %\reg |
24 | CFI_ADJUST_CFA_OFFSET -4 | ||
25 | CFI_RESTORE \reg | 23 | CFI_RESTORE \reg |
26 | .endm | 24 | .endm |
27 | 25 | ||
diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S index adbccd0bbb78..78d16a554db0 100644 --- a/arch/x86/lib/checksum_32.S +++ b/arch/x86/lib/checksum_32.S | |||
@@ -50,11 +50,9 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
50 | */ | 50 | */ |
51 | ENTRY(csum_partial) | 51 | ENTRY(csum_partial) |
52 | CFI_STARTPROC | 52 | CFI_STARTPROC |
53 | pushl %esi | 53 | pushl_cfi %esi |
54 | CFI_ADJUST_CFA_OFFSET 4 | ||
55 | CFI_REL_OFFSET esi, 0 | 54 | CFI_REL_OFFSET esi, 0 |
56 | pushl %ebx | 55 | pushl_cfi %ebx |
57 | CFI_ADJUST_CFA_OFFSET 4 | ||
58 | CFI_REL_OFFSET ebx, 0 | 56 | CFI_REL_OFFSET ebx, 0 |
59 | movl 20(%esp),%eax # Function arg: unsigned int sum | 57 | movl 20(%esp),%eax # Function arg: unsigned int sum |
60 | movl 16(%esp),%ecx # Function arg: int len | 58 | movl 16(%esp),%ecx # Function arg: int len |
@@ -132,11 +130,9 @@ ENTRY(csum_partial) | |||
132 | jz 8f | 130 | jz 8f |
133 | roll $8, %eax | 131 | roll $8, %eax |
134 | 8: | 132 | 8: |
135 | popl %ebx | 133 | popl_cfi %ebx |
136 | CFI_ADJUST_CFA_OFFSET -4 | ||
137 | CFI_RESTORE ebx | 134 | CFI_RESTORE ebx |
138 | popl %esi | 135 | popl_cfi %esi |
139 | CFI_ADJUST_CFA_OFFSET -4 | ||
140 | CFI_RESTORE esi | 136 | CFI_RESTORE esi |
141 | ret | 137 | ret |
142 | CFI_ENDPROC | 138 | CFI_ENDPROC |
@@ -148,11 +144,9 @@ ENDPROC(csum_partial) | |||
148 | 144 | ||
149 | ENTRY(csum_partial) | 145 | ENTRY(csum_partial) |
150 | CFI_STARTPROC | 146 | CFI_STARTPROC |
151 | pushl %esi | 147 | pushl_cfi %esi |
152 | CFI_ADJUST_CFA_OFFSET 4 | ||
153 | CFI_REL_OFFSET esi, 0 | 148 | CFI_REL_OFFSET esi, 0 |
154 | pushl %ebx | 149 | pushl_cfi %ebx |
155 | CFI_ADJUST_CFA_OFFSET 4 | ||
156 | CFI_REL_OFFSET ebx, 0 | 150 | CFI_REL_OFFSET ebx, 0 |
157 | movl 20(%esp),%eax # Function arg: unsigned int sum | 151 | movl 20(%esp),%eax # Function arg: unsigned int sum |
158 | movl 16(%esp),%ecx # Function arg: int len | 152 | movl 16(%esp),%ecx # Function arg: int len |
@@ -260,11 +254,9 @@ ENTRY(csum_partial) | |||
260 | jz 90f | 254 | jz 90f |
261 | roll $8, %eax | 255 | roll $8, %eax |
262 | 90: | 256 | 90: |
263 | popl %ebx | 257 | popl_cfi %ebx |
264 | CFI_ADJUST_CFA_OFFSET -4 | ||
265 | CFI_RESTORE ebx | 258 | CFI_RESTORE ebx |
266 | popl %esi | 259 | popl_cfi %esi |
267 | CFI_ADJUST_CFA_OFFSET -4 | ||
268 | CFI_RESTORE esi | 260 | CFI_RESTORE esi |
269 | ret | 261 | ret |
270 | CFI_ENDPROC | 262 | CFI_ENDPROC |
@@ -309,14 +301,11 @@ ENTRY(csum_partial_copy_generic) | |||
309 | CFI_STARTPROC | 301 | CFI_STARTPROC |
310 | subl $4,%esp | 302 | subl $4,%esp |
311 | CFI_ADJUST_CFA_OFFSET 4 | 303 | CFI_ADJUST_CFA_OFFSET 4 |
312 | pushl %edi | 304 | pushl_cfi %edi |
313 | CFI_ADJUST_CFA_OFFSET 4 | ||
314 | CFI_REL_OFFSET edi, 0 | 305 | CFI_REL_OFFSET edi, 0 |
315 | pushl %esi | 306 | pushl_cfi %esi |
316 | CFI_ADJUST_CFA_OFFSET 4 | ||
317 | CFI_REL_OFFSET esi, 0 | 307 | CFI_REL_OFFSET esi, 0 |
318 | pushl %ebx | 308 | pushl_cfi %ebx |
319 | CFI_ADJUST_CFA_OFFSET 4 | ||
320 | CFI_REL_OFFSET ebx, 0 | 309 | CFI_REL_OFFSET ebx, 0 |
321 | movl ARGBASE+16(%esp),%eax # sum | 310 | movl ARGBASE+16(%esp),%eax # sum |
322 | movl ARGBASE+12(%esp),%ecx # len | 311 | movl ARGBASE+12(%esp),%ecx # len |
@@ -426,17 +415,13 @@ DST( movb %cl, (%edi) ) | |||
426 | 415 | ||
427 | .previous | 416 | .previous |
428 | 417 | ||
429 | popl %ebx | 418 | popl_cfi %ebx |
430 | CFI_ADJUST_CFA_OFFSET -4 | ||
431 | CFI_RESTORE ebx | 419 | CFI_RESTORE ebx |
432 | popl %esi | 420 | popl_cfi %esi |
433 | CFI_ADJUST_CFA_OFFSET -4 | ||
434 | CFI_RESTORE esi | 421 | CFI_RESTORE esi |
435 | popl %edi | 422 | popl_cfi %edi |
436 | CFI_ADJUST_CFA_OFFSET -4 | ||
437 | CFI_RESTORE edi | 423 | CFI_RESTORE edi |
438 | popl %ecx # equivalent to addl $4,%esp | 424 | popl_cfi %ecx # equivalent to addl $4,%esp |
439 | CFI_ADJUST_CFA_OFFSET -4 | ||
440 | ret | 425 | ret |
441 | CFI_ENDPROC | 426 | CFI_ENDPROC |
442 | ENDPROC(csum_partial_copy_generic) | 427 | ENDPROC(csum_partial_copy_generic) |
@@ -459,14 +444,11 @@ ENDPROC(csum_partial_copy_generic) | |||
459 | 444 | ||
460 | ENTRY(csum_partial_copy_generic) | 445 | ENTRY(csum_partial_copy_generic) |
461 | CFI_STARTPROC | 446 | CFI_STARTPROC |
462 | pushl %ebx | 447 | pushl_cfi %ebx |
463 | CFI_ADJUST_CFA_OFFSET 4 | ||
464 | CFI_REL_OFFSET ebx, 0 | 448 | CFI_REL_OFFSET ebx, 0 |
465 | pushl %edi | 449 | pushl_cfi %edi |
466 | CFI_ADJUST_CFA_OFFSET 4 | ||
467 | CFI_REL_OFFSET edi, 0 | 450 | CFI_REL_OFFSET edi, 0 |
468 | pushl %esi | 451 | pushl_cfi %esi |
469 | CFI_ADJUST_CFA_OFFSET 4 | ||
470 | CFI_REL_OFFSET esi, 0 | 452 | CFI_REL_OFFSET esi, 0 |
471 | movl ARGBASE+4(%esp),%esi #src | 453 | movl ARGBASE+4(%esp),%esi #src |
472 | movl ARGBASE+8(%esp),%edi #dst | 454 | movl ARGBASE+8(%esp),%edi #dst |
@@ -527,14 +509,11 @@ DST( movb %dl, (%edi) ) | |||
527 | jmp 7b | 509 | jmp 7b |
528 | .previous | 510 | .previous |
529 | 511 | ||
530 | popl %esi | 512 | popl_cfi %esi |
531 | CFI_ADJUST_CFA_OFFSET -4 | ||
532 | CFI_RESTORE esi | 513 | CFI_RESTORE esi |
533 | popl %edi | 514 | popl_cfi %edi |
534 | CFI_ADJUST_CFA_OFFSET -4 | ||
535 | CFI_RESTORE edi | 515 | CFI_RESTORE edi |
536 | popl %ebx | 516 | popl_cfi %ebx |
537 | CFI_ADJUST_CFA_OFFSET -4 | ||
538 | CFI_RESTORE ebx | 517 | CFI_RESTORE ebx |
539 | ret | 518 | ret |
540 | CFI_ENDPROC | 519 | CFI_ENDPROC |
diff --git a/arch/x86/lib/rwsem_64.S b/arch/x86/lib/rwsem_64.S index 41fcf00e49df..67743977398b 100644 --- a/arch/x86/lib/rwsem_64.S +++ b/arch/x86/lib/rwsem_64.S | |||
@@ -23,43 +23,50 @@ | |||
23 | #include <asm/dwarf2.h> | 23 | #include <asm/dwarf2.h> |
24 | 24 | ||
25 | #define save_common_regs \ | 25 | #define save_common_regs \ |
26 | pushq %rdi; \ | 26 | pushq_cfi %rdi; CFI_REL_OFFSET rdi, 0; \ |
27 | pushq %rsi; \ | 27 | pushq_cfi %rsi; CFI_REL_OFFSET rsi, 0; \ |
28 | pushq %rcx; \ | 28 | pushq_cfi %rcx; CFI_REL_OFFSET rcx, 0; \ |
29 | pushq %r8; \ | 29 | pushq_cfi %r8; CFI_REL_OFFSET r8, 0; \ |
30 | pushq %r9; \ | 30 | pushq_cfi %r9; CFI_REL_OFFSET r9, 0; \ |
31 | pushq %r10; \ | 31 | pushq_cfi %r10; CFI_REL_OFFSET r10, 0; \ |
32 | pushq %r11 | 32 | pushq_cfi %r11; CFI_REL_OFFSET r11, 0 |
33 | 33 | ||
34 | #define restore_common_regs \ | 34 | #define restore_common_regs \ |
35 | popq %r11; \ | 35 | popq_cfi %r11; CFI_RESTORE r11; \ |
36 | popq %r10; \ | 36 | popq_cfi %r10; CFI_RESTORE r10; \ |
37 | popq %r9; \ | 37 | popq_cfi %r9; CFI_RESTORE r9; \ |
38 | popq %r8; \ | 38 | popq_cfi %r8; CFI_RESTORE r8; \ |
39 | popq %rcx; \ | 39 | popq_cfi %rcx; CFI_RESTORE rcx; \ |
40 | popq %rsi; \ | 40 | popq_cfi %rsi; CFI_RESTORE rsi; \ |
41 | popq %rdi | 41 | popq_cfi %rdi; CFI_RESTORE rdi |
42 | 42 | ||
43 | /* Fix up special calling conventions */ | 43 | /* Fix up special calling conventions */ |
44 | ENTRY(call_rwsem_down_read_failed) | 44 | ENTRY(call_rwsem_down_read_failed) |
45 | CFI_STARTPROC | ||
45 | save_common_regs | 46 | save_common_regs |
46 | pushq %rdx | 47 | pushq_cfi %rdx |
48 | CFI_REL_OFFSET rdx, 0 | ||
47 | movq %rax,%rdi | 49 | movq %rax,%rdi |
48 | call rwsem_down_read_failed | 50 | call rwsem_down_read_failed |
49 | popq %rdx | 51 | popq_cfi %rdx |
52 | CFI_RESTORE rdx | ||
50 | restore_common_regs | 53 | restore_common_regs |
51 | ret | 54 | ret |
52 | ENDPROC(call_rwsem_down_read_failed) | 55 | CFI_ENDPROC |
56 | ENDPROC(call_rwsem_down_read_failed) | ||
53 | 57 | ||
54 | ENTRY(call_rwsem_down_write_failed) | 58 | ENTRY(call_rwsem_down_write_failed) |
59 | CFI_STARTPROC | ||
55 | save_common_regs | 60 | save_common_regs |
56 | movq %rax,%rdi | 61 | movq %rax,%rdi |
57 | call rwsem_down_write_failed | 62 | call rwsem_down_write_failed |
58 | restore_common_regs | 63 | restore_common_regs |
59 | ret | 64 | ret |
60 | ENDPROC(call_rwsem_down_write_failed) | 65 | CFI_ENDPROC |
66 | ENDPROC(call_rwsem_down_write_failed) | ||
61 | 67 | ||
62 | ENTRY(call_rwsem_wake) | 68 | ENTRY(call_rwsem_wake) |
69 | CFI_STARTPROC | ||
63 | decl %edx /* do nothing if still outstanding active readers */ | 70 | decl %edx /* do nothing if still outstanding active readers */ |
64 | jnz 1f | 71 | jnz 1f |
65 | save_common_regs | 72 | save_common_regs |
@@ -67,15 +74,20 @@ ENTRY(call_rwsem_wake) | |||
67 | call rwsem_wake | 74 | call rwsem_wake |
68 | restore_common_regs | 75 | restore_common_regs |
69 | 1: ret | 76 | 1: ret |
70 | ENDPROC(call_rwsem_wake) | 77 | CFI_ENDPROC |
78 | ENDPROC(call_rwsem_wake) | ||
71 | 79 | ||
72 | /* Fix up special calling conventions */ | 80 | /* Fix up special calling conventions */ |
73 | ENTRY(call_rwsem_downgrade_wake) | 81 | ENTRY(call_rwsem_downgrade_wake) |
82 | CFI_STARTPROC | ||
74 | save_common_regs | 83 | save_common_regs |
75 | pushq %rdx | 84 | pushq_cfi %rdx |
85 | CFI_REL_OFFSET rdx, 0 | ||
76 | movq %rax,%rdi | 86 | movq %rax,%rdi |
77 | call rwsem_downgrade_wake | 87 | call rwsem_downgrade_wake |
78 | popq %rdx | 88 | popq_cfi %rdx |
89 | CFI_RESTORE rdx | ||
79 | restore_common_regs | 90 | restore_common_regs |
80 | ret | 91 | ret |
81 | ENDPROC(call_rwsem_downgrade_wake) | 92 | CFI_ENDPROC |
93 | ENDPROC(call_rwsem_downgrade_wake) | ||
diff --git a/arch/x86/lib/semaphore_32.S b/arch/x86/lib/semaphore_32.S index 648fe4741782..06691daa4108 100644 --- a/arch/x86/lib/semaphore_32.S +++ b/arch/x86/lib/semaphore_32.S | |||
@@ -36,7 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | #ifdef CONFIG_SMP | 37 | #ifdef CONFIG_SMP |
38 | ENTRY(__write_lock_failed) | 38 | ENTRY(__write_lock_failed) |
39 | CFI_STARTPROC simple | 39 | CFI_STARTPROC |
40 | FRAME | 40 | FRAME |
41 | 2: LOCK_PREFIX | 41 | 2: LOCK_PREFIX |
42 | addl $ RW_LOCK_BIAS,(%eax) | 42 | addl $ RW_LOCK_BIAS,(%eax) |
@@ -74,29 +74,23 @@ ENTRY(__read_lock_failed) | |||
74 | /* Fix up special calling conventions */ | 74 | /* Fix up special calling conventions */ |
75 | ENTRY(call_rwsem_down_read_failed) | 75 | ENTRY(call_rwsem_down_read_failed) |
76 | CFI_STARTPROC | 76 | CFI_STARTPROC |
77 | push %ecx | 77 | pushl_cfi %ecx |
78 | CFI_ADJUST_CFA_OFFSET 4 | ||
79 | CFI_REL_OFFSET ecx,0 | 78 | CFI_REL_OFFSET ecx,0 |
80 | push %edx | 79 | pushl_cfi %edx |
81 | CFI_ADJUST_CFA_OFFSET 4 | ||
82 | CFI_REL_OFFSET edx,0 | 80 | CFI_REL_OFFSET edx,0 |
83 | call rwsem_down_read_failed | 81 | call rwsem_down_read_failed |
84 | pop %edx | 82 | popl_cfi %edx |
85 | CFI_ADJUST_CFA_OFFSET -4 | 83 | popl_cfi %ecx |
86 | pop %ecx | ||
87 | CFI_ADJUST_CFA_OFFSET -4 | ||
88 | ret | 84 | ret |
89 | CFI_ENDPROC | 85 | CFI_ENDPROC |
90 | ENDPROC(call_rwsem_down_read_failed) | 86 | ENDPROC(call_rwsem_down_read_failed) |
91 | 87 | ||
92 | ENTRY(call_rwsem_down_write_failed) | 88 | ENTRY(call_rwsem_down_write_failed) |
93 | CFI_STARTPROC | 89 | CFI_STARTPROC |
94 | push %ecx | 90 | pushl_cfi %ecx |
95 | CFI_ADJUST_CFA_OFFSET 4 | ||
96 | CFI_REL_OFFSET ecx,0 | 91 | CFI_REL_OFFSET ecx,0 |
97 | calll rwsem_down_write_failed | 92 | calll rwsem_down_write_failed |
98 | pop %ecx | 93 | popl_cfi %ecx |
99 | CFI_ADJUST_CFA_OFFSET -4 | ||
100 | ret | 94 | ret |
101 | CFI_ENDPROC | 95 | CFI_ENDPROC |
102 | ENDPROC(call_rwsem_down_write_failed) | 96 | ENDPROC(call_rwsem_down_write_failed) |
@@ -105,12 +99,10 @@ ENTRY(call_rwsem_wake) | |||
105 | CFI_STARTPROC | 99 | CFI_STARTPROC |
106 | decw %dx /* do nothing if still outstanding active readers */ | 100 | decw %dx /* do nothing if still outstanding active readers */ |
107 | jnz 1f | 101 | jnz 1f |
108 | push %ecx | 102 | pushl_cfi %ecx |
109 | CFI_ADJUST_CFA_OFFSET 4 | ||
110 | CFI_REL_OFFSET ecx,0 | 103 | CFI_REL_OFFSET ecx,0 |
111 | call rwsem_wake | 104 | call rwsem_wake |
112 | pop %ecx | 105 | popl_cfi %ecx |
113 | CFI_ADJUST_CFA_OFFSET -4 | ||
114 | 1: ret | 106 | 1: ret |
115 | CFI_ENDPROC | 107 | CFI_ENDPROC |
116 | ENDPROC(call_rwsem_wake) | 108 | ENDPROC(call_rwsem_wake) |
@@ -118,17 +110,13 @@ ENTRY(call_rwsem_wake) | |||
118 | /* Fix up special calling conventions */ | 110 | /* Fix up special calling conventions */ |
119 | ENTRY(call_rwsem_downgrade_wake) | 111 | ENTRY(call_rwsem_downgrade_wake) |
120 | CFI_STARTPROC | 112 | CFI_STARTPROC |
121 | push %ecx | 113 | pushl_cfi %ecx |
122 | CFI_ADJUST_CFA_OFFSET 4 | ||
123 | CFI_REL_OFFSET ecx,0 | 114 | CFI_REL_OFFSET ecx,0 |
124 | push %edx | 115 | pushl_cfi %edx |
125 | CFI_ADJUST_CFA_OFFSET 4 | ||
126 | CFI_REL_OFFSET edx,0 | 116 | CFI_REL_OFFSET edx,0 |
127 | call rwsem_downgrade_wake | 117 | call rwsem_downgrade_wake |
128 | pop %edx | 118 | popl_cfi %edx |
129 | CFI_ADJUST_CFA_OFFSET -4 | 119 | popl_cfi %ecx |
130 | pop %ecx | ||
131 | CFI_ADJUST_CFA_OFFSET -4 | ||
132 | ret | 120 | ret |
133 | CFI_ENDPROC | 121 | CFI_ENDPROC |
134 | ENDPROC(call_rwsem_downgrade_wake) | 122 | ENDPROC(call_rwsem_downgrade_wake) |
diff --git a/arch/x86/lib/thunk_32.S b/arch/x86/lib/thunk_32.S index 650b11e00ecc..2930ae05d773 100644 --- a/arch/x86/lib/thunk_32.S +++ b/arch/x86/lib/thunk_32.S | |||
@@ -7,24 +7,6 @@ | |||
7 | 7 | ||
8 | #include <linux/linkage.h> | 8 | #include <linux/linkage.h> |
9 | 9 | ||
10 | #define ARCH_TRACE_IRQS_ON \ | ||
11 | pushl %eax; \ | ||
12 | pushl %ecx; \ | ||
13 | pushl %edx; \ | ||
14 | call trace_hardirqs_on; \ | ||
15 | popl %edx; \ | ||
16 | popl %ecx; \ | ||
17 | popl %eax; | ||
18 | |||
19 | #define ARCH_TRACE_IRQS_OFF \ | ||
20 | pushl %eax; \ | ||
21 | pushl %ecx; \ | ||
22 | pushl %edx; \ | ||
23 | call trace_hardirqs_off; \ | ||
24 | popl %edx; \ | ||
25 | popl %ecx; \ | ||
26 | popl %eax; | ||
27 | |||
28 | #ifdef CONFIG_TRACE_IRQFLAGS | 10 | #ifdef CONFIG_TRACE_IRQFLAGS |
29 | /* put return address in eax (arg1) */ | 11 | /* put return address in eax (arg1) */ |
30 | .macro thunk_ra name,func | 12 | .macro thunk_ra name,func |
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/lib/thunk_64.S index bf9a7d5a5428..782b082c9ff7 100644 --- a/arch/x86/lib/thunk_64.S +++ b/arch/x86/lib/thunk_64.S | |||
@@ -22,26 +22,6 @@ | |||
22 | CFI_ENDPROC | 22 | CFI_ENDPROC |
23 | .endm | 23 | .endm |
24 | 24 | ||
25 | /* rdi: arg1 ... normal C conventions. rax is passed from C. */ | ||
26 | .macro thunk_retrax name,func | ||
27 | .globl \name | ||
28 | \name: | ||
29 | CFI_STARTPROC | ||
30 | SAVE_ARGS | ||
31 | call \func | ||
32 | jmp restore_norax | ||
33 | CFI_ENDPROC | ||
34 | .endm | ||
35 | |||
36 | |||
37 | .section .sched.text, "ax" | ||
38 | #ifdef CONFIG_RWSEM_XCHGADD_ALGORITHM | ||
39 | thunk rwsem_down_read_failed_thunk,rwsem_down_read_failed | ||
40 | thunk rwsem_down_write_failed_thunk,rwsem_down_write_failed | ||
41 | thunk rwsem_wake_thunk,rwsem_wake | ||
42 | thunk rwsem_downgrade_thunk,rwsem_downgrade_wake | ||
43 | #endif | ||
44 | |||
45 | #ifdef CONFIG_TRACE_IRQFLAGS | 25 | #ifdef CONFIG_TRACE_IRQFLAGS |
46 | /* put return address in rdi (arg1) */ | 26 | /* put return address in rdi (arg1) */ |
47 | .macro thunk_ra name,func | 27 | .macro thunk_ra name,func |
@@ -72,10 +52,3 @@ restore: | |||
72 | RESTORE_ARGS | 52 | RESTORE_ARGS |
73 | ret | 53 | ret |
74 | CFI_ENDPROC | 54 | CFI_ENDPROC |
75 | |||
76 | CFI_STARTPROC | ||
77 | SAVE_ARGS | ||
78 | restore_norax: | ||
79 | RESTORE_ARGS 1 | ||
80 | ret | ||
81 | CFI_ENDPROC | ||
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index 1a5ff24e29c0..aaa7291c9259 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S | |||
@@ -28,9 +28,9 @@ ENTRY(startup_xen) | |||
28 | __FINIT | 28 | __FINIT |
29 | 29 | ||
30 | .pushsection .text | 30 | .pushsection .text |
31 | .align PAGE_SIZE_asm | 31 | .align PAGE_SIZE |
32 | ENTRY(hypercall_page) | 32 | ENTRY(hypercall_page) |
33 | .skip PAGE_SIZE_asm | 33 | .skip PAGE_SIZE |
34 | .popsection | 34 | .popsection |
35 | 35 | ||
36 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") | 36 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") |