LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch] use __asm__ rather than asm in asm-s390/ptrace.h
@ 2007-06-18 6:23 Mike Frysinger
2007-06-18 7:36 ` Heiko Carstens
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2007-06-18 6:23 UTC (permalink / raw)
To: akpm, linux-kernel, linux-s390
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).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index fa6ca87..4add355 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -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__ */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h
2007-06-18 6:23 [patch] use __asm__ rather than asm in asm-s390/ptrace.h Mike Frysinger
@ 2007-06-18 7:36 ` Heiko Carstens
2007-06-18 8:15 ` Martin Schwidefsky
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Carstens @ 2007-06-18 7:36 UTC (permalink / raw)
To: Mike Frysinger; +Cc: akpm, linux-kernel, linux-s390, Martin Schwidefsky
On Mon, Jun 18, 2007 at 02:23:06AM -0400, Mike Frysinger wrote:
> 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).
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
> index fa6ca87..4add355 100644
> --- a/include/asm-s390/ptrace.h
> +++ b/include/asm-s390/ptrace.h
> @@ -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__.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h
2007-06-18 7:36 ` Heiko Carstens
@ 2007-06-18 8:15 ` Martin Schwidefsky
2007-06-18 8:23 ` Heiko Carstens
0 siblings, 1 reply; 4+ messages in thread
From: Martin Schwidefsky @ 2007-06-18 8:15 UTC (permalink / raw)
To: Heiko Carstens; +Cc: Mike Frysinger, akpm, linux-kernel, linux-s390
On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote:
> 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.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] use __asm__ rather than asm in asm-s390/ptrace.h
2007-06-18 8:15 ` Martin Schwidefsky
@ 2007-06-18 8:23 ` Heiko Carstens
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Carstens @ 2007-06-18 8:23 UTC (permalink / raw)
To: Martin Schwidefsky; +Cc: Mike Frysinger, akpm, linux-kernel, linux-s390
On Mon, Jun 18, 2007 at 10:15:18AM +0200, Martin Schwidefsky wrote:
> On Mon, 2007-06-18 at 09:36 +0200, Heiko Carstens wrote:
> > 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 :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-18 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18 6:23 [patch] use __asm__ rather than asm in asm-s390/ptrace.h Mike Frysinger
2007-06-18 7:36 ` Heiko Carstens
2007-06-18 8:15 ` Martin Schwidefsky
2007-06-18 8:23 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).