use __asm__ rather than asm in asm-s390/ptrace.h
PATCH 1/1 use __asm__ rather than asm in asm-s390/ptrace.h
Since asm-s390/ptrace.h is exported to userspace, we need to make sure we use __asm__() rather than asm() as the latter is disabled when gcc compiles with GNU extensions turned off (like -std=c99).
---
include/asm-s390/ptrace.h +1 -1
@@ -475,7 +475,7 @@ extern void show_regs(struct pt_regs * regs);static inline void psw_set_key (unsigned int key) { - asmvolatile ("spka 0(%0)" : :"d" (key)); + __asm__ __volatile__("spka 0(%0)" : :"d" (key)); }#endif /* __ASSEMBLY__ */
Quoted 11 lines · Mike Frysinger
Since
asm-s390/ptrace.his exported to userspace, we need to make sure we use__asm__()rather thanasm()as the latter is disabled when gcc compiles with GNU extensions turned off (like -std=c99).Signed-off-by Mike Frysinger <[email protected]>---
include/asm-s390/ptrace.h +0
-0
include/asm-s390/ptrace.h extern void show_regs(struct pt_regs * regs); · line 481
Quoted 8 lines
include/asm-s390/ptrace.h +1
-1@@ -475,7 +475,7 @@ extern void show_regs(struct pt_regs * regs);static inline void psw_set_key (unsigned int key) { - asmvolatile ("spka 0(%0)" : :"d" (key)); + __asm__ __volatile__("spka 0(%0)" : :"d" (key)); }#endif /* __ASSEMBLY__ */
Hmm.. spka is a sort of priviledged instruction and shouldn't be user space visible.
I will move it so it's under #ifdef __KERNEL__.
Quoted 3 lines · Heiko Carstens
Hmm.. spka is a sort of priviledged instruction and shouldn't be user space visible.
I will move it so it's under #ifdef__KERNEL__.
Yes, I think this is better. On a side node, why did we add psw_set_key to ptrace.h? processor.h would have made more sense, no? It sets the key in the psw, it is not usable in userspace and ptrace doesn't provide an interface for reading/writing to the psw key. So a patch that moves the inline to processor.h alongside __load_psw and __load_psw_mask would be my solution.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
Quoted 11 lines · Martin Schwidefsky
Quoted 3 lines · Heiko Carstens
Hmm.. spka is a sort of priviledged instruction and shouldn't be user space visible.
I will move it so it's under #ifdef__KERNEL__.Yes, I think this is better. On a side node, why did we add
psw_set_keytoptrace.h?processor.hwould have made more sense, no? It sets the key in the psw, it is not usable in userspace and ptrace doesn't provide an interface for reading/writing to the psw key. So a patch that moves the inline toprocessor.halongside__load_pswand__load_psw_maskwould be my solution.
Yes. Moved it to processor.h instead :)