1. 23 Jul, 2013 1 commit
    • Alexander Graf's avatar
      linux-user: fix segmentation fault passing with h2g(x) != x · 732f9e89
      Alexander Graf authored
      When forwarding a segmentation fault into the guest process, we were passing
      the host's address directly into the guest process's signal descriptor.
      
      That obviously confused the guest process, since it didn't know what to make
      of the (usually 32-bit truncated) address. Passing in h2g(address) makes the
      guest process a lot happier.
      
      To make the code more obvious, introduce a h2g_nocheck() macro that does the
      same as h2g(), but allows us to convert addresses that may be outside of guest
      mapped range into the guest's view of address space.
      
      This fixes java running in arm-linux-user for me.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
      732f9e89
  2. 09 Jul, 2013 1 commit
  3. 05 Jul, 2013 1 commit
    • Peter Maydell's avatar
      user-exec.c: Set is_write correctly in the ARM cpu_signal_handler() · 023b0ae3
      Peter Maydell authored
      In the ARM implementation of cpu_signal_handler(), set is_write
      correctly using the FSR value which the kernel passes us in the
      error_code field of uc_mcontext. Since the WnR bit of the FSR was
      only introduced in ARMv6, this means that v5 cores will continue
      to behave as before this patch, but they are not really supported
      as hosts for linux-user mode anyway since they do not have the
      modern behaviour for unaligned accesses.
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1370352705-27590-1-git-send-email-peter.maydell@linaro.org
      023b0ae3
  4. 12 Jun, 2013 1 commit
  5. 23 Feb, 2013 1 commit
    • Peter Maydell's avatar
      Replace all setjmp()/longjmp() with sigsetjmp()/siglongjmp() · 6ab7e546
      Peter Maydell authored
      The setjmp() function doesn't specify whether signal masks are saved and
      restored; on Linux they are not, but on BSD (including MacOSX) they are.
      We want to have consistent behaviour across platforms, so we should
      always use "don't save/restore signal mask" (this is also generally
      going to be faster). This also works around a bug in MacOSX where the
      signal-restoration on longjmp() affects the signal mask for a completely
      different thread, not just the mask for the thread which did the longjmp.
      The most visible effect of this was that ctrl-C was ignored on MacOSX
      because the CPU thread did a longjmp which resulted in its signal mask
      being applied to every thread, so that all threads had SIGINT and SIGTERM
      blocked.
      
      The POSIX-sanctioned portable way to do a jump without affecting signal
      masks is to siglongjmp() to a sigjmp_buf which was created by calling
      sigsetjmp() with a zero savemask parameter, so change all uses of
      setjmp()/longjmp() accordingly. [Technically POSIX allows sigsetjmp(buf, 0)
      to save the signal mask; however the following siglongjmp() must not
      restore the signal mask, so the pair can be effectively considered as
      "sigjmp/longjmp which don't touch the mask".]
      
      For Windows we provide a trivial sigsetjmp/siglongjmp in terms of
      setjmp/longjmp -- this is OK because no user will ever pass a non-zero
      savemask.
      
      The setjmp() uses in tests/tcg/test-i386.c and tests/tcg/linux-test.c
      are left untouched because these are self-contained singlethreaded
      test programs intended to be run under QEMU's Linux emulation, so they
      have neither the portability nor the multithreading issues to deal with.
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Tested-by: default avatarStefan Weil <sw@weilnetz.de>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      6ab7e546
  6. 19 Dec, 2012 1 commit
  7. 18 Dec, 2012 1 commit
  8. 16 Dec, 2012 1 commit
  9. 15 Sep, 2012 1 commit
  10. 09 Aug, 2012 1 commit
  11. 01 Aug, 2012 1 commit
  12. 28 Jun, 2012 1 commit
    • Blue Swirl's avatar
      x86: avoid AREG0 for exceptions · 77b2bc2c
      Blue Swirl authored
      Add an explicit CPUX86State parameter instead of relying on AREG0.
      
      Merge raise_exception_env() to raise_exception(), likewise with
      raise_exception_err_env() and raise_exception_err().
      
      Introduce cpu_svm_check_intercept_param() and cpu_vmexit()
      as wrappers.
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      77b2bc2c
  13. 08 May, 2012 1 commit
  14. 14 Apr, 2012 1 commit
  15. 14 Mar, 2012 1 commit
    • Andreas Färber's avatar
      Rename CPUState -> CPUArchState · 9349b4f9
      Andreas Färber authored
      Scripted conversion:
        for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
          sed -i "s/CPUState/CPUArchState/g" $file
        done
      
      All occurrences of CPUArchState are expected to be replaced by QOM CPUState,
      once all targets are QOM'ified and common fields have been extracted.
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Reviewed-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      9349b4f9
  16. 07 Aug, 2011 1 commit
  17. 30 Jul, 2011 1 commit
    • Blue Swirl's avatar
      exec.h cleanup · 3e457172
      Blue Swirl authored
      Move softmmu_exec.h include directives from target-*/exec.h to
      target-*/op_helper.c. Move also various other stuff only used in
      op_helper.c there.
      
      Define global env in dyngen-exec.h.
      
      For i386, move wrappers for segment and FPU helpers from user-exec.c
      to op_helper.c. Implement raise_exception_err_env() to handle dynamic
      CPUState. Move the function declarations to cpu.h since they can be
      used outside of op_helper.c context.
      
      LM32, s390x, UniCore32: remove unused cpu_halted(), regs_to_env() and
      env_to_regs().
      
      ARM: make raise_exception() static.
      
      Convert
      #include "exec.h"
      to
      #include "cpu.h"
      #include "dyngen-exec.h"
      and remove now unused target-*/exec.h.
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      3e457172
  18. 26 Jun, 2011 1 commit
  19. 28 May, 2011 1 commit