qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e28597: linux-user: Remove dead error-checkin


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e28597: linux-user: Remove dead error-checking code
Date: Tue, 13 Nov 2018 04:31:57 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e285977e77e534f128413b86cabab68bbffcbe4c
      
https://github.com/qemu/qemu/commit/e285977e77e534f128413b86cabab68bbffcbe4c
  Author: Peter Maydell <address@hidden>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M linux-user/m68k/signal.c
    M linux-user/sh4/signal.c
    M linux-user/sparc/signal.c

  Log Message:
  -----------
  linux-user: Remove dead error-checking code

Remove some dead code spotted by Coverity (CID 1009855,
1390854, 1390847). The underlying cause in all these cases
is the same: QEMU's put_user operations can't result in
errors, but the kernel's equivalent does. So when code
was copied from the kernel signal-frame-setup/teardown
code, checks on error flags that were needed in the kernel
became dead code for us.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: b10089a14cad93ca5cdcd441a23f522d1e15f554
      
https://github.com/qemu/qemu/commit/b10089a14cad93ca5cdcd441a23f522d1e15f554
  Author: Peter Maydell <address@hidden>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M linux-user/aarch64/cpu_loop.c
    M linux-user/alpha/cpu_loop.c
    M linux-user/arm/cpu_loop.c
    M linux-user/cris/cpu_loop.c
    M linux-user/hppa/cpu_loop.c
    M linux-user/i386/cpu_loop.c
    M linux-user/m68k/cpu_loop.c
    M linux-user/microblaze/cpu_loop.c
    M linux-user/mips/cpu_loop.c
    M linux-user/openrisc/cpu_loop.c
    M linux-user/ppc/cpu_loop.c
    M linux-user/riscv/cpu_loop.c
    M linux-user/s390x/cpu_loop.c
    M linux-user/sh4/cpu_loop.c
    M linux-user/sparc/cpu_loop.c
    M linux-user/xtensa/cpu_loop.c

  Log Message:
  -----------
  linux-user: Don't call gdb_handlesig() before queue_signal()

The CPU main-loop routines for linux-user generally
call gdb_handlesig() when they're about to queue a
SIGTRAP signal. This is wrong, because queue_signal()
will cause us to pend a signal, and process_pending_signals()
will then call gdb_handlesig() itself. So the effect is that
we notify gdb of the SIGTRAP, and then if gdb says "OK,
continue with signal X" we will incorrectly notify
gdb of the signal X as well. We don't do this double-notify
for anything else, only SIGTRAP.

Remove this unnecessary and incorrect code from all
the targets except for nios2 (whose main loop is
doing something different and broken, and will be handled
in a separate patch).

This bug only manifests if the user responds to the reported
SIGTRAP using "signal SIGFOO" rather than "continue"; since
the latter is the overwhelmingly common thing to do after a
breakpoint most people won't have hit this.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 9f214bd390803d54f6def8956c3bd8812a96b990
      
https://github.com/qemu/qemu/commit/9f214bd390803d54f6def8956c3bd8812a96b990
  Author: Peter Maydell <address@hidden>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M linux-user/nios2/cpu_loop.c

  Log Message:
  -----------
  linux-user: Clean up nios2 main loop signal handling

The nios2 main loop code's code does some odd
things with gdb_handlesig() that no other target
CPU does: it has some signals that are delivered
to gdb and only to gdb. Stop doing this, and instead
behave like all the other targets:
 * a trap instruction becomes a SIGTRAP
 * an unhandled exception type returned from cpu_exec()
   causes us to abort(), not to try to hand gdb a SIGILL

This fixes in passing Coverity issue CID 1390853,
which was a complaint that the old code failed to
check the return value from gdb_handlesig().

Signed-off-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
[lv: removed gdbsig unused variable]
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 113a9dd73f6377941e0a4bfd7aea5370728b1c28
      
https://github.com/qemu/qemu/commit/113a9dd73f6377941e0a4bfd7aea5370728b1c28
  Author: Yunqiang Su <address@hidden>
  Date:   2018-11-12 (Mon, 12 Nov 2018)

  Changed paths:
    M linux-user/strace.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Add support for SO_REUSEPORT

Add support for SO_REUSEPORT, including strace support. SO_REUSEPORT
was introduced relatively recently, since Linux 3.9, so use
'#if defined SO_REUSEPORT'.

Signed-off-by: Yunqiang Su <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 186ac05f749c69e98030f037aa930ff2bc4ad7fb
      
https://github.com/qemu/qemu/commit/186ac05f749c69e98030f037aa930ff2bc4ad7fb
  Author: Peter Maydell <address@hidden>
  Date:   2018-11-13 (Tue, 13 Nov 2018)

  Changed paths:
    M linux-user/aarch64/cpu_loop.c
    M linux-user/alpha/cpu_loop.c
    M linux-user/arm/cpu_loop.c
    M linux-user/cris/cpu_loop.c
    M linux-user/hppa/cpu_loop.c
    M linux-user/i386/cpu_loop.c
    M linux-user/m68k/cpu_loop.c
    M linux-user/m68k/signal.c
    M linux-user/microblaze/cpu_loop.c
    M linux-user/mips/cpu_loop.c
    M linux-user/nios2/cpu_loop.c
    M linux-user/openrisc/cpu_loop.c
    M linux-user/ppc/cpu_loop.c
    M linux-user/riscv/cpu_loop.c
    M linux-user/s390x/cpu_loop.c
    M linux-user/sh4/cpu_loop.c
    M linux-user/sh4/signal.c
    M linux-user/sparc/cpu_loop.c
    M linux-user/sparc/signal.c
    M linux-user/strace.c
    M linux-user/syscall.c
    M linux-user/xtensa/cpu_loop.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/vivier2/tags/linux-user-for-3.1-pull-request' into staging

- gdb signal handling fix
- add SO_REUSEPORT
- remove dead-code

# gpg: Signature made Mon 12 Nov 2018 20:48:23 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <address@hidden>"
# gpg:                 aka "Laurent Vivier <address@hidden>"
# gpg:                 aka "Laurent Vivier (Red Hat) <address@hidden>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-3.1-pull-request:
  linux-user: Add support for SO_REUSEPORT
  linux-user: Clean up nios2 main loop signal handling
  linux-user: Don't call gdb_handlesig() before queue_signal()
  linux-user: Remove dead error-checking code

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/a8a1b163b743...186ac05f749c
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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