LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* unprivileged use of MSR_SE
@ 2008-03-20  0:24 Roland McGrath
  2008-03-20  4:10 ` Paul Mackerras
  2008-03-20  4:15 ` Paul Mackerras
  0 siblings, 2 replies; 4+ messages in thread
From: Roland McGrath @ 2008-03-20  0:24 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Are there any powerpc instructions that can read or change the MSR
explicitly from user mode?  Any that can see or affect the MSR_SE bit?

e.g. x86 has pushf/popf unprivileged instructions, with which a user
program can both see the single-step flag set, and enable single-step for
its own next instruction (presumably when it has a handler for SIGTRAP).
This actually gets used in arcane places.

I recall being told before there's no unprivileged way to see or touch
MSR_SE.  But it looks to me like a user program can set the bit in a
sigcontext and sigreturn to set it.  Is that intentionally supported?
Or could sigreturn ignore the MSR_SE bit without breaking any strange user?

On x86 do we some machinations so that PTRACE_GETREGS et al show the
single-step bit set if user-mode itself had set it, but not if
PTRACE_SINGLESTEP set it.  If you use PTRACE_SETREGS et al to set the
single-step bit, then it stays set even if you use PTRACE_CONT.

I'd like to clean this up for powerpc too.  If there is no way at all for
user-mode to set MSR_SE, then it doesn't much matter whether it shows up
when ptrace reads it--ptrace just needs to ignore attempts to set it.  So
if there's no reason not to, what I would do is remove MSR_SE from the
MSR_DEBUGCHANGE mask and make sigreturn always clear MSR_SE.

Does that make sense?


Thanks,
Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-20  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20  0:24 unprivileged use of MSR_SE Roland McGrath
2008-03-20  4:10 ` Paul Mackerras
2008-03-20  7:43   ` Roland McGrath
2008-03-20  4:15 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox