qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 758092: translate-all.c: Don't pass puc, lock


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 758092: translate-all.c: Don't pass puc, locked to tb_inva...
Date: Thu, 09 Jun 2016 08:30:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 75809229bbf28b371afce14921ff5be98ddc5faa
      
https://github.com/qemu/qemu/commit/75809229bbf28b371afce14921ff5be98ddc5faa
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M translate-all.c

  Log Message:
  -----------
  translate-all.c: Don't pass puc, locked to tb_invalidate_phys_page()

The user-mode-only function tb_invalidate_phys_page() is only
called from two places:
 * page_unprotect(), which passes in a non-zero pc, a puc pointer
   and the value 'true' for the locked argument
 * page_set_flags(), which passes in a zero pc, a NULL puc pointer
   and a 'false' locked argument

If the pc is non-zero then we may call cpu_resume_from_signal(),
which does a longjmp out of the calling code (and out of the
signal handler); this is to cover the case of a target CPU with
"precise self-modifying code" (currently only x86) executing
a store instruction which modifies code in the same TB as the
store itself. Rather than doing the longjump directly here,
return a flag to the caller which indicates whether the current
TB was modified, and move the longjump to page_unprotect.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


  Commit: f213e72f2356b77768b9cb73814a3b26ad5a0099
      
https://github.com/qemu/qemu/commit/f213e72f2356b77768b9cb73814a3b26ad5a0099
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M cpu-exec-common.c
    M translate-all.c
    M translate-all.h
    M user-exec.c

  Log Message:
  -----------
  user-exec: Push resume-from-signal code out to handle_cpu_signal()

Since the only caller of page_unprotect() which might cause it to
need to call cpu_resume_from_signal() is handle_cpu_signal() in
the user-mode code, push the longjump handling out to that function.

Since this is the only caller of cpu_resume_from_signal() which
passes a non-NULL puc argument, split the non-NULL handling into
a new cpu_exit_tb_from_sighandler() function. This allows us
to merge the softmmu and usermode implementations of the
cpu_resume_from_signal() function, which are now identical.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


  Commit: 6886b98036a8f8f5bce8b10756ce080084cef11b
      
https://github.com/qemu/qemu/commit/6886b98036a8f8f5bce8b10756ce080084cef11b
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M cpu-exec-common.c
    M exec.c
    M hw/i386/kvmvapic.c
    M include/exec/exec-all.h
    M target-i386/bpt_helper.c
    M target-lm32/helper.c
    M target-s390x/helper.c
    M target-xtensa/helper.c
    M translate-all.c
    M user-exec.c

  Log Message:
  -----------
  cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc()

The function cpu_resume_from_signal() is now always called with a
NULL puc argument, and is rather misnamed since it is never called
from a signal handler. It is essentially forcing an exit to the
top level cpu loop but without raising any exception, so rename
it to cpu_loop_exit_noexc() and drop the useless unused argument.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


  Commit: a5852dc5de140fafa364722c35b8fe74d9f929a2
      
https://github.com/qemu/qemu/commit/a5852dc5de140fafa364722c35b8fe74d9f929a2
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M user-exec.c

  Log Message:
  -----------
  user-exec: Don't reextract sigmask from usercontext pointer

Extracting the old signal mask from the usercontext pointer passed to
a signal handler is a pain because it is OS and CPU dependent.
Since we've already done it once and passed it to handle_cpu_signal(),
there's no need to do it again in cpu_exit_tb_from_sighandler().
This then means we don't need to pass a usercontext pointer in to
handle_cpu_signal() at all.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


  Commit: 33271823323483b4ede1ae99de83d33b25875402
      
https://github.com/qemu/qemu/commit/33271823323483b4ede1ae99de83d33b25875402
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M target-i386/seg_helper.c

  Log Message:
  -----------
  target-i386: Add comment about do_interrupt_user() next_eip argument

Add a comment to do_interrupt_user() along the same lines as the
existing one for do_interrupt_all() noting that the next_eip
argument is not used unless is_int is true or intno is EXCP_SYSCALL.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


  Commit: 0c33682d5f29b0a4ae53bdec4c8e52e4fae37b34
      
https://github.com/qemu/qemu/commit/0c33682d5f29b0a4ae53bdec4c8e52e4fae37b34
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-09 (Thu, 09 Jun 2016)

  Changed paths:
    M target-i386/helper.c
    M user-exec.c

  Log Message:
  -----------
  target-i386: Move user-mode exception actions out of user-exec.c

The exception_action() function in user-exec.c is just a call to
cpu_loop_exit() for every target CPU except i386.  Since this
function is only called if the target's handle_mmu_fault() hook has
indicated an MMU fault, and that hook is only called from the
handle_cpu_signal() code path, we can simply move the x86-specific
setup into that hook, which allows us to remove the TARGET_I386
ifdef from user-exec.c.

Of the actions that were done by the call to raise_interrupt_err():
 * cpu_svm_check_intercept_param() is a no-op in user mode
 * check_exception() is a no-op since double faults are impossible
   for user-mode
 * assignments to cs->exception_index and env->error_code are no-ops
 * assigning to env->exception_next_eip is unnecessary because it
   is not used unless env->exception_is_int is true
 * cpu_loop_exit_restore() is equivalent to cpu_loop_exit() since
   pc is 0
which leaves just setting env_>exception_is_int as the action that
needs to be added to x86_cpu_handle_mmu_fault().

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Sergey Fedorov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Message-id: address@hidden


Compare: https://github.com/qemu/qemu/compare/9bbbf6497a10...0c33682d5f29

reply via email to

[Prev in Thread] Current Thread [Next in Thread]