mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
[S390] entry[64].S improvements
Another round of cleanup for entry[64].S, in particular the program check handler looks more reasonable now. The code size for the 31 bit kernel has been reduced by 616 byte and by 528 byte for the 64 bit version. Even better the code is a bit faster as well. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
3b7f993394
commit
c5328901aa
@ -97,47 +97,52 @@ struct _lowcore {
|
||||
__u32 gpregs_save_area[16]; /* 0x0180 */
|
||||
__u32 cregs_save_area[16]; /* 0x01c0 */
|
||||
|
||||
/* Save areas. */
|
||||
__u32 save_area_sync[8]; /* 0x0200 */
|
||||
__u32 save_area_async[8]; /* 0x0220 */
|
||||
__u32 save_area_restart[1]; /* 0x0240 */
|
||||
__u8 pad_0x0244[0x0248-0x0244]; /* 0x0244 */
|
||||
|
||||
/* Return psws. */
|
||||
__u32 save_area[16]; /* 0x0200 */
|
||||
psw_t return_psw; /* 0x0240 */
|
||||
psw_t return_mcck_psw; /* 0x0248 */
|
||||
psw_t return_psw; /* 0x0248 */
|
||||
psw_t return_mcck_psw; /* 0x0250 */
|
||||
|
||||
/* CPU time accounting values */
|
||||
__u64 sync_enter_timer; /* 0x0250 */
|
||||
__u64 async_enter_timer; /* 0x0258 */
|
||||
__u64 mcck_enter_timer; /* 0x0260 */
|
||||
__u64 exit_timer; /* 0x0268 */
|
||||
__u64 user_timer; /* 0x0270 */
|
||||
__u64 system_timer; /* 0x0278 */
|
||||
__u64 steal_timer; /* 0x0280 */
|
||||
__u64 last_update_timer; /* 0x0288 */
|
||||
__u64 last_update_clock; /* 0x0290 */
|
||||
__u64 sync_enter_timer; /* 0x0258 */
|
||||
__u64 async_enter_timer; /* 0x0260 */
|
||||
__u64 mcck_enter_timer; /* 0x0268 */
|
||||
__u64 exit_timer; /* 0x0270 */
|
||||
__u64 user_timer; /* 0x0278 */
|
||||
__u64 system_timer; /* 0x0280 */
|
||||
__u64 steal_timer; /* 0x0288 */
|
||||
__u64 last_update_timer; /* 0x0290 */
|
||||
__u64 last_update_clock; /* 0x0298 */
|
||||
|
||||
/* Current process. */
|
||||
__u32 current_task; /* 0x0298 */
|
||||
__u32 thread_info; /* 0x029c */
|
||||
__u32 kernel_stack; /* 0x02a0 */
|
||||
__u32 current_task; /* 0x02a0 */
|
||||
__u32 thread_info; /* 0x02a4 */
|
||||
__u32 kernel_stack; /* 0x02a8 */
|
||||
|
||||
/* Interrupt and panic stack. */
|
||||
__u32 async_stack; /* 0x02a4 */
|
||||
__u32 panic_stack; /* 0x02a8 */
|
||||
__u32 async_stack; /* 0x02ac */
|
||||
__u32 panic_stack; /* 0x02b0 */
|
||||
|
||||
/* Address space pointer. */
|
||||
__u32 kernel_asce; /* 0x02ac */
|
||||
__u32 user_asce; /* 0x02b0 */
|
||||
__u32 current_pid; /* 0x02b4 */
|
||||
__u32 kernel_asce; /* 0x02b4 */
|
||||
__u32 user_asce; /* 0x02b8 */
|
||||
__u32 current_pid; /* 0x02bc */
|
||||
|
||||
/* SMP info area */
|
||||
__u32 cpu_nr; /* 0x02b8 */
|
||||
__u32 softirq_pending; /* 0x02bc */
|
||||
__u32 percpu_offset; /* 0x02c0 */
|
||||
__u32 ext_call_fast; /* 0x02c4 */
|
||||
__u64 int_clock; /* 0x02c8 */
|
||||
__u64 mcck_clock; /* 0x02d0 */
|
||||
__u64 clock_comparator; /* 0x02d8 */
|
||||
__u32 machine_flags; /* 0x02e0 */
|
||||
__u32 ftrace_func; /* 0x02e4 */
|
||||
__u8 pad_0x02e8[0x0300-0x02e8]; /* 0x02e8 */
|
||||
__u32 cpu_nr; /* 0x02c0 */
|
||||
__u32 softirq_pending; /* 0x02c4 */
|
||||
__u32 percpu_offset; /* 0x02c8 */
|
||||
__u32 ext_call_fast; /* 0x02cc */
|
||||
__u64 int_clock; /* 0x02d0 */
|
||||
__u64 mcck_clock; /* 0x02d8 */
|
||||
__u64 clock_comparator; /* 0x02e0 */
|
||||
__u32 machine_flags; /* 0x02e8 */
|
||||
__u32 ftrace_func; /* 0x02ec */
|
||||
__u8 pad_0x02f8[0x0300-0x02f0]; /* 0x02f0 */
|
||||
|
||||
/* Interrupt response block */
|
||||
__u8 irb[64]; /* 0x0300 */
|
||||
@ -229,57 +234,62 @@ struct _lowcore {
|
||||
psw_t mcck_new_psw; /* 0x01e0 */
|
||||
psw_t io_new_psw; /* 0x01f0 */
|
||||
|
||||
/* Entry/exit save area & return psws. */
|
||||
__u64 save_area[16]; /* 0x0200 */
|
||||
psw_t return_psw; /* 0x0280 */
|
||||
psw_t return_mcck_psw; /* 0x0290 */
|
||||
/* Save areas. */
|
||||
__u64 save_area_sync[8]; /* 0x0200 */
|
||||
__u64 save_area_async[8]; /* 0x0240 */
|
||||
__u64 save_area_restart[1]; /* 0x0280 */
|
||||
__u8 pad_0x0288[0x0290-0x0288]; /* 0x0288 */
|
||||
|
||||
/* Return psws. */
|
||||
psw_t return_psw; /* 0x0290 */
|
||||
psw_t return_mcck_psw; /* 0x02a0 */
|
||||
|
||||
/* CPU accounting and timing values. */
|
||||
__u64 sync_enter_timer; /* 0x02a0 */
|
||||
__u64 async_enter_timer; /* 0x02a8 */
|
||||
__u64 mcck_enter_timer; /* 0x02b0 */
|
||||
__u64 exit_timer; /* 0x02b8 */
|
||||
__u64 user_timer; /* 0x02c0 */
|
||||
__u64 system_timer; /* 0x02c8 */
|
||||
__u64 steal_timer; /* 0x02d0 */
|
||||
__u64 last_update_timer; /* 0x02d8 */
|
||||
__u64 last_update_clock; /* 0x02e0 */
|
||||
__u64 sync_enter_timer; /* 0x02b0 */
|
||||
__u64 async_enter_timer; /* 0x02b8 */
|
||||
__u64 mcck_enter_timer; /* 0x02c0 */
|
||||
__u64 exit_timer; /* 0x02c8 */
|
||||
__u64 user_timer; /* 0x02d0 */
|
||||
__u64 system_timer; /* 0x02d8 */
|
||||
__u64 steal_timer; /* 0x02e0 */
|
||||
__u64 last_update_timer; /* 0x02e8 */
|
||||
__u64 last_update_clock; /* 0x02f0 */
|
||||
|
||||
/* Current process. */
|
||||
__u64 current_task; /* 0x02e8 */
|
||||
__u64 thread_info; /* 0x02f0 */
|
||||
__u64 kernel_stack; /* 0x02f8 */
|
||||
__u64 current_task; /* 0x02f8 */
|
||||
__u64 thread_info; /* 0x0300 */
|
||||
__u64 kernel_stack; /* 0x0308 */
|
||||
|
||||
/* Interrupt and panic stack. */
|
||||
__u64 async_stack; /* 0x0300 */
|
||||
__u64 panic_stack; /* 0x0308 */
|
||||
__u64 async_stack; /* 0x0310 */
|
||||
__u64 panic_stack; /* 0x0318 */
|
||||
|
||||
/* Address space pointer. */
|
||||
__u64 kernel_asce; /* 0x0310 */
|
||||
__u64 user_asce; /* 0x0318 */
|
||||
__u64 current_pid; /* 0x0320 */
|
||||
__u64 kernel_asce; /* 0x0320 */
|
||||
__u64 user_asce; /* 0x0328 */
|
||||
__u64 current_pid; /* 0x0330 */
|
||||
|
||||
/* SMP info area */
|
||||
__u32 cpu_nr; /* 0x0328 */
|
||||
__u32 softirq_pending; /* 0x032c */
|
||||
__u64 percpu_offset; /* 0x0330 */
|
||||
__u64 ext_call_fast; /* 0x0338 */
|
||||
__u64 int_clock; /* 0x0340 */
|
||||
__u64 mcck_clock; /* 0x0348 */
|
||||
__u64 clock_comparator; /* 0x0350 */
|
||||
__u64 vdso_per_cpu_data; /* 0x0358 */
|
||||
__u64 machine_flags; /* 0x0360 */
|
||||
__u64 ftrace_func; /* 0x0368 */
|
||||
__u64 gmap; /* 0x0370 */
|
||||
__u8 pad_0x0378[0x0380-0x0378]; /* 0x0378 */
|
||||
__u32 cpu_nr; /* 0x0338 */
|
||||
__u32 softirq_pending; /* 0x033c */
|
||||
__u64 percpu_offset; /* 0x0340 */
|
||||
__u64 ext_call_fast; /* 0x0348 */
|
||||
__u64 int_clock; /* 0x0350 */
|
||||
__u64 mcck_clock; /* 0x0358 */
|
||||
__u64 clock_comparator; /* 0x0360 */
|
||||
__u64 vdso_per_cpu_data; /* 0x0368 */
|
||||
__u64 machine_flags; /* 0x0370 */
|
||||
__u64 ftrace_func; /* 0x0378 */
|
||||
__u64 gmap; /* 0x0380 */
|
||||
__u8 pad_0x0388[0x0400-0x0388]; /* 0x0388 */
|
||||
|
||||
/* Interrupt response block. */
|
||||
__u8 irb[64]; /* 0x0380 */
|
||||
__u8 irb[64]; /* 0x0400 */
|
||||
|
||||
/* Per cpu primary space access list */
|
||||
__u32 paste[16]; /* 0x03c0 */
|
||||
__u32 paste[16]; /* 0x0440 */
|
||||
|
||||
__u8 pad_0x0400[0x0e00-0x0400]; /* 0x0400 */
|
||||
__u8 pad_0x0480[0x0e00-0x0480]; /* 0x0480 */
|
||||
|
||||
/*
|
||||
* 0xe00 contains the address of the IPL Parameter Information
|
||||
|
@ -108,7 +108,9 @@ int main(void)
|
||||
DEFINE(__LC_PGM_NEW_PSW, offsetof(struct _lowcore, program_new_psw));
|
||||
DEFINE(__LC_MCK_NEW_PSW, offsetof(struct _lowcore, mcck_new_psw));
|
||||
DEFINE(__LC_IO_NEW_PSW, offsetof(struct _lowcore, io_new_psw));
|
||||
DEFINE(__LC_SAVE_AREA, offsetof(struct _lowcore, save_area));
|
||||
DEFINE(__LC_SAVE_AREA_SYNC, offsetof(struct _lowcore, save_area_sync));
|
||||
DEFINE(__LC_SAVE_AREA_ASYNC, offsetof(struct _lowcore, save_area_async));
|
||||
DEFINE(__LC_SAVE_AREA_RESTART, offsetof(struct _lowcore, save_area_restart));
|
||||
DEFINE(__LC_RETURN_PSW, offsetof(struct _lowcore, return_psw));
|
||||
DEFINE(__LC_RETURN_MCCK_PSW, offsetof(struct _lowcore, return_mcck_psw));
|
||||
DEFINE(__LC_SYNC_ENTER_TIMER, offsetof(struct _lowcore, sync_enter_timer));
|
||||
|
@ -33,7 +33,7 @@ s390_base_mcck_handler_fn:
|
||||
.previous
|
||||
|
||||
ENTRY(s390_base_ext_handler)
|
||||
stmg %r0,%r15,__LC_SAVE_AREA
|
||||
stmg %r0,%r15,__LC_SAVE_AREA_ASYNC
|
||||
basr %r13,0
|
||||
0: aghi %r15,-STACK_FRAME_OVERHEAD
|
||||
larl %r1,s390_base_ext_handler_fn
|
||||
@ -41,7 +41,7 @@ ENTRY(s390_base_ext_handler)
|
||||
ltgr %r1,%r1
|
||||
jz 1f
|
||||
basr %r14,%r1
|
||||
1: lmg %r0,%r15,__LC_SAVE_AREA
|
||||
1: lmg %r0,%r15,__LC_SAVE_AREA_ASYNC
|
||||
ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
|
||||
lpswe __LC_EXT_OLD_PSW
|
||||
|
||||
@ -53,7 +53,7 @@ s390_base_ext_handler_fn:
|
||||
.previous
|
||||
|
||||
ENTRY(s390_base_pgm_handler)
|
||||
stmg %r0,%r15,__LC_SAVE_AREA
|
||||
stmg %r0,%r15,__LC_SAVE_AREA_SYNC
|
||||
basr %r13,0
|
||||
0: aghi %r15,-STACK_FRAME_OVERHEAD
|
||||
larl %r1,s390_base_pgm_handler_fn
|
||||
@ -61,7 +61,7 @@ ENTRY(s390_base_pgm_handler)
|
||||
ltgr %r1,%r1
|
||||
jz 1f
|
||||
basr %r14,%r1
|
||||
lmg %r0,%r15,__LC_SAVE_AREA
|
||||
lmg %r0,%r15,__LC_SAVE_AREA_SYNC
|
||||
lpswe __LC_PGM_OLD_PSW
|
||||
1: lpswe disabled_wait_psw-0b(%r13)
|
||||
|
||||
@ -142,7 +142,7 @@ s390_base_mcck_handler_fn:
|
||||
.previous
|
||||
|
||||
ENTRY(s390_base_ext_handler)
|
||||
stm %r0,%r15,__LC_SAVE_AREA
|
||||
stm %r0,%r15,__LC_SAVE_AREA_ASYNC
|
||||
basr %r13,0
|
||||
0: ahi %r15,-STACK_FRAME_OVERHEAD
|
||||
l %r1,2f-0b(%r13)
|
||||
@ -150,7 +150,7 @@ ENTRY(s390_base_ext_handler)
|
||||
ltr %r1,%r1
|
||||
jz 1f
|
||||
basr %r14,%r1
|
||||
1: lm %r0,%r15,__LC_SAVE_AREA
|
||||
1: lm %r0,%r15,__LC_SAVE_AREA_ASYNC
|
||||
ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
|
||||
lpsw __LC_EXT_OLD_PSW
|
||||
|
||||
@ -164,7 +164,7 @@ s390_base_ext_handler_fn:
|
||||
.previous
|
||||
|
||||
ENTRY(s390_base_pgm_handler)
|
||||
stm %r0,%r15,__LC_SAVE_AREA
|
||||
stm %r0,%r15,__LC_SAVE_AREA_SYNC
|
||||
basr %r13,0
|
||||
0: ahi %r15,-STACK_FRAME_OVERHEAD
|
||||
l %r1,2f-0b(%r13)
|
||||
@ -172,7 +172,7 @@ ENTRY(s390_base_pgm_handler)
|
||||
ltr %r1,%r1
|
||||
jz 1f
|
||||
basr %r14,%r1
|
||||
lm %r0,%r15,__LC_SAVE_AREA
|
||||
lm %r0,%r15,__LC_SAVE_AREA_SYNC
|
||||
lpsw __LC_PGM_OLD_PSW
|
||||
|
||||
1: lpsw disabled_wait_psw-0b(%r13)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -329,8 +329,8 @@ iplstart:
|
||||
#
|
||||
# reset files in VM reader
|
||||
#
|
||||
stidp __LC_SAVE_AREA # store cpuid
|
||||
tm __LC_SAVE_AREA,0xff # running VM ?
|
||||
stidp __LC_SAVE_AREA_SYNC # store cpuid
|
||||
tm __LC_SAVE_AREA_SYNC,0xff# running VM ?
|
||||
bno .Lnoreset
|
||||
la %r2,.Lreset
|
||||
lhi %r3,26
|
||||
|
@ -17,11 +17,11 @@
|
||||
#
|
||||
ENTRY(store_status)
|
||||
/* Save register one and load save area base */
|
||||
stg %r1,__LC_SAVE_AREA+120(%r0)
|
||||
stg %r1,__LC_SAVE_AREA_RESTART
|
||||
lghi %r1,SAVE_AREA_BASE
|
||||
/* General purpose registers */
|
||||
stmg %r0,%r15,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1)
|
||||
lg %r2,__LC_SAVE_AREA+120(%r0)
|
||||
lg %r2,__LC_SAVE_AREA_RESTART
|
||||
stg %r2,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE+8(%r1)
|
||||
/* Control registers */
|
||||
stctg %c0,%c15,__LC_CREGS_SAVE_AREA-SAVE_AREA_BASE(%r1)
|
||||
|
@ -654,7 +654,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
|
||||
- sizeof(struct stack_frame));
|
||||
memset(sf, 0, sizeof(struct stack_frame));
|
||||
sf->gprs[9] = (unsigned long) sf;
|
||||
cpu_lowcore->save_area[15] = (unsigned long) sf;
|
||||
cpu_lowcore->gpregs_save_area[15] = (unsigned long) sf;
|
||||
__ctl_store(cpu_lowcore->cregs_save_area, 0, 15);
|
||||
atomic_inc(&init_mm.context.attach_count);
|
||||
asm volatile(
|
||||
|
Loading…
Reference in New Issue
Block a user