Skip to content

Commit 7278a8f

Browse files
svens-s390Alexander Gordeev
authored andcommitted
s390: Mark psw in __load_psw_mask() as __unitialized
Without __unitialized, the following code is generated when INIT_STACK_ALL_ZERO is enabled: 86: d7 0f f0 a0 f0 a0 xc 160(16,%r15), 160(%r15) 8c: e3 40 f0 a0 00 24 stg %r4, 160(%r15) 92: c0 10 00 00 00 08 larl %r1, 0xa2 98: e3 10 f0 a8 00 24 stg %r1, 168(%r15) 9e: b2 b2 f0 a0 lpswe 160(%r15) The xc is not adding any security because psw is fully initialized with the following instructions. Add __unitialized to the psw definitiation to avoid the superfluous clearing of psw. Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 095c89e commit 7278a8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ static inline void __load_psw(psw_t psw)
314314
*/
315315
static __always_inline void __load_psw_mask(unsigned long mask)
316316
{
317+
psw_t psw __uninitialized;
317318
unsigned long addr;
318-
psw_t psw;
319319

320320
psw.mask = mask;
321321

0 commit comments

Comments
 (0)