2005-04-17 02:20:36 +04:00
/ *
* S3 9 0 l o w - l e v e l e n t r y p o i n t s .
*
2012-07-20 13:15:04 +04:00
* Copyright I B M C o r p . 1 9 9 9 , 2 0 1 2
2005-04-17 02:20:36 +04:00
* Author( s ) : M a r t i n S c h w i d e f s k y ( s c h w i d e f s k y @de.ibm.com),
2006-09-28 18:56:37 +04:00
* Hartmut P e n n e r ( h p @de.ibm.com),
* Denis J o s e p h B a r r o w ( d j b a r r o w @de.ibm.com,barrow_dj@yahoo.com),
2005-06-26 01:55:30 +04:00
* Heiko C a r s t e n s < h e i k o . c a r s t e n s @de.ibm.com>
2005-04-17 02:20:36 +04:00
* /
2008-02-05 18:50:40 +03:00
# include < l i n u x / i n i t . h >
2011-07-24 12:48:19 +04:00
# include < l i n u x / l i n k a g e . h >
2005-04-17 02:20:36 +04:00
# include < a s m / c a c h e . h >
# include < a s m / e r r n o . h >
# include < a s m / p t r a c e . h >
# include < a s m / t h r e a d _ i n f o . h >
2005-09-09 22:57:26 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# include < a s m / u n i s t d . h >
# include < a s m / p a g e . h >
2012-06-04 17:05:43 +04:00
# include < a s m / s i g p . h >
2013-06-27 11:01:09 +04:00
# include < a s m / i r q . h >
2005-04-17 02:20:36 +04:00
2011-12-27 14:27:15 +04:00
_ _ PT_ R 0 = _ _ P T _ G P R S
_ _ PT_ R 1 = _ _ P T _ G P R S + 4
_ _ PT_ R 2 = _ _ P T _ G P R S + 8
_ _ PT_ R 3 = _ _ P T _ G P R S + 1 2
_ _ PT_ R 4 = _ _ P T _ G P R S + 1 6
_ _ PT_ R 5 = _ _ P T _ G P R S + 2 0
_ _ PT_ R 6 = _ _ P T _ G P R S + 2 4
_ _ PT_ R 7 = _ _ P T _ G P R S + 2 8
_ _ PT_ R 8 = _ _ P T _ G P R S + 3 2
_ _ PT_ R 9 = _ _ P T _ G P R S + 3 6
_ _ PT_ R 1 0 = _ _ P T _ G P R S + 4 0
_ _ PT_ R 1 1 = _ _ P T _ G P R S + 4 4
_ _ PT_ R 1 2 = _ _ P T _ G P R S + 4 8
_ _ PT_ R 1 3 = _ _ P T _ G P R S + 5 2 4
_ _ PT_ R 1 4 = _ _ P T _ G P R S + 5 6
_ _ PT_ R 1 5 = _ _ P T _ G P R S + 6 0
2005-04-17 02:20:36 +04:00
2008-10-10 23:33:20 +04:00
_ TIF_ W O R K _ S V C = ( _ T I F _ S I G P E N D I N G | _ T I F _ N O T I F Y _ R E S U M E | _ T I F _ N E E D _ R E S C H E D | \
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
_ TIF_ M C C K _ P E N D I N G | _ T I F _ P E R _ T R A P | _ T I F _ A S C E )
2008-10-10 23:33:20 +04:00
_ TIF_ W O R K _ I N T = ( _ T I F _ S I G P E N D I N G | _ T I F _ N O T I F Y _ R E S U M E | _ T I F _ N E E D _ R E S C H E D | \
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
_ TIF_ M C C K _ P E N D I N G | _ T I F _ A S C E )
2011-10-30 18:16:49 +04:00
_ TIF_ T R A C E = ( _ T I F _ S Y S C A L L _ T R A C E | _ T I F _ S Y S C A L L _ A U D I T | _ T I F _ S E C C O M P | \
_ TIF_ S Y S C A L L _ T R A C E P O I N T )
2012-09-10 15:00:09 +04:00
_ TIF_ T R A N S F E R = ( _ T I F _ M C C K _ P E N D I N G | _ T I F _ T L B _ W A I T )
2005-04-17 02:20:36 +04:00
STACK_ S H I F T = P A G E _ S H I F T + T H R E A D _ O R D E R
STACK_ S I Z E = 1 < < S T A C K _ S H I F T
2013-04-24 12:20:43 +04:00
STACK_ I N I T = S T A C K _ S I Z E - S T A C K _ F R A M E _ O V E R H E A D - _ _ P T _ S I Z E
2005-04-17 02:20:36 +04:00
# define B A S E D ( n a m e ) n a m e - s y s t e m _ c a l l ( % r13 )
2006-07-03 11:24:46 +04:00
.macro TRACE_IRQS_ON
2011-12-27 14:27:15 +04:00
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
2008-11-14 20:18:05 +03:00
basr % r2 ,% r0
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L h a r d i r q s _ o n )
basr % r14 ,% r1 # c a l l t r a c e _ h a r d i r q s _ o n _ c a l l e r
# endif
2006-07-03 11:24:46 +04:00
.endm
.macro TRACE_IRQS_OFF
2011-12-27 14:27:15 +04:00
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
2008-11-14 20:18:05 +03:00
basr % r2 ,% r0
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L h a r d i r q s _ o f f )
basr % r14 ,% r1 # c a l l t r a c e _ h a r d i r q s _ o f f _ c a l l e r
2007-11-20 13:13:32 +03:00
# endif
2011-12-27 14:27:15 +04:00
.endm
2007-11-20 13:13:32 +03:00
.macro LOCKDEP_SYS_EXIT
2011-12-27 14:27:15 +04:00
# ifdef C O N F I G _ L O C K D E P
tm _ _ P T _ P S W + 1 ( % r11 ) ,0 x01 # r e t u r n i n g t o u s e r ?
jz . + 1 0
2007-11-20 13:13:32 +03:00
l % r1 ,B A S E D ( . L l o c k d e p _ s y s _ e x i t )
2011-12-27 14:27:15 +04:00
basr % r14 ,% r1 # c a l l l o c k d e p _ s y s _ e x i t
2006-07-03 11:24:46 +04:00
# endif
2007-07-10 13:24:18 +04:00
.endm
2011-12-27 14:27:15 +04:00
.macro CHECK_STACK stacksize,s a v e a r e a
2006-06-29 16:58:05 +04:00
# ifdef C O N F I G _ C H E C K _ S T A C K
2011-12-27 14:27:15 +04:00
tml % r15 ,\ s t a c k s i z e - C O N F I G _ S T A C K _ G U A R D
la % r14 ,\ s a v e a r e a
jz s t a c k _ o v e r f l o w
2006-06-29 16:58:05 +04:00
# endif
.endm
2011-12-27 14:27:15 +04:00
.macro SWITCH_ASYNC savearea,s t a c k ,s h i f t
tmh % r8 ,0 x00 0 1 # i n t e r r u p t i n g f r o m u s e r ?
jnz 1 f
lr % r14 ,% r9
sl % r14 ,B A S E D ( . L c r i t i c a l _ s t a r t )
cl % r14 ,B A S E D ( . L c r i t i c a l _ l e n g t h )
jhe 0 f
la % r11 ,\ s a v e a r e a # i n s i d e c r i t i c a l s e c t i o n , d o c l e a n u p
bras % r14 ,c l e a n u p _ c r i t i c a l
tmh % r8 ,0 x00 0 1 # r e t e s t p r o b l e m s t a t e a f t e r c l e a n u p
jnz 1 f
0 : l % r14 ,\ s t a c k # a r e w e a l r e a d y o n t h e t a r g e t s t a c k ?
2005-04-17 02:20:36 +04:00
slr % r14 ,% r15
2011-12-27 14:27:15 +04:00
sra % r14 ,\ s h i f t
jnz 1 f
CHECK_ S T A C K 1 < < \ s h i f t ,\ s a v e a r e a
2013-04-24 12:20:43 +04:00
ahi % r15 ,- ( S T A C K _ F R A M E _ O V E R H E A D + _ _ P T _ S I Z E )
2011-12-27 14:27:15 +04:00
j 2 f
1 : l % r15 ,\ s t a c k # l o a d t a r g e t s t a c k
2013-04-24 12:20:43 +04:00
2 : la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
2005-06-26 01:55:30 +04:00
.endm
2011-12-27 14:27:15 +04:00
.macro ADD64 high,l o w ,t i m e r
al \ h i g h ,\ t i m e r
2012-03-11 19:59:27 +04:00
al \ l o w ,4 + \ t i m e r
2011-12-27 14:27:15 +04:00
brc 1 2 ,. + 8
ahi \ h i g h ,1
2005-04-17 02:20:36 +04:00
.endm
2011-12-27 14:27:15 +04:00
.macro SUB64 high,l o w ,t i m e r
sl \ h i g h ,\ t i m e r
2012-03-11 19:59:27 +04:00
sl \ l o w ,4 + \ t i m e r
2011-12-27 14:27:15 +04:00
brc 3 ,. + 8
ahi \ h i g h ,- 1
.endm
.macro UPDATE_VTIME high,l o w ,e n t e r _ t i m e r
lm \ h i g h ,\ l o w ,_ _ L C _ E X I T _ T I M E R
SUB6 4 \ h i g h ,\ l o w ,\ e n t e r _ t i m e r
ADD6 4 \ h i g h ,\ l o w ,_ _ L C _ U S E R _ T I M E R
stm \ h i g h ,\ l o w ,_ _ L C _ U S E R _ T I M E R
lm \ h i g h ,\ l o w ,_ _ L C _ L A S T _ U P D A T E _ T I M E R
SUB6 4 \ h i g h ,\ l o w ,_ _ L C _ E X I T _ T I M E R
ADD6 4 \ h i g h ,\ l o w ,_ _ L C _ S Y S T E M _ T I M E R
stm \ h i g h ,\ l o w ,_ _ L C _ S Y S T E M _ T I M E R
mvc _ _ L C _ L A S T _ U P D A T E _ T I M E R ( 8 ) ,\ e n t e r _ t i m e r
2005-04-17 02:20:36 +04:00
.endm
2010-10-25 18:10:37 +04:00
.macro REENABLE_IRQS
2011-12-27 14:27:15 +04:00
st % r8 ,_ _ L C _ R E T U R N _ P S W
ni _ _ L C _ R E T U R N _ P S W ,0 x b f
ssm _ _ L C _ R E T U R N _ P S W
2010-10-25 18:10:37 +04:00
.endm
2011-01-05 14:47:25 +03:00
.section .kprobes .text , " ax"
2005-04-17 02:20:36 +04:00
/ *
* Scheduler r e s u m e f u n c t i o n , c a l l e d b y s w i t c h _ t o
* gpr2 = ( t a s k _ s t r u c t * ) p r e v
* gpr3 = ( t a s k _ s t r u c t * ) n e x t
* Returns :
* gpr2 = p r e v
* /
2011-07-24 12:48:19 +04:00
ENTRY( _ _ s w i t c h _ t o )
2012-05-15 11:20:06 +04:00
stm % r6 ,% r15 ,_ _ S F _ G P R S ( % r15 ) # s t o r e g p r s o f p r e v t a s k
st % r15 ,_ _ T H R E A D _ k s p ( % r2 ) # s t o r e k e r n e l s t a c k o f p r e v
2011-12-27 14:27:15 +04:00
l % r4 ,_ _ T H R E A D _ i n f o ( % r2 ) # g e t t h r e a d _ i n f o o f p r e v
2011-01-05 14:48:10 +03:00
l % r5 ,_ _ T H R E A D _ i n f o ( % r3 ) # g e t t h r e a d _ i n f o o f n e x t
2012-05-15 11:20:06 +04:00
lr % r15 ,% r5
2013-04-24 12:20:43 +04:00
ahi % r15 ,S T A C K _ I N I T # e n d o f k e r n e l s t a c k o f n e x t
2012-05-15 11:20:06 +04:00
st % r3 ,_ _ L C _ C U R R E N T # s t o r e t a s k s t r u c t o f n e x t
st % r5 ,_ _ L C _ T H R E A D _ I N F O # s t o r e t h r e a d i n f o o f n e x t
st % r15 ,_ _ L C _ K E R N E L _ S T A C K # s t o r e e n d o f k e r n e l s t a c k
lctl % c4 ,% c4 ,_ _ T A S K _ p i d ( % r3 ) # l o a d p i d t o c o n t r o l r e g . 4
mvc _ _ L C _ C U R R E N T _ P I D ( 4 ,% r0 ) ,_ _ T A S K _ p i d ( % r3 ) # s t o r e p i d o f n e x t
l % r15 ,_ _ T H R E A D _ k s p ( % r3 ) # l o a d k e r n e l s t a c k o f n e x t
2012-09-10 15:00:09 +04:00
lhi % r6 ,_ T I F _ T R A N S F E R # t r a n s f e r T I F b i t s
n % r6 ,_ _ T I _ f l a g s ( % r4 ) # i s o l a t e T I F b i t s
2011-12-27 14:27:15 +04:00
jz 0 f
2012-09-10 15:00:09 +04:00
o % r6 ,_ _ T I _ f l a g s ( % r5 ) # s e t T I F b i t s o f n e x t
st % r6 ,_ _ T I _ f l a g s ( % r5 )
ni _ _ T I _ f l a g s + 3 ( % r4 ) ,2 5 5 - _ T I F _ T R A N S F E R # c l e a r T I F b i t s o f p r e v
2012-05-15 11:20:06 +04:00
0 : lm % r6 ,% r15 ,_ _ S F _ G P R S ( % r15 ) # l o a d g p r s o f n e x t t a s k
2005-04-17 02:20:36 +04:00
br % r14
__critical_start :
/ *
* SVC i n t e r r u p t h a n d l e r r o u t i n e . S y s t e m c a l l s a r e s y n c h r o n o u s e v e n t s a n d
* are e x e c u t e d w i t h i n t e r r u p t s e n a b l e d .
* /
2011-07-24 12:48:19 +04:00
ENTRY( s y s t e m _ c a l l )
2008-12-25 15:39:25 +03:00
stpt _ _ L C _ S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
sysc_stm :
stm % r8 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
l % r12 ,_ _ L C _ T H R E A D _ I N F O
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
sysc_per :
l % r15 ,_ _ L C _ K E R N E L _ S T A C K
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 ) # p o i n t e r t o p t _ r e g s
2005-04-17 02:20:36 +04:00
sysc_vtime :
2011-12-27 14:27:15 +04:00
UPDATE_ V T I M E % r8 ,% r9 ,_ _ L C _ S Y N C _ E N T E R _ T I M E R
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,_ _ L C _ S A V E _ A R E A _ S Y N C
mvc _ _ P T _ P S W ( 8 ,% r11 ) ,_ _ L C _ S V C _ O L D _ P S W
2011-12-27 14:27:18 +04:00
mvc _ _ P T _ I N T _ C O D E ( 4 ,% r11 ) ,_ _ L C _ S V C _ I L C
2005-04-17 02:20:36 +04:00
sysc_do_svc :
2011-12-27 14:27:15 +04:00
oi _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ S Y S C A L L
2013-04-24 14:58:39 +04:00
l % r10 ,_ _ T I _ s y s c _ t a b l e ( % r12 ) # 31 b i t s y s t e m c a l l t a b l e
2011-12-27 14:27:18 +04:00
lh % r8 ,_ _ P T _ I N T _ C O D E + 2 ( % r11 )
2011-12-27 14:27:15 +04:00
sla % r8 ,2 # s h i f t a n d t e s t f o r s v c 0
jnz s y s c _ n r _ o k
2005-04-17 02:20:36 +04:00
# svc 0 : system c a l l n u m b e r i n % r1
cl % r1 ,B A S E D ( . L n r _ s y s c a l l s )
2011-12-27 14:27:15 +04:00
jnl s y s c _ n r _ o k
2011-12-27 14:27:18 +04:00
sth % r1 ,_ _ P T _ I N T _ C O D E + 2 ( % r11 )
2011-12-27 14:27:15 +04:00
lr % r8 ,% r1
sla % r8 ,2
2005-04-17 02:20:36 +04:00
sysc_nr_ok :
2011-12-27 14:27:15 +04:00
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
st % r2 ,_ _ P T _ O R I G _ G P R 2 ( % r11 )
st % r7 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
l % r9 ,0 ( % r8 ,% r10 ) # g e t s y s t e m c a l l a d d r .
2011-10-30 18:16:49 +04:00
tm _ _ T I _ f l a g s + 2 ( % r12 ) ,_ T I F _ T R A C E > > 8
2011-12-27 14:27:15 +04:00
jnz s y s c _ t r a c e s y s
basr % r14 ,% r9 # c a l l s y s _ x x x x
st % r2 ,_ _ P T _ R 2 ( % r11 ) # s t o r e r e t u r n v a l u e
2005-04-17 02:20:36 +04:00
sysc_return :
2010-05-17 12:00:02 +04:00
LOCKDEP_ S Y S _ E X I T
sysc_tif :
2011-12-27 14:27:15 +04:00
tm _ _ P T _ P S W + 1 ( % r11 ) ,0 x01 # r e t u r n i n g t o u s e r ?
jno s y s c _ r e s t o r e
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ W O R K _ S V C
2011-12-27 14:27:15 +04:00
jnz s y s c _ w o r k # c h e c k f o r w o r k
2011-10-30 18:16:49 +04:00
ni _ _ T I _ f l a g s + 3 ( % r12 ) ,2 5 5 - _ T I F _ S Y S C A L L
2007-11-20 13:13:32 +03:00
sysc_restore :
2011-12-27 14:27:15 +04:00
mvc _ _ L C _ R E T U R N _ P S W ( 8 ) ,_ _ P T _ P S W ( % r11 )
stpt _ _ L C _ E X I T _ T I M E R
lm % r0 ,% r15 ,_ _ P T _ R 0 ( % r11 )
lpsw _ _ L C _ R E T U R N _ P S W
2007-11-20 13:13:32 +03:00
sysc_done :
2010-05-17 12:00:01 +04:00
#
# One o f t h e w o r k b i t s i s o n . F i n d o u t w h i c h o n e .
#
2011-10-30 18:16:49 +04:00
sysc_work :
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ M C C K _ P E N D I N G
2011-12-27 14:27:15 +04:00
jo s y s c _ m c c k _ p e n d i n g
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ N E E D _ R E S C H E D
2011-12-27 14:27:15 +04:00
jo s y s c _ r e s c h e d u l e
2012-11-21 19:36:27 +04:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ P E R _ T R A P
jo s y s c _ s i n g l e s t e p
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ S I G P E N D I N G
2011-12-27 14:27:15 +04:00
jo s y s c _ s i g p e n d i n g
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ N O T I F Y _ R E S U M E
2011-12-27 14:27:15 +04:00
jo s y s c _ n o t i f y _ r e s u m e
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ A S C E
jo s y s c _ u a c c e s s
2011-12-27 14:27:15 +04:00
j s y s c _ r e t u r n # b e w a r e o f c r i t i c a l s e c t i o n c l e a n u p
2005-04-17 02:20:36 +04:00
#
# _ TIF_ N E E D _ R E S C H E D i s s e t , c a l l s c h e d u l e
2006-09-28 18:56:37 +04:00
#
sysc_reschedule :
l % r1 ,B A S E D ( . L s c h e d u l e )
2010-05-17 12:00:02 +04:00
la % r14 ,B A S E D ( s y s c _ r e t u r n )
2011-12-27 14:27:15 +04:00
br % r1 # c a l l s c h e d u l e
2005-04-17 02:20:36 +04:00
2005-06-26 01:55:30 +04:00
#
# _ TIF_ M C C K _ P E N D I N G i s s e t , c a l l h a n d l e r
#
sysc_mcck_pending :
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L h a n d l e _ m c c k )
2010-05-17 12:00:02 +04:00
la % r14 ,B A S E D ( s y s c _ r e t u r n )
2005-06-26 01:55:30 +04:00
br % r1 # T I F b i t w i l l b e c l e a r e d b y h a n d l e r
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
#
# _ TIF_ A S C E i s s e t , l o a d u s e r s p a c e a s c e
#
sysc_uaccess :
ni _ _ T I _ f l a g s + 3 ( % r12 ) ,2 5 5 - _ T I F _ A S C E
lctl % c1 ,% c1 ,_ _ L C _ U S E R _ A S C E # l o a d p r i m a r y a s c e
j s y s c _ r e t u r n
2005-04-17 02:20:36 +04:00
#
2008-04-30 11:53:08 +04:00
# _ TIF_ S I G P E N D I N G i s s e t , c a l l d o _ s i g n a l
2005-04-17 02:20:36 +04:00
#
2006-09-28 18:56:37 +04:00
sysc_sigpending :
2011-12-27 14:27:15 +04:00
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2006-09-28 18:56:37 +04:00
l % r1 ,B A S E D ( . L d o _ s i g n a l )
basr % r14 ,% r1 # c a l l d o _ s i g n a l
2011-10-30 18:16:49 +04:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ S Y S C A L L
2011-12-27 14:27:15 +04:00
jno s y s c _ r e t u r n
lm % r2 ,% r7 ,_ _ P T _ R 2 ( % r11 ) # l o a d s v c a r g u m e n t s
2013-09-27 17:24:38 +04:00
l % r10 ,_ _ T I _ s y s c _ t a b l e ( % r12 ) # 31 b i t s y s t e m c a l l t a b l e
2011-12-27 14:27:15 +04:00
xr % r8 ,% r8 # s v c 0 r e t u r n s - E N O S Y S
2011-12-27 14:27:18 +04:00
clc _ _ P T _ I N T _ C O D E + 2 ( 2 ,% r11 ) ,B A S E D ( . L n r _ s y s c a l l s + 2 )
2011-12-27 14:27:15 +04:00
jnl s y s c _ n r _ o k # i n v a l i d s v c n u m b e r - > d o s v c 0
2011-12-27 14:27:18 +04:00
lh % r8 ,_ _ P T _ I N T _ C O D E + 2 ( % r11 ) # l o a d n e w s v c n u m b e r
2011-12-27 14:27:15 +04:00
sla % r8 ,2
j s y s c _ n r _ o k # r e s t a r t s v c
2005-04-17 02:20:36 +04:00
2008-10-10 23:33:20 +04:00
#
# _ TIF_ N O T I F Y _ R E S U M E i s s e t , c a l l d o _ n o t i f y _ r e s u m e
#
sysc_notify_resume :
2011-12-27 14:27:15 +04:00
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2008-10-10 23:33:20 +04:00
l % r1 ,B A S E D ( . L d o _ n o t i f y _ r e s u m e )
2010-05-17 12:00:02 +04:00
la % r14 ,B A S E D ( s y s c _ r e t u r n )
2008-10-10 23:33:20 +04:00
br % r1 # c a l l d o _ n o t i f y _ r e s u m e
2005-04-17 02:20:36 +04:00
#
2011-01-05 14:48:10 +03:00
# _ TIF_ P E R _ T R A P i s s e t , c a l l d o _ p e r _ t r a p
2005-04-17 02:20:36 +04:00
#
sysc_singlestep :
2012-11-21 19:36:27 +04:00
ni _ _ T I _ f l a g s + 3 ( % r12 ) ,2 5 5 - _ T I F _ P E R _ T R A P
2011-12-27 14:27:15 +04:00
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
l % r1 ,B A S E D ( . L d o _ p e r _ t r a p )
la % r14 ,B A S E D ( s y s c _ r e t u r n )
br % r1 # c a l l d o _ p e r _ t r a p
2005-04-17 02:20:36 +04:00
#
2008-10-10 23:33:20 +04:00
# call t r a c e h o o k _ r e p o r t _ s y s c a l l _ e n t r y / t r a c e h o o k _ r e p o r t _ s y s c a l l _ e x i t b e f o r e
# and a f t e r t h e s y s t e m c a l l
2005-04-17 02:20:36 +04:00
#
sysc_tracesys :
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L t r a c e _ e n t e r )
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2005-04-17 02:20:36 +04:00
la % r3 ,0
2011-01-05 14:47:57 +03:00
xr % r0 ,% r0
2011-12-27 14:27:18 +04:00
icm % r0 ,3 ,_ _ P T _ I N T _ C O D E + 2 ( % r11 )
2011-12-27 14:27:15 +04:00
st % r0 ,_ _ P T _ R 2 ( % r11 )
basr % r14 ,% r1 # c a l l d o _ s y s c a l l _ t r a c e _ e n t e r
2008-10-10 23:33:20 +04:00
cl % r2 ,B A S E D ( . L n r _ s y s c a l l s )
2011-12-27 14:27:15 +04:00
jnl s y s c _ t r a c e n o g o
lr % r8 ,% r2
sll % r8 ,2
l % r9 ,0 ( % r8 ,% r10 )
2005-04-17 02:20:36 +04:00
sysc_tracego :
2011-12-27 14:27:15 +04:00
lm % r3 ,% r7 ,_ _ P T _ R 3 ( % r11 )
st % r7 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
l % r2 ,_ _ P T _ O R I G _ G P R 2 ( % r11 )
basr % r14 ,% r9 # c a l l s y s _ x x x
st % r2 ,_ _ P T _ R 2 ( % r11 ) # s t o r e r e t u r n v a l u e
2005-04-17 02:20:36 +04:00
sysc_tracenogo :
2011-10-30 18:16:49 +04:00
tm _ _ T I _ f l a g s + 2 ( % r12 ) ,_ T I F _ T R A C E > > 8
2011-12-27 14:27:15 +04:00
jz s y s c _ r e t u r n
2008-10-10 23:33:20 +04:00
l % r1 ,B A S E D ( . L t r a c e _ e x i t )
2011-12-27 14:27:15 +04:00
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2005-04-17 02:20:36 +04:00
la % r14 ,B A S E D ( s y s c _ r e t u r n )
2011-12-27 14:27:15 +04:00
br % r1 # c a l l d o _ s y s c a l l _ t r a c e _ e x i t
2005-04-17 02:20:36 +04:00
#
# a n e w p r o c e s s e x i t s t h e k e r n e l w i t h r e t _ f r o m _ f o r k
#
2011-07-24 12:48:19 +04:00
ENTRY( r e t _ f r o m _ f o r k )
2011-12-27 14:27:15 +04:00
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
l % r12 ,_ _ L C _ T H R E A D _ I N F O
2005-04-17 02:20:36 +04:00
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
2012-09-11 02:03:41 +04:00
l % r1 ,B A S E D ( . L s c h e d u l e _ t a i l )
basr % r14 ,% r1 # c a l l s c h e d u l e _ t a i l
TRACE_ I R Q S _ O N
ssm _ _ L C _ S V C _ N E W _ P S W # r e e n a b l e i n t e r r u p t s
2012-10-11 23:30:14 +04:00
tm _ _ P T _ P S W + 1 ( % r11 ) ,0 x01 # f o r k i n g a k e r n e l t h r e a d ?
jne s y s c _ t r a c e n o g o
# it' s a k e r n e l t h r e a d
lm % r9 ,% r10 ,_ _ P T _ R 9 ( % r11 ) # l o a d g p r s
2012-09-11 02:03:41 +04:00
ENTRY( k e r n e l _ t h r e a d _ s t a r t e r )
la % r2 ,0 ( % r10 )
basr % r14 ,% r9
2012-10-11 23:30:14 +04:00
j s y s c _ t r a c e n o g o
2005-04-17 02:20:36 +04:00
/ *
* Program c h e c k h a n d l e r r o u t i n e
* /
2011-07-24 12:48:19 +04:00
ENTRY( p g m _ c h e c k _ h a n d l e r )
2008-12-25 15:39:25 +03:00
stpt _ _ L C _ S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
stm % r8 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
l % r12 ,_ _ L C _ T H R E A D _ I N F O
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
lm % r8 ,% r9 ,_ _ L C _ P G M _ O L D _ P S W
tmh % r8 ,0 x00 0 1 # t e s t p r o b l e m s t a t e b i t
jnz 1 f # - > f a u l t i n u s e r s p a c e
tmh % r8 ,0 x40 0 0 # P E R b i t s e t i n o l d P S W ?
jnz 0 f # - > e n a b l e d , c a n ' t b e a d o u b l e f a u l t
tm _ _ L C _ P G M _ I L C + 3 ,0 x80 # c h e c k f o r p e r e x c e p t i o n
jnz p g m _ s v c p e r # - > s i n g l e s t e p p e d s v c
0 : CHECK_ S T A C K S T A C K _ S I Z E ,_ _ L C _ S A V E _ A R E A _ S Y N C
2013-04-24 12:20:43 +04:00
ahi % r15 ,- ( S T A C K _ F R A M E _ O V E R H E A D + _ _ P T _ S I Z E )
2011-12-27 14:27:15 +04:00
j 2 f
1 : UPDATE_ V T I M E % r14 ,% r15 ,_ _ L C _ S Y N C _ E N T E R _ T I M E R
l % r15 ,_ _ L C _ K E R N E L _ S T A C K
2013-04-24 12:20:43 +04:00
2 : la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
2011-12-27 14:27:15 +04:00
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,_ _ L C _ S A V E _ A R E A _ S Y N C
stm % r8 ,% r9 ,_ _ P T _ P S W ( % r11 )
2011-12-27 14:27:18 +04:00
mvc _ _ P T _ I N T _ C O D E ( 4 ,% r11 ) ,_ _ L C _ P G M _ I L C
mvc _ _ P T _ I N T _ P A R M _ L O N G ( 4 ,% r11 ) ,_ _ L C _ T R A N S _ E X C _ C O D E
2011-12-27 14:27:15 +04:00
tm _ _ L C _ P G M _ I L C + 3 ,0 x80 # c h e c k f o r p e r e x c e p t i o n
jz 0 f
2011-01-05 14:47:57 +03:00
l % r1 ,_ _ T I _ t a s k ( % r12 )
2011-12-27 14:27:15 +04:00
tmh % r8 ,0 x00 0 1 # k e r n e l p e r e v e n t ?
jz p g m _ k p r o b e
oi _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ P E R _ T R A P
2011-01-05 14:48:10 +03:00
mvc _ _ T H R E A D _ p e r _ a d d r e s s ( 4 ,% r1 ) ,_ _ L C _ P E R _ A D D R E S S
2011-12-27 14:27:15 +04:00
mvc _ _ T H R E A D _ p e r _ c a u s e ( 2 ,% r1 ) ,_ _ L C _ P E R _ C A U S E
2011-01-05 14:48:10 +03:00
mvc _ _ T H R E A D _ p e r _ p a i d ( 1 ,% r1 ) ,_ _ L C _ P E R _ P A I D
2011-12-27 14:27:18 +04:00
0 : REENABLE_ I R Q S
2011-12-27 14:27:15 +04:00
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
2011-01-05 14:47:57 +03:00
l % r1 ,B A S E D ( . L j u m p _ t a b l e )
2011-12-27 14:27:15 +04:00
la % r10 ,0 x7 f
2011-12-27 14:27:18 +04:00
n % r10 ,_ _ P T _ I N T _ C O D E ( % r11 )
2011-12-27 14:27:15 +04:00
je s y s c _ r e t u r n
sll % r10 ,2
l % r1 ,0 ( % r10 ,% r1 ) # l o a d a d d r e s s o f h a n d l e r r o u t i n e
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2011-01-05 14:47:57 +03:00
basr % r14 ,% r1 # b r a n c h t o i n t e r r u p t - h a n d l e r
2011-12-27 14:27:15 +04:00
j s y s c _ r e t u r n
2005-04-17 02:20:36 +04:00
#
2011-12-27 14:27:15 +04:00
# PER e v e n t i n s u p e r v i s o r s t a t e , m u s t b e k p r o b e s
2005-04-17 02:20:36 +04:00
#
2011-12-27 14:27:15 +04:00
pgm_kprobe :
REENABLE_ I R Q S
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
l % r1 ,B A S E D ( . L d o _ p e r _ t r a p )
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
basr % r14 ,% r1 # c a l l d o _ p e r _ t r a p
j s y s c _ r e t u r n
2005-04-17 02:20:36 +04:00
2006-09-20 17:58:39 +04:00
#
2011-12-27 14:27:15 +04:00
# single s t e p p e d s y s t e m c a l l
2006-09-20 17:58:39 +04:00
#
2011-12-27 14:27:15 +04:00
pgm_svcper :
oi _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ P E R _ T R A P
mvc _ _ L C _ R E T U R N _ P S W ( 4 ) ,_ _ L C _ S V C _ N E W _ P S W
mvc _ _ L C _ R E T U R N _ P S W + 4 ( 4 ) ,B A S E D ( . L s y s c _ p e r )
lpsw _ _ L C _ R E T U R N _ P S W # b r a n c h t o s y s c _ p e r a n d e n a b l e i r q s
2006-09-20 17:58:39 +04:00
2005-04-17 02:20:36 +04:00
/ *
* IO i n t e r r u p t h a n d l e r r o u t i n e
* /
2011-07-24 12:48:19 +04:00
ENTRY( i o _ i n t _ h a n d l e r )
2005-04-17 02:20:36 +04:00
stck _ _ L C _ I N T _ C L O C K
2008-12-31 17:11:41 +03:00
stpt _ _ L C _ A S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
stm % r8 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
l % r12 ,_ _ L C _ T H R E A D _ I N F O
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
lm % r8 ,% r9 ,_ _ L C _ I O _ O L D _ P S W
tmh % r8 ,0 x00 0 1 # i n t e r r u p t i n g f r o m u s e r ?
jz i o _ s k i p
UPDATE_ V T I M E % r14 ,% r15 ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
io_skip :
SWITCH_ A S Y N C _ _ L C _ S A V E _ A R E A _ A S Y N C ,_ _ L C _ A S Y N C _ S T A C K ,S T A C K _ S H I F T
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,_ _ L C _ S A V E _ A R E A _ A S Y N C
stm % r8 ,% r9 ,_ _ P T _ P S W ( % r11 )
2013-06-17 16:54:02 +04:00
mvc _ _ P T _ I N T _ C O D E ( 1 2 ,% r11 ) ,_ _ L C _ S U B C H A N N E L _ I D
2006-07-03 11:24:46 +04:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
2013-06-17 16:54:02 +04:00
io_loop :
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L d o _ I R Q )
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2013-06-27 11:01:09 +04:00
lhi % r3 ,I O _ I N T E R R U P T
tm _ _ P T _ I N T _ C O D E + 8 ( % r11 ) ,0 x80 # a d a p t e r i n t e r r u p t ?
jz i o _ c a l l
lhi % r3 ,T H I N _ I N T E R R U P T
io_call :
2011-12-27 14:27:15 +04:00
basr % r14 ,% r1 # c a l l d o _ I R Q
2013-06-17 16:54:02 +04:00
tm _ _ L C _ M A C H I N E _ F L A G S + 2 ,0 x10 # M A C H I N E _ F L A G _ L P A R
jz i o _ r e t u r n
tpi 0
jz i o _ r e t u r n
mvc _ _ P T _ I N T _ C O D E ( 1 2 ,% r11 ) ,_ _ L C _ S U B C H A N N E L _ I D
j i o _ l o o p
2005-04-17 02:20:36 +04:00
io_return :
2010-05-17 12:00:02 +04:00
LOCKDEP_ S Y S _ E X I T
TRACE_ I R Q S _ O N
io_tif :
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ W O R K _ I N T
2011-12-27 14:27:15 +04:00
jnz i o _ w o r k # t h e r e i s w o r k t o d o ( s i g n a l s e t c . )
2007-11-20 13:13:32 +03:00
io_restore :
2011-12-27 14:27:15 +04:00
mvc _ _ L C _ R E T U R N _ P S W ( 8 ) ,_ _ P T _ P S W ( % r11 )
stpt _ _ L C _ E X I T _ T I M E R
lm % r0 ,% r15 ,_ _ P T _ R 0 ( % r11 )
lpsw _ _ L C _ R E T U R N _ P S W
2005-09-04 02:57:56 +04:00
io_done :
2005-04-17 02:20:36 +04:00
2008-05-07 11:22:52 +04:00
#
2010-05-17 12:00:01 +04:00
# There i s w o r k t o d o , f i n d o u t i n w h i c h c o n t e x t w e h a v e b e e n i n t e r r u p t e d :
# 1 ) if w e r e t u r n t o u s e r s p a c e w e c a n d o a l l _ T I F _ W O R K _ I N T w o r k
# 2 ) if w e r e t u r n t o k e r n e l c o d e a n d p r e e m p t i v e s c h e d u l i n g i s e n a b l e d c h e c k
# the p r e e m p t i o n c o u n t e r a n d i f i t i s z e r o c a l l p r e e m p t _ s c h e d u l e _ i r q
# Before a n y w o r k c a n b e d o n e , a s w i t c h t o t h e k e r n e l s t a c k i s r e q u i r e d .
2008-05-07 11:22:52 +04:00
#
io_work :
2011-12-27 14:27:15 +04:00
tm _ _ P T _ P S W + 1 ( % r11 ) ,0 x01 # r e t u r n i n g t o u s e r ?
jo i o _ w o r k _ u s e r # y e s - > d o r e s c h e d & s i g n a l
2010-05-17 12:00:01 +04:00
# ifdef C O N F I G _ P R E E M P T
2008-05-07 11:22:52 +04:00
# check f o r p r e e m p t i v e s c h e d u l i n g
2011-01-05 14:47:57 +03:00
icm % r0 ,1 5 ,_ _ T I _ p r e c o u n t ( % r12 )
2011-12-27 14:27:15 +04:00
jnz i o _ r e s t o r e # p r e e m p t i o n d i s a b l e d
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ N E E D _ R E S C H E D
2011-12-27 14:27:15 +04:00
jno i o _ r e s t o r e
2010-05-17 12:00:01 +04:00
# switch t o k e r n e l s t a c k
2011-12-27 14:27:15 +04:00
l % r1 ,_ _ P T _ R 1 5 ( % r11 )
ahi % r1 ,- ( S T A C K _ F R A M E _ O V E R H E A D + _ _ P T _ S I Z E )
mvc S T A C K _ F R A M E _ O V E R H E A D ( _ _ P T _ S I Z E ,% r1 ) ,0 ( % r11 )
xc _ _ S F _ B A C K C H A I N ( 4 ,% r1 ) ,_ _ S F _ B A C K C H A I N ( % r1 )
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r1 )
2005-04-17 02:20:36 +04:00
lr % r15 ,% r1
2010-05-17 12:00:02 +04:00
# TRACE_ I R Q S _ O N a l r e a d y d o n e a t i o _ r e t u r n , c a l l
# TRACE_ I R Q S _ O F F t o k e e p t h i n g s s y m m e t r i c a l
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L p r e e m p t _ i r q )
2010-05-17 12:00:02 +04:00
basr % r14 ,% r1 # c a l l p r e e m p t _ s c h e d u l e _ i r q
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2010-05-17 12:00:02 +04:00
# else
2011-12-27 14:27:15 +04:00
j i o _ r e s t o r e
2010-05-17 12:00:02 +04:00
# endif
2005-04-17 02:20:36 +04:00
2010-05-17 12:00:01 +04:00
#
# Need t o d o w o r k b e f o r e r e t u r n i n g t o u s e r s p a c e , s w i t c h t o k e r n e l s t a c k
#
2008-05-07 11:22:52 +04:00
io_work_user :
2005-04-17 02:20:36 +04:00
l % r1 ,_ _ L C _ K E R N E L _ S T A C K
2011-12-27 14:27:15 +04:00
mvc S T A C K _ F R A M E _ O V E R H E A D ( _ _ P T _ S I Z E ,% r1 ) ,0 ( % r11 )
xc _ _ S F _ B A C K C H A I N ( 4 ,% r1 ) ,_ _ S F _ B A C K C H A I N ( % r1 )
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r1 )
2005-04-17 02:20:36 +04:00
lr % r15 ,% r1
2010-05-17 12:00:02 +04:00
2005-04-17 02:20:36 +04:00
#
# One o f t h e w o r k b i t s i s o n . F i n d o u t w h i c h o n e .
2010-05-17 12:00:01 +04:00
# Checked a r e : _ T I F _ S I G P E N D I N G , _ T I F _ N O T I F Y _ R E S U M E , _ T I F _ N E E D _ R E S C H E D
2006-09-28 18:56:37 +04:00
# and _ T I F _ M C C K _ P E N D I N G
2005-04-17 02:20:36 +04:00
#
2010-05-17 12:00:02 +04:00
io_work_tif :
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ M C C K _ P E N D I N G
2011-12-27 14:27:15 +04:00
jo i o _ m c c k _ p e n d i n g
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ N E E D _ R E S C H E D
2011-12-27 14:27:15 +04:00
jo i o _ r e s c h e d u l e
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ S I G P E N D I N G
2011-12-27 14:27:15 +04:00
jo i o _ s i g p e n d i n g
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ N O T I F Y _ R E S U M E
2011-12-27 14:27:15 +04:00
jo i o _ n o t i f y _ r e s u m e
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ A S C E
jo i o _ u a c c e s s
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n # b e w a r e o f c r i t i c a l s e c t i o n c l e a n u p
2005-04-17 02:20:36 +04:00
2005-06-26 01:55:30 +04:00
#
# _ TIF_ M C C K _ P E N D I N G i s s e t , c a l l h a n d l e r
#
io_mcck_pending :
2010-05-17 12:00:02 +04:00
# TRACE_ I R Q S _ O N a l r e a d y d o n e a t i o _ r e t u r n
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L h a n d l e _ m c c k )
2007-07-27 14:29:18 +04:00
basr % r14 ,% r1 # T I F b i t w i l l b e c l e a r e d b y h a n d l e r
2010-05-17 12:00:02 +04:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2005-06-26 01:55:30 +04:00
s390/uaccess: rework uaccess code - fix locking issues
The current uaccess code uses a page table walk in some circumstances,
e.g. in case of the in atomic futex operations or if running on old
hardware which doesn't support the mvcos instruction.
However it turned out that the page table walk code does not correctly
lock page tables when accessing page table entries.
In other words: a different cpu may invalidate a page table entry while
the current cpu inspects the pte. This may lead to random data corruption.
Adding correct locking however isn't trivial for all uaccess operations.
Especially copy_in_user() is problematic since that requires to hold at
least two locks, but must be protected against ABBA deadlock when a
different cpu also performs a copy_in_user() operation.
So the solution is a different approach where we change address spaces:
User space runs in primary address mode, or access register mode within
vdso code, like it currently already does.
The kernel usually also runs in home space mode, however when accessing
user space the kernel switches to primary or secondary address mode if
the mvcos instruction is not available or if a compare-and-swap (futex)
instruction on a user space address is performed.
KVM however is special, since that requires the kernel to run in home
address space while implicitly accessing user space with the sie
instruction.
So we end up with:
User space:
- runs in primary or access register mode
- cr1 contains the user asce
- cr7 contains the user asce
- cr13 contains the kernel asce
Kernel space:
- runs in home space mode
- cr1 contains the user or kernel asce
-> the kernel asce is loaded when a uaccess requires primary or
secondary address mode
- cr7 contains the user or kernel asce, (changed with set_fs())
- cr13 contains the kernel asce
In case of uaccess the kernel changes to:
- primary space mode in case of a uaccess (copy_to_user) and uses
e.g. the mvcp instruction to access user space. However the kernel
will stay in home space mode if the mvcos instruction is available
- secondary space mode in case of futex atomic operations, so that the
instructions come from primary address space and data from secondary
space
In case of kvm the kernel runs in home space mode, but cr1 gets switched
to contain the gmap asce before the sie instruction gets executed. When
the sie instruction is finished cr1 will be switched back to contain the
user asce.
A context switch between two processes will always load the kernel asce
for the next process in cr1. So the first exit to user space is a bit
more expensive (one extra load control register instruction) than before,
however keeps the code rather simple.
In sum this means there is no need to perform any error prone page table
walks anymore when accessing user space.
The patch seems to be rather large, however it mainly removes the
the page table walk code and restores the previously deleted "standard"
uaccess code, with a couple of changes.
The uaccess without mvcos mode can be enforced with the "uaccess_primary"
kernel parameter.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-03-21 13:42:25 +04:00
#
# _ TIF_ A S C E i s s e t , l o a d u s e r s p a c e a s c e
#
io_uaccess :
ni _ _ T I _ f l a g s + 3 ( % r12 ) ,2 5 5 - _ T I F _ A S C E
lctl % c1 ,% c1 ,_ _ L C _ U S E R _ A S C E # l o a d p r i m a r y a s c e
j i o _ r e t u r n
2005-04-17 02:20:36 +04:00
#
# _ TIF_ N E E D _ R E S C H E D i s s e t , c a l l s c h e d u l e
2006-09-28 18:56:37 +04:00
#
io_reschedule :
2010-05-17 12:00:02 +04:00
# TRACE_ I R Q S _ O N a l r e a d y d o n e a t i o _ r e t u r n
2006-09-28 18:56:37 +04:00
l % r1 ,B A S E D ( . L s c h e d u l e )
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ S V C _ N E W _ P S W # r e e n a b l e i n t e r r u p t s
2006-09-28 18:56:37 +04:00
basr % r14 ,% r1 # c a l l s c h e d u l e r
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ P G M _ N E W _ P S W # d i s a b l e I / O a n d e x t . i n t e r r u p t s
2007-11-20 13:13:32 +03:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2005-04-17 02:20:36 +04:00
#
2008-04-30 11:53:08 +04:00
# _ TIF_ S I G P E N D I N G i s s e t , c a l l d o _ s i g n a l
2005-04-17 02:20:36 +04:00
#
2006-09-28 18:56:37 +04:00
io_sigpending :
2010-05-17 12:00:02 +04:00
# TRACE_ I R Q S _ O N a l r e a d y d o n e a t i o _ r e t u r n
2006-09-28 18:56:37 +04:00
l % r1 ,B A S E D ( . L d o _ s i g n a l )
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ S V C _ N E W _ P S W # r e e n a b l e i n t e r r u p t s
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2006-09-28 18:56:37 +04:00
basr % r14 ,% r1 # c a l l d o _ s i g n a l
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ P G M _ N E W _ P S W # d i s a b l e I / O a n d e x t . i n t e r r u p t s
2007-11-20 13:13:32 +03:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2005-04-17 02:20:36 +04:00
2008-10-10 23:33:20 +04:00
#
# _ TIF_ S I G P E N D I N G i s s e t , c a l l d o _ s i g n a l
#
io_notify_resume :
2010-05-17 12:00:02 +04:00
# TRACE_ I R Q S _ O N a l r e a d y d o n e a t i o _ r e t u r n
2008-10-10 23:33:20 +04:00
l % r1 ,B A S E D ( . L d o _ n o t i f y _ r e s u m e )
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ S V C _ N E W _ P S W # r e e n a b l e i n t e r r u p t s
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
basr % r14 ,% r1 # c a l l d o _ n o t i f y _ r e s u m e
ssm _ _ L C _ P G M _ N E W _ P S W # d i s a b l e I / O a n d e x t . i n t e r r u p t s
2008-10-10 23:33:20 +04:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2008-10-10 23:33:20 +04:00
2005-04-17 02:20:36 +04:00
/ *
* External i n t e r r u p t h a n d l e r r o u t i n e
* /
2011-07-24 12:48:19 +04:00
ENTRY( e x t _ i n t _ h a n d l e r )
2005-04-17 02:20:36 +04:00
stck _ _ L C _ I N T _ C L O C K
2008-12-31 17:11:41 +03:00
stpt _ _ L C _ A S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
stm % r8 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
l % r12 ,_ _ L C _ T H R E A D _ I N F O
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
lm % r8 ,% r9 ,_ _ L C _ E X T _ O L D _ P S W
tmh % r8 ,0 x00 0 1 # i n t e r r u p t i n g f r o m u s e r ?
jz e x t _ s k i p
UPDATE_ V T I M E % r14 ,% r15 ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
ext_skip :
SWITCH_ A S Y N C _ _ L C _ S A V E _ A R E A _ A S Y N C ,_ _ L C _ A S Y N C _ S T A C K ,S T A C K _ S H I F T
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,_ _ L C _ S A V E _ A R E A _ A S Y N C
stm % r8 ,% r9 ,_ _ P T _ P S W ( % r11 )
2013-06-17 16:54:02 +04:00
mvc _ _ P T _ I N T _ C O D E ( 4 ,% r11 ) ,_ _ L C _ E X T _ C P U _ A D D R
mvc _ _ P T _ I N T _ P A R M ( 4 ,% r11 ) ,_ _ L C _ E X T _ P A R A M S
2006-07-03 11:24:46 +04:00
TRACE_ I R Q S _ O F F
2013-06-27 11:01:09 +04:00
l % r1 ,B A S E D ( . L d o _ I R Q )
2011-12-27 14:27:15 +04:00
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
2013-06-27 11:01:09 +04:00
lhi % r3 ,E X T _ I N T E R R U P T
basr % r14 ,% r1 # c a l l d o _ I R Q
2011-12-27 14:27:15 +04:00
j i o _ r e t u r n
2005-04-17 02:20:36 +04:00
2012-03-11 19:59:27 +04:00
/ *
* Load i d l e P S W . T h e s e c o n d " h a l f " o f t h i s f u n c t i o n i s i n c l e a n u p _ i d l e .
* /
ENTRY( p s w _ i d l e )
2012-07-20 13:15:08 +04:00
st % r3 ,_ _ S F _ E M P T Y ( % r15 )
2012-03-11 19:59:27 +04:00
basr % r1 ,0
la % r1 ,p s w _ i d l e _ l p s w + 4 - . ( % r1 )
st % r1 ,_ _ S F _ E M P T Y + 4 ( % r15 )
oi _ _ S F _ E M P T Y + 4 ( % r15 ) ,0 x80
2012-07-20 13:15:08 +04:00
stck _ _ C L O C K _ I D L E _ E N T E R ( % r2 )
stpt _ _ T I M E R _ I D L E _ E N T E R ( % r2 )
2012-03-11 19:59:27 +04:00
psw_idle_lpsw :
lpsw _ _ S F _ E M P T Y ( % r15 )
br % r14
psw_idle_end :
2005-09-04 02:57:56 +04:00
__critical_end :
2005-04-17 02:20:36 +04:00
/ *
* Machine c h e c k h a n d l e r r o u t i n e s
* /
2011-07-24 12:48:19 +04:00
ENTRY( m c c k _ i n t _ h a n d l e r )
2010-05-17 12:00:03 +04:00
stck _ _ L C _ M C C K _ C L O C K
2005-06-26 01:55:30 +04:00
spt _ _ L C _ C P U _ T I M E R _ S A V E _ A R E A # r e v a l i d a t e c p u t i m e r
lm % r0 ,% r15 ,_ _ L C _ G P R E G S _ S A V E _ A R E A # r e v a l i d a t e g p r s
2011-12-27 14:27:15 +04:00
l % r12 ,_ _ L C _ T H R E A D _ I N F O
l % r13 ,_ _ L C _ S V C _ N E W _ P S W + 4
lm % r8 ,% r9 ,_ _ L C _ M C K _ O L D _ P S W
2006-09-28 18:56:37 +04:00
tm _ _ L C _ M C C K _ C O D E ,0 x80 # s y s t e m d a m a g e ?
2011-12-27 14:27:15 +04:00
jo m c c k _ p a n i c # y e s - > r e s t o f m c c k c o d e i n v a l i d
la % r14 ,_ _ L C _ C P U _ T I M E R _ S A V E _ A R E A
mvc _ _ L C _ M C C K _ E N T E R _ T I M E R ( 8 ) ,0 ( % r14 )
2006-06-29 16:58:05 +04:00
tm _ _ L C _ M C C K _ C O D E + 5 ,0 x02 # s t o r e d c p u t i m e r v a l u e v a l i d ?
2011-12-27 14:27:15 +04:00
jo 3 f
2006-06-29 16:58:05 +04:00
la % r14 ,_ _ L C _ S Y N C _ E N T E R _ T I M E R
clc 0 ( 8 ,% r14 ) ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
jl 0 f
2006-06-29 16:58:05 +04:00
la % r14 ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
0 : clc 0 ( 8 ,% r14 ) ,_ _ L C _ E X I T _ T I M E R
2011-12-27 14:27:15 +04:00
jl 1 f
2006-06-29 16:58:05 +04:00
la % r14 ,_ _ L C _ E X I T _ T I M E R
2011-12-27 14:27:15 +04:00
1 : clc 0 ( 8 ,% r14 ) ,_ _ L C _ L A S T _ U P D A T E _ T I M E R
jl 2 f
2006-06-29 16:58:05 +04:00
la % r14 ,_ _ L C _ L A S T _ U P D A T E _ T I M E R
2011-12-27 14:27:15 +04:00
2 : spt 0 ( % r14 )
2010-05-17 12:00:03 +04:00
mvc _ _ L C _ M C C K _ E N T E R _ T I M E R ( 8 ) ,0 ( % r14 )
2011-12-27 14:27:15 +04:00
3 : tm _ _ L C _ M C C K _ C O D E + 2 ,0 x09 # m w p + i a o f o l d p s w v a l i d ?
jno m c c k _ p a n i c # n o - > s k i p c l e a n u p c r i t i c a l
tm % r8 ,0 x00 0 1 # i n t e r r u p t i n g f r o m u s e r ?
jz m c c k _ s k i p
UPDATE_ V T I M E % r14 ,% r15 ,_ _ L C _ M C C K _ E N T E R _ T I M E R
mcck_skip :
SWITCH_ A S Y N C _ _ L C _ G P R E G S _ S A V E _ A R E A + 3 2 ,_ _ L C _ P A N I C _ S T A C K ,P A G E _ S H I F T
2013-02-28 19:28:41 +04:00
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,_ _ L C _ G P R E G S _ S A V E _ A R E A + 3 2
2011-12-27 14:27:15 +04:00
stm % r8 ,% r9 ,_ _ P T _ P S W ( % r11 )
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
l % r1 ,B A S E D ( . L d o _ m a c h i n e _ c h e c k )
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
basr % r14 ,% r1 # c a l l s 390 _ d o _ m a c h i n e _ c h e c k
tm _ _ P T _ P S W + 1 ( % r11 ) ,0 x01 # r e t u r n i n g t o u s e r ?
jno m c c k _ r e t u r n
2006-09-28 18:56:37 +04:00
l % r1 ,_ _ L C _ K E R N E L _ S T A C K # s w i t c h t o k e r n e l s t a c k
2011-12-27 14:27:15 +04:00
mvc S T A C K _ F R A M E _ O V E R H E A D ( _ _ P T _ S I Z E ,% r1 ) ,0 ( % r11 )
xc _ _ S F _ B A C K C H A I N ( 4 ,% r1 ) ,_ _ S F _ B A C K C H A I N ( % r1 )
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
2005-06-26 01:55:30 +04:00
lr % r15 ,% r1
2011-12-27 14:27:15 +04:00
ssm _ _ L C _ P G M _ N E W _ P S W # t u r n d a t o n , k e e p i r q s o f f
2011-01-05 14:47:57 +03:00
tm _ _ T I _ f l a g s + 3 ( % r12 ) ,_ T I F _ M C C K _ P E N D I N G
2011-12-27 14:27:15 +04:00
jno m c c k _ r e t u r n
2006-07-03 11:24:46 +04:00
TRACE_ I R Q S _ O F F
2011-12-27 14:27:15 +04:00
l % r1 ,B A S E D ( . L h a n d l e _ m c c k )
basr % r14 ,% r1 # c a l l s 390 _ h a n d l e _ m c c k
2006-07-03 11:24:46 +04:00
TRACE_ I R Q S _ O N
2005-04-17 02:20:36 +04:00
mcck_return :
2011-12-27 14:27:15 +04:00
mvc _ _ L C _ R E T U R N _ M C C K _ P S W ( 8 ) ,_ _ P T _ P S W ( % r11 ) # m o v e r e t u r n P S W
2006-06-29 16:58:05 +04:00
tm _ _ L C _ R E T U R N _ M C C K _ P S W + 1 ,0 x01 # r e t u r n i n g t o u s e r ?
2011-12-27 14:27:15 +04:00
jno 0 f
lm % r0 ,% r15 ,_ _ P T _ R 0 ( % r11 )
2006-06-29 16:58:05 +04:00
stpt _ _ L C _ E X I T _ T I M E R
2011-12-27 14:27:15 +04:00
lpsw _ _ L C _ R E T U R N _ M C C K _ P S W
0 : lm % r0 ,% r15 ,_ _ P T _ R 0 ( % r11 )
lpsw _ _ L C _ R E T U R N _ M C C K _ P S W
2006-06-29 16:58:05 +04:00
2011-12-27 14:27:15 +04:00
mcck_panic :
l % r14 ,_ _ L C _ P A N I C _ S T A C K
slr % r14 ,% r15
sra % r14 ,P A G E _ S H I F T
jz 0 f
l % r15 ,_ _ L C _ P A N I C _ S T A C K
2013-04-24 12:20:43 +04:00
j m c c k _ s k i p
2011-12-27 14:27:15 +04:00
0 : ahi % r15 ,- ( S T A C K _ F R A M E _ O V E R H E A D + _ _ P T _ S I Z E )
j m c c k _ s k i p
2005-04-17 02:20:36 +04:00
2011-08-03 18:44:19 +04:00
#
# PSW r e s t a r t i n t e r r u p t h a n d l e r
#
2012-03-11 19:59:26 +04:00
ENTRY( r e s t a r t _ i n t _ h a n d l e r )
2011-12-27 14:27:15 +04:00
st % r15 ,_ _ L C _ S A V E _ A R E A _ R E S T A R T
2012-03-11 19:59:26 +04:00
l % r15 ,_ _ L C _ R E S T A R T _ S T A C K
2011-12-27 14:27:15 +04:00
ahi % r15 ,- _ _ P T _ S I Z E # c r e a t e p t _ r e g s o n s t a c k
2012-03-11 19:59:26 +04:00
xc 0 ( _ _ P T _ S I Z E ,% r15 ) ,0 ( % r15 )
2011-12-27 14:27:15 +04:00
stm % r0 ,% r14 ,_ _ P T _ R 0 ( % r15 )
mvc _ _ P T _ R 1 5 ( 4 ,% r15 ) ,_ _ L C _ S A V E _ A R E A _ R E S T A R T
mvc _ _ P T _ P S W ( 8 ,% r15 ) ,_ _ L C _ R S T _ O L D _ P S W # s t o r e r e s t a r t o l d p s w
2012-03-11 19:59:26 +04:00
ahi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D # c r e a t e s t a c k f r a m e o n s t a c k
xc 0 ( S T A C K _ F R A M E _ O V E R H E A D ,% r15 ) ,0 ( % r15 )
2012-06-05 11:59:52 +04:00
l % r1 ,_ _ L C _ R E S T A R T _ F N # l o a d f n , p a r m & s o u r c e c p u
l % r2 ,_ _ L C _ R E S T A R T _ D A T A
l % r3 ,_ _ L C _ R E S T A R T _ S O U R C E
2012-03-11 19:59:26 +04:00
ltr % r3 ,% r3 # t e s t s o u r c e c p u a d d r e s s
jm 1 f # n e g a t i v e - > s k i p s o u r c e s t o p
2012-06-04 17:05:43 +04:00
0 : sigp % r4 ,% r3 ,S I G P _ S E N S E # s i g p s e n s e t o s o u r c e c p u
2012-03-11 19:59:26 +04:00
brc 1 0 ,0 b # w a i t f o r s t a t u s s t o r e d
1 : basr % r14 ,% r1 # c a l l f u n c t i o n
stap _ _ S F _ E M P T Y ( % r15 ) # s t o r e c p u a d d r e s s
lh % r3 ,_ _ S F _ E M P T Y ( % r15 )
2012-06-04 17:05:43 +04:00
2 : sigp % r4 ,% r3 ,S I G P _ S T O P # s i g p s t o p t o c u r r e n t c p u
2012-03-11 19:59:26 +04:00
brc 2 ,2 b
3 : j 3 b
2011-08-03 18:44:19 +04:00
2011-01-05 14:47:25 +03:00
.section .kprobes .text , " ax"
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ C H E C K _ S T A C K
/ *
* The s y n c h r o n o u s o r t h e a s y n c h r o n o u s s t a c k o v e r f l o w e d . W e a r e d e a d .
* No n e e d t o p r o p e r l y s a v e t h e r e g i s t e r s , w e a r e g o i n g t o p a n i c a n y w a y .
* Setup a p t _ r e g s s o t h a t s h o w _ t r a c e c a n p r o v i d e a g o o d c a l l t r a c e .
* /
stack_overflow :
l % r15 ,_ _ L C _ P A N I C _ S T A C K # c h a n g e t o p a n i c s t a c k
2013-04-24 12:20:43 +04:00
la % r11 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r11 )
stm % r8 ,% r9 ,_ _ P T _ P S W ( % r11 )
2011-12-27 14:27:15 +04:00
mvc _ _ P T _ R 8 ( 3 2 ,% r11 ) ,0 ( % r14 )
l % r1 ,B A S E D ( 1 f )
xc _ _ S F _ B A C K C H A I N ( 4 ,% r15 ) ,_ _ S F _ B A C K C H A I N ( % r15 )
lr % r2 ,% r11 # p a s s p o i n t e r t o p t _ r e g s
br % r1 # b r a n c h t o k e r n e l _ s t a c k _ o v e r f l o w
2006-09-28 18:56:37 +04:00
1 : .long k e r n e l _ s t a c k _ o v e r f l o w
2005-04-17 02:20:36 +04:00
# endif
2011-12-27 14:27:15 +04:00
cleanup_table :
.long system_call + 0 x8 0 0 0 0 0 0 0
.long sysc_do_svc + 0 x8 0 0 0 0 0 0 0
.long sysc_tif + 0 x8 0 0 0 0 0 0 0
.long sysc_restore + 0 x8 0 0 0 0 0 0 0
.long sysc_done + 0 x8 0 0 0 0 0 0 0
.long io_tif + 0 x8 0 0 0 0 0 0 0
.long io_restore + 0 x8 0 0 0 0 0 0 0
.long io_done + 0 x8 0 0 0 0 0 0 0
2012-03-11 19:59:27 +04:00
.long psw_idle + 0 x8 0 0 0 0 0 0 0
.long psw_idle_end + 0 x8 0 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
cleanup_critical :
2011-12-27 14:27:15 +04:00
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e ) # s y s t e m _ c a l l
jl 0 f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 4 ) # s y s c _ d o _ s v c
jl c l e a n u p _ s y s t e m _ c a l l
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 8 ) # s y s c _ t i f
jl 0 f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 1 2 ) # s y s c _ r e s t o r e
jl c l e a n u p _ s y s c _ t i f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 1 6 ) # s y s c _ d o n e
jl c l e a n u p _ s y s c _ r e s t o r e
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 2 0 ) # i o _ t i f
jl 0 f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 2 4 ) # i o _ r e s t o r e
jl c l e a n u p _ i o _ t i f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 2 8 ) # i o _ d o n e
jl c l e a n u p _ i o _ r e s t o r e
2012-03-11 19:59:27 +04:00
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 3 2 ) # p s w _ i d l e
jl 0 f
cl % r9 ,B A S E D ( c l e a n u p _ t a b l e + 3 6 ) # p s w _ i d l e _ e n d
jl c l e a n u p _ i d l e
2011-12-27 14:27:15 +04:00
0 : br % r14
2005-04-17 02:20:36 +04:00
cleanup_system_call :
2011-12-27 14:27:15 +04:00
# check i f s t p t h a s b e e n e x e c u t e d
cl % r9 ,B A S E D ( c l e a n u p _ s y s t e m _ c a l l _ i n s n )
jh 0 f
2005-04-17 02:20:36 +04:00
mvc _ _ L C _ S Y N C _ E N T E R _ T I M E R ( 8 ) ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
chi % r11 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
je 0 f
mvc _ _ L C _ S Y N C _ E N T E R _ T I M E R ( 8 ) ,_ _ L C _ M C C K _ E N T E R _ T I M E R
0 : # check i f s t m h a s b e e n e x e c u t e d
cl % r9 ,B A S E D ( c l e a n u p _ s y s t e m _ c a l l _ i n s n + 4 )
jh 0 f
mvc _ _ L C _ S A V E _ A R E A _ S Y N C ( 3 2 ) ,0 ( % r11 )
0 : # set u p s a v e d r e g i s t e r s r12 , a n d r13
st % r12 ,1 6 ( % r11 ) # r 12 t h r e a d - i n f o p o i n t e r
st % r13 ,2 0 ( % r11 ) # r 13 l i t e r a l - p o o l p o i n t e r
# check i f t h e u s e r t i m e c a l c u l a t i o n h a s b e e n d o n e
cl % r9 ,B A S E D ( c l e a n u p _ s y s t e m _ c a l l _ i n s n + 8 )
jh 0 f
l % r10 ,_ _ L C _ E X I T _ T I M E R
l % r15 ,_ _ L C _ E X I T _ T I M E R + 4
SUB6 4 % r10 ,% r15 ,_ _ L C _ S Y N C _ E N T E R _ T I M E R
ADD6 4 % r10 ,% r15 ,_ _ L C _ U S E R _ T I M E R
st % r10 ,_ _ L C _ U S E R _ T I M E R
st % r15 ,_ _ L C _ U S E R _ T I M E R + 4
0 : # check i f t h e s y s t e m t i m e c a l c u l a t i o n h a s b e e n d o n e
cl % r9 ,B A S E D ( c l e a n u p _ s y s t e m _ c a l l _ i n s n + 1 2 )
jh 0 f
l % r10 ,_ _ L C _ L A S T _ U P D A T E _ T I M E R
l % r15 ,_ _ L C _ L A S T _ U P D A T E _ T I M E R + 4
SUB6 4 % r10 ,% r15 ,_ _ L C _ E X I T _ T I M E R
ADD6 4 % r10 ,% r15 ,_ _ L C _ S Y S T E M _ T I M E R
st % r10 ,_ _ L C _ S Y S T E M _ T I M E R
st % r15 ,_ _ L C _ S Y S T E M _ T I M E R + 4
0 : # update a c c o u n t i n g t i m e s t a m p
2005-04-17 02:20:36 +04:00
mvc _ _ L C _ L A S T _ U P D A T E _ T I M E R ( 8 ) ,_ _ L C _ S Y N C _ E N T E R _ T I M E R
2011-12-27 14:27:15 +04:00
# set u p s a v e d r e g i s t e r 1 1
l % r15 ,_ _ L C _ K E R N E L _ S T A C K
2013-04-24 12:20:43 +04:00
la % r9 ,S T A C K _ F R A M E _ O V E R H E A D ( % r15 )
st % r9 ,1 2 ( % r11 ) # r 11 p t _ r e g s p o i n t e r
2011-12-27 14:27:15 +04:00
# fill p t _ r e g s
2013-04-24 12:20:43 +04:00
mvc _ _ P T _ R 8 ( 3 2 ,% r9 ) ,_ _ L C _ S A V E _ A R E A _ S Y N C
stm % r0 ,% r7 ,_ _ P T _ R 0 ( % r9 )
mvc _ _ P T _ P S W ( 8 ,% r9 ) ,_ _ L C _ S V C _ O L D _ P S W
mvc _ _ P T _ I N T _ C O D E ( 4 ,% r9 ) ,_ _ L C _ S V C _ I L C
2011-12-27 14:27:15 +04:00
# setup s a v e d r e g i s t e r 1 5
st % r15 ,2 8 ( % r11 ) # r 15 s t a c k p o i n t e r
# set n e w p s w a d d r e s s a n d e x i t
l % r9 ,B A S E D ( c l e a n u p _ t a b l e + 4 ) # s y s c _ d o _ s v c + 0x80000000
2005-04-17 02:20:36 +04:00
br % r14
cleanup_system_call_insn :
2006-09-28 18:56:37 +04:00
.long system_call + 0 x8 0 0 0 0 0 0 0
2011-12-27 14:27:15 +04:00
.long sysc_stm + 0 x8 0 0 0 0 0 0 0
.long sysc_vtime + 0 x8 0 0 0 0 0 0 0 + 3 6
.long sysc_vtime + 0 x8 0 0 0 0 0 0 0 + 7 6
2005-04-17 02:20:36 +04:00
2010-05-17 12:00:02 +04:00
cleanup_sysc_tif :
2011-12-27 14:27:15 +04:00
l % r9 ,B A S E D ( c l e a n u p _ t a b l e + 8 ) # s y s c _ t i f + 0x80000000
2005-04-17 02:20:36 +04:00
br % r14
2010-05-17 12:00:02 +04:00
cleanup_sysc_restore :
2011-12-27 14:27:15 +04:00
cl % r9 ,B A S E D ( c l e a n u p _ s y s c _ r e s t o r e _ i n s n )
jhe 0 f
l % r9 ,1 2 ( % r11 ) # g e t s a v e d p o i n t e r t o p t _ r e g s
mvc _ _ L C _ R E T U R N _ P S W ( 8 ) ,_ _ P T _ P S W ( % r9 )
mvc 0 ( 3 2 ,% r11 ) ,_ _ P T _ R 8 ( % r9 )
lm % r0 ,% r7 ,_ _ P T _ R 0 ( % r9 )
0 : lm % r8 ,% r9 ,_ _ L C _ R E T U R N _ P S W
2005-04-17 02:20:36 +04:00
br % r14
2010-05-17 12:00:02 +04:00
cleanup_sysc_restore_insn :
2007-11-20 13:13:32 +03:00
.long sysc_done - 4 + 0 x8 0 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
2010-05-17 12:00:02 +04:00
cleanup_io_tif :
2011-12-27 14:27:15 +04:00
l % r9 ,B A S E D ( c l e a n u p _ t a b l e + 2 0 ) # i o _ t i f + 0x80000000
2010-04-09 15:43:00 +04:00
br % r14
2010-05-17 12:00:02 +04:00
cleanup_io_restore :
2011-12-27 14:27:15 +04:00
cl % r9 ,B A S E D ( c l e a n u p _ i o _ r e s t o r e _ i n s n )
jhe 0 f
l % r9 ,1 2 ( % r11 ) # g e t s a v e d r 11 p o i n t e r t o p t _ r e g s
mvc _ _ L C _ R E T U R N _ P S W ( 8 ) ,_ _ P T _ P S W ( % r9 )
mvc 0 ( 3 2 ,% r11 ) ,_ _ P T _ R 8 ( % r9 )
lm % r0 ,% r7 ,_ _ P T _ R 0 ( % r9 )
0 : lm % r8 ,% r9 ,_ _ L C _ R E T U R N _ P S W
2005-09-04 02:57:56 +04:00
br % r14
2010-05-17 12:00:02 +04:00
cleanup_io_restore_insn :
2007-11-20 13:13:32 +03:00
.long io_done - 4 + 0 x8 0 0 0 0 0 0 0
2005-09-04 02:57:56 +04:00
2012-03-11 19:59:27 +04:00
cleanup_idle :
# copy i n t e r r u p t c l o c k & c p u t i m e r
2012-07-20 13:15:08 +04:00
mvc _ _ C L O C K _ I D L E _ E X I T ( 8 ,% r2 ) ,_ _ L C _ I N T _ C L O C K
mvc _ _ T I M E R _ I D L E _ E X I T ( 8 ,% r2 ) ,_ _ L C _ A S Y N C _ E N T E R _ T I M E R
2012-03-11 19:59:27 +04:00
chi % r11 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
je 0 f
2012-07-20 13:15:08 +04:00
mvc _ _ C L O C K _ I D L E _ E X I T ( 8 ,% r2 ) ,_ _ L C _ M C C K _ C L O C K
mvc _ _ T I M E R _ I D L E _ E X I T ( 8 ,% r2 ) ,_ _ L C _ M C C K _ E N T E R _ T I M E R
2012-03-11 19:59:27 +04:00
0 : # check i f s t c k h a s b e e n e x e c u t e d
cl % r9 ,B A S E D ( c l e a n u p _ i d l e _ i n s n )
jhe 1 f
2012-07-20 13:15:08 +04:00
mvc _ _ C L O C K _ I D L E _ E N T E R ( 8 ,% r2 ) ,_ _ C L O C K _ I D L E _ E X I T ( % r2 )
mvc _ _ T I M E R _ I D L E _ E N T E R ( 8 ,% r2 ) ,_ _ T I M E R _ I D L E _ E X I T ( % r3 )
1 : # account s y s t e m t i m e g o i n g i d l e
2012-03-11 19:59:27 +04:00
lm % r9 ,% r10 ,_ _ L C _ S T E A L _ T I M E R
2012-07-20 13:15:08 +04:00
ADD6 4 % r9 ,% r10 ,_ _ C L O C K _ I D L E _ E N T E R ( % r2 )
2012-03-11 19:59:27 +04:00
SUB6 4 % r9 ,% r10 ,_ _ L C _ L A S T _ U P D A T E _ C L O C K
stm % r9 ,% r10 ,_ _ L C _ S T E A L _ T I M E R
2012-07-20 13:15:08 +04:00
mvc _ _ L C _ L A S T _ U P D A T E _ C L O C K ( 8 ) ,_ _ C L O C K _ I D L E _ E X I T ( % r2 )
2012-03-11 19:59:27 +04:00
lm % r9 ,% r10 ,_ _ L C _ S Y S T E M _ T I M E R
ADD6 4 % r9 ,% r10 ,_ _ L C _ L A S T _ U P D A T E _ T I M E R
2012-07-20 13:15:08 +04:00
SUB6 4 % r9 ,% r10 ,_ _ T I M E R _ I D L E _ E N T E R ( % r2 )
2012-03-11 19:59:27 +04:00
stm % r9 ,% r10 ,_ _ L C _ S Y S T E M _ T I M E R
2012-07-20 13:15:08 +04:00
mvc _ _ L C _ L A S T _ U P D A T E _ T I M E R ( 8 ) ,_ _ T I M E R _ I D L E _ E X I T ( % r2 )
2012-03-11 19:59:27 +04:00
# prepare r e t u r n p s w
2013-08-23 16:45:58 +04:00
n % r8 ,B A S E D ( c l e a n u p _ i d l e _ w a i t ) # c l e a r i r q & w a i t s t a t e b i t s
2012-03-11 19:59:27 +04:00
l % r9 ,2 4 ( % r11 ) # r e t u r n f r o m p s w _ i d l e
br % r14
cleanup_idle_insn :
.long psw_idle_lpsw + 0 x8 0 0 0 0 0 0 0
cleanup_idle_wait :
2013-08-23 16:45:58 +04:00
.long 0xfcfdffff
2012-03-11 19:59:27 +04:00
2005-04-17 02:20:36 +04:00
/ *
* Integer c o n s t a n t s
* /
2011-12-27 14:27:15 +04:00
.align 4
2012-03-11 19:59:27 +04:00
.Lnr_syscalls :
.long NR_syscalls
.Lvtimer_max :
.quad 0x7fffffffffffffff
2005-04-17 02:20:36 +04:00
/ *
* Symbol c o n s t a n t s
* /
2011-12-27 14:27:15 +04:00
.Ldo_machine_check : .long s390_do_machine_check
.Lhandle_mcck : .long s390_handle_mcck
.Ldo_IRQ : .long do_IRQ
.Ldo_signal : .long do_signal
.Ldo_notify_resume : .long do_notify_resume
.Ldo_per_trap : .long do_per_trap
.Ljump_table : .long pgm_check_table
.Lschedule : .long schedule
2007-12-04 18:09:04 +03:00
# ifdef C O N F I G _ P R E E M P T
2011-12-27 14:27:15 +04:00
.Lpreempt_irq : .long preempt_schedule_irq
2007-12-04 18:09:04 +03:00
# endif
2011-12-27 14:27:15 +04:00
.Ltrace_enter : .long do_syscall_trace_enter
.Ltrace_exit : .long do_syscall_trace_exit
.Lschedule_tail : .long schedule_tail
.Lsysc_per : .long sysc_per + 0 x8 0 0 0 0 0 0 0
2006-07-03 11:24:46 +04:00
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
2011-12-27 14:27:15 +04:00
.Lhardirqs_on : .long trace_hardirqs_on_caller
.Lhardirqs_off : .long trace_hardirqs_off_caller
2008-11-14 20:18:03 +03:00
# endif
# ifdef C O N F I G _ L O C K D E P
2011-12-27 14:27:15 +04:00
.Llockdep_sys_exit : .long lockdep_sys_exit
2006-07-03 11:24:46 +04:00
# endif
2011-12-27 14:27:15 +04:00
.Lcritical_start : .long __critical_start + 0 x8 0 0 0 0 0 0 0
.Lcritical_length : .long __critical_end - _ _ critical_ s t a r t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.section .rodata , " a"
2005-04-17 02:20:36 +04:00
# define S Y S C A L L ( e s a ,e s a m e ,e m u ) . l o n g e s a
2009-06-12 12:26:47 +04:00
.globl sys_call_table
2005-04-17 02:20:36 +04:00
sys_call_table :
# include " s y s c a l l s . S "
# undef S Y S C A L L