Skip to contentSkip to conversation

use __asm__ rather than asm in asm-s390/ptrace.h

PATCH In review Mike Frysinger 3 participants 4 messages Jun 18, 2007 s390

lore
Share & tools
lore
#0 lore raw

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
index fa6ca87..4add355 100644
@@ -475,7 +475,7 @@ extern void show_regs(struct pt_regs * regs);
 static inline void
 psw_set_key(unsigned int key)
 {
-	asm volatile("spka 0(%0)" : : "d" (key));
+	__asm__ __volatile__("spka 0(%0)" : : "d" (key));
 }
 
 #endif /* __ASSEMBLY__ */
#1 lore raw
Quoted 11 lines · Mike Frysinger

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 +0 -0
index fa6ca87..4add355 100644

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)
 {
-	asm volatile("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__.

#2 lore raw
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.
#3 lore raw
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_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.

Yes. Moved it to processor.h instead :)