qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] user-exec: cpu_resume_from_signal() cleanups
@ 2016-05-16 16:09 Peter Maydell
  2016-05-16 16:09 ` [Qemu-devel] [PATCH 1/5] translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page() Peter Maydell
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Peter Maydell @ 2016-05-16 16:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: patches, Richard Henderson, Paolo Bonzini, Riku Voipio,
	Eduardo Habkost

I was trying to reason about user-mode's handling of signal masks,
and I found our current code a bit confusing, so I cleaned it up.

At the moment for user-only mode cpu_resume_from_signal() takes a
usercontext pointer; if this is non-NULL then it has some awkward
OS and CPU specific code to set the signal mask from something
inside the usercontext before doing the same kind of siglongjmp()
that the softmmu cpu_resume_from_signal() does.

In fact the two use cases are completely separate:
 * almost all calls to cpu_resume_from_signal() pass a NULL puc
   argument (and most of those are softmmu-only anyway)
 * only the code path handle_cpu_signal -> page_unprotect ->
   tb_invalidate_phys_page -> cpu_resume_from_signal will pass
   a non-NULL puc.

The cleanups are:
 * pull the call to cpu_resume_from_signal() up through the
   callstack so we do the signal mask manipulation in
   handle_cpu_signal()
 * drop the OS/CPU spceific code to get a signal mask out of
   a usercontext, because in the specific case of handle_cpu_signal()
   we already have the signal mask value and can just use it
 * rename cpu_resume_from_signal() to cpu_loop_exit_noexc(),
   since all the remaining callsites are not in fact signal handlers
   or even called from signal handlers
 * get rid of an ugly TARGET_I386 ifdef in user-exec.c by moving
   the i386-specific code into its handle_mmu_fault hook.

Peter Maydell (5):
  translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page()
  user-exec: Push resume-from-signal code out to handle_cpu_signal()
  cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc()
  user-exec: Don't reextract sigmask from usercontext pointer
  target-i386: Move user-mode exception actions out of user-exec.c

 cpu-exec-common.c        |  8 ++---
 exec.c                   |  2 +-
 hw/i386/kvmvapic.c       |  2 +-
 include/exec/exec-all.h  |  2 +-
 target-i386/bpt_helper.c |  2 +-
 target-i386/helper.c     |  2 ++
 target-lm32/helper.c     |  2 +-
 target-s390x/helper.c    |  2 +-
 target-xtensa/helper.c   |  2 +-
 translate-all.c          | 40 ++++++++++++---------
 translate-all.h          |  2 +-
 user-exec.c              | 93 +++++++++++++++++++++---------------------------
 12 files changed, 77 insertions(+), 82 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2016-05-17 13:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-16 16:09 [Qemu-devel] [PATCH 0/5] user-exec: cpu_resume_from_signal() cleanups Peter Maydell
2016-05-16 16:09 ` [Qemu-devel] [PATCH 1/5] translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page() Peter Maydell
2016-05-16 17:13   ` Sergey Fedorov
2016-05-16 17:15     ` Peter Maydell
2016-05-16 17:24       ` Sergey Fedorov
2016-05-16 16:09 ` [Qemu-devel] [PATCH 2/5] user-exec: Push resume-from-signal code out to handle_cpu_signal() Peter Maydell
2016-05-16 17:57   ` Sergey Fedorov
2016-05-16 16:09 ` [Qemu-devel] [PATCH 3/5] cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() Peter Maydell
2016-05-16 17:58   ` Sergey Fedorov
2016-05-16 16:09 ` [Qemu-devel] [PATCH 4/5] user-exec: Don't reextract sigmask from usercontext pointer Peter Maydell
2016-05-16 18:00   ` Sergey Fedorov
2016-05-16 16:09 ` [Qemu-devel] [PATCH 5/5] target-i386: Move user-mode exception actions out of user-exec.c Peter Maydell
2016-05-16 17:54   ` Sergey Fedorov
2016-05-16 18:33     ` Peter Maydell
2016-05-16 20:24       ` Peter Maydell
2016-05-17 13:47     ` Peter Maydell

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).