Skip to content
Snippets Groups Projects
  1. Jan 07, 2021
  2. Dec 18, 2020
  3. Dec 17, 2020
  4. Dec 15, 2020
  5. Dec 13, 2020
  6. Nov 23, 2020
  7. Nov 17, 2020
  8. Nov 15, 2020
  9. Nov 11, 2020
  10. Nov 10, 2020
    • Peter Maydell's avatar
      linux-user/sparc: Don't zero high half of PC, NPC, PSR in sigreturn · c3ab5df2
      Peter Maydell authored
      
      The function do_sigreturn() tries to store the PC, NPC and PSR in
      uint32_t local variables, which implicitly drops the high half of
      these fields for 64-bit guests.
      
      The usual effect was that a guest which used signals would crash on
      return from a signal unless it was lucky enough to take it while the
      PC was in the low 4GB of the address space.  In particular, Debian
      /bin/dash and /bin/bash would segfault after executing external
      commands.
      
      Use abi_ulong, which is the type these fields all have in the
      __siginfo_t struct.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20201105212314.9628-4-peter.maydell@linaro.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      c3ab5df2
    • Peter Maydell's avatar
      linux-user/sparc: Correct set/get_context handling of fp and i7 · 266b4158
      Peter Maydell authored
      
      Because QEMU's user-mode emulation just directly accesses guest CPU
      state, for SPARC the guest register window state is not the same in
      the sparc64_get_context() and sparc64_set_context() functions as it
      is for the real kernel's versions of those functions.  Specifically,
      for the kernel it has saved the user space state such that the O*
      registers go into a pt_regs struct as UREG_I*, and the I* registers
      have been spilled onto the userspace stack.  For QEMU, we haven't
      done that, so the guest's O* registers are still in WREG_O* and the
      I* registers in WREG_I*.
      
      The code was already accessing the O* registers correctly for QEMU,
      but had copied the kernel code for accessing the I* registers off the
      userspace stack.  Replace this with direct accesses to fp and i7 in
      the CPU state, and add a comment explaining why we differ from the
      kernel code here.
      
      This fix is sufficient to get bash to a shell prompt.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20201105212314.9628-3-peter.maydell@linaro.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      266b4158
    • Peter Maydell's avatar
      linux-user/sparc: Fix errors in target_ucontext structures · b8ae597f
      Peter Maydell authored
      
      The various structs that make up the SPARC target_ucontext had some
      errors:
       * target structures must not include fields which are host pointers,
         which might be the wrong size.  These should be abi_ulong instead
       * because we don't have the 'long double' part of the mcfpu_fregs
         union in our version of the target_mc_fpu struct, we need to
         manually force it to be 16-aligned
      
      In particular, the lack of 16-alignment caused sparc64_get_context()
      and sparc64_set_context() to read and write all the registers at the
      wrong offset, which triggered a guest glibc stack check in
      siglongjmp:
        *** longjmp causes uninitialized stack frame ***: terminated
      when trying to run bash.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20201105212314.9628-2-peter.maydell@linaro.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      b8ae597f
  11. Nov 04, 2020
  12. Oct 27, 2020
Loading