qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 1d8b51: signal/all: remove __get/__put_user r


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 1d8b51: signal/all: remove __get/__put_user return value r...
Date: Tue, 17 Jun 2014 09:00:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 1d8b512bbc0e246628521bcc2f5c875f29dd21df
      
https://github.com/qemu/qemu/commit/1d8b512bbc0e246628521bcc2f5c875f29dd21df
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all: remove __get/__put_user return value reading

Remove all the simple cases of reading the return value
of __get_user and __put_user.

We set err = 0 in sparc versions of do_sigreturn and
sparc64_set_context to avoid compile error, but else this patch is
just general removal of err |= __get_user ... idiom.

v2: remove err variable from target_rt_restore_ucontext

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


  Commit: 7df2fa3623dfe8a082bba54ae87750d5030814c1
      
https://github.com/qemu/qemu/commit/7df2fa3623dfe8a082bba54ae87750d5030814c1
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/x86/setup_frame: __put_user cleanup

Remove the remaining check for __put_user return
value, and all the checks for err variable which
isn't set anywhere anymore.

No we can only end up in give_sigsegv due to failed
lock_user_struct - thus we remove the unlock_user_struct
to avoid unlocking a region never locked.

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


  Commit: b0fd8d18683f0d77a8e6b482771ebea82234d727
      
https://github.com/qemu/qemu/commit/b0fd8d18683f0d77a8e6b482771ebea82234d727
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all: remove return value from copy_siginfo_to_user

Since copy_siginfo_to_user always returns 0, make it void
and remove any checks for return value from calling functions.

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


  Commit: 41ecc72ba5932381208e151bf2d2149a0342beff
      
https://github.com/qemu/qemu/commit/41ecc72ba5932381208e151bf2d2149a0342beff
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all: remove return value from setup_sigcontext

Make all implementations of setup_sigcontext void and
remove checking it's return value from functions calling
setup_sigcontext.

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


  Commit: 016d2e1dfa21b64a524d3629fdd317d4c25bc3b8
      
https://github.com/qemu/qemu/commit/016d2e1dfa21b64a524d3629fdd317d4c25bc3b8
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all: remove return value from restore_sigcontext

make most implementations of restore_sigcontext void and
remove checking it's return value from functions calling
restore_sigcontext.

The exception is the X86 version of the function that is
too different from others to deal in this way, and arm
version, to keep possibility of erroring out from failed
valid_user_regs.

v3: keep arm valid_user_regs for filling in near future.

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


  Commit: 945473847b4bb0869915aa47dabc4d2abbc87bdb
      
https://github.com/qemu/qemu/commit/945473847b4bb0869915aa47dabc4d2abbc87bdb
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/sparc/restore_fpu_state: remove

A function never called from anywhere, obviously half-complete.
Remove function and if someone wants to complete this, please
check the old version out of git history.

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


  Commit: 9eeb8306d56e8fd831bbbac6e3cfe69a40312a33
      
https://github.com/qemu/qemu/commit/9eeb8306d56e8fd831bbbac6e3cfe69a40312a33
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all/do_sigaltstack remove __get_user value check

Access is already checked in the lock_user_struct
call before.

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


  Commit: f5f601afcec6c1081128fe5a0f831788ca9f56ed
      
https://github.com/qemu/qemu/commit/f5f601afcec6c1081128fe5a0f831788ca9f56ed
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all/do_sigreturn - remove __get_user checks

Remove "if(__get_user" checks and their related error paths
for all architecture's do_sigreturn. Remove the unlock_user_struct
when the only way to end up there is from failed lock_user_struct.

v3: remove unneccesary sigsegv label as suggested by Peter

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


  Commit: 0188fadb7fe460d8c4c743372b1f7b25773e183e
      
https://github.com/qemu/qemu/commit/0188fadb7fe460d8c4c743372b1f7b25773e183e
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/all/setup_frame remove __put_user checks

Remove "if(__put_user" checks and their related error paths
for all architecture's setup_frame, setup_rt_frame and similar.

Remove the unlock_user_struct when the only way to end up there is
from failed lock_user_struct.

Remove err variable if there are no users for it in the function
anymore.

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


  Commit: c650c008e326f3a1e84083bc269265456057a212
      
https://github.com/qemu/qemu/commit/c650c008e326f3a1e84083bc269265456057a212
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/ppc/{save,restore}_user_regs remove __put/get error checks

As __get_user and __put_user do not return errors, remove the
if checks from around them. This allows making the save/restore
functions void.

Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Cc: Alexander Graf <address@hidden>


  Commit: be3ef5c7faa780b205151cc8f818beba64809718
      
https://github.com/qemu/qemu/commit/be3ef5c7faa780b205151cc8f818beba64809718
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/sparc64_set_context: remove __get_user checks

Remove checks of __get_user and the err variable
used to control flow with it.

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


  Commit: 9e918dc92723ee50a82d06296b3a14621d9eb52c
      
https://github.com/qemu/qemu/commit/9e918dc92723ee50a82d06296b3a14621d9eb52c
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  signal/ppc/do_setcontext remove __get_user return check

The last remaining check for return value of __get_user.

Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Cc: Alexander Graf <address@hidden>


  Commit: a42267ef58c4fcc9c9863f37dbe4cdbf887f8a7d
      
https://github.com/qemu/qemu/commit/a42267ef58c4fcc9c9863f37dbe4cdbf887f8a7d
  Author: Riku Voipio <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/qemu.h

  Log Message:
  -----------
  linux-user: fix gcc-4.9 compiler error on __{get,put]}_user

gcc-4.9 finds unused operand:

linux-user/syscall.c: In function ‘host_to_target_stat64’:
linux-user/qemu.h:301:19: error: right-hand operand of comma expression
has no effect [-Werror=unused-value]
      ((hptr), (x)), 0)

Just removing the rh operand is no good, it will error in later:

linux-user/main.c: In function ‘arm_kernel_cmpxchg64_helper’:
linux-user/qemu.h:330:15: error: void value not ignored as it ought to be
   __ret = __put_user((x), __hptr);    \

Thus, remove setting __ret from __get_user and __put_user, as and
set the right hand operand to (void)0 to make it clear that these
return never nothing.

This commit depends on the signal.c cleanup, to ensure bisectable
version history.

Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Cc: Richard Henderson <address@hidden>


  Commit: 4d13be8b8b817cbca7db2f880628d7ae5b74799f
      
https://github.com/qemu/qemu/commit/4d13be8b8b817cbca7db2f880628d7ae5b74799f
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/uname.c

  Log Message:
  -----------
  linux-user/uname: Return correct uname string for x86_64

We were returning the incorrect uname string (with a hyphen, not
an underscore) for x86_64. Fix this by removing the x86_64 special
case, since the default "just use UNAME_MACHINE" behaviour suffices.
This leaves cpu_to_uname_machine() special cases for only those
architectures which need to vary the string based on runtime CPU
features.

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


  Commit: be3bd286bc06bb68cdc71748d9dd4edcd57b2b24
      
https://github.com/qemu/qemu/commit/be3bd286bc06bb68cdc71748d9dd4edcd57b2b24
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Don't overrun guest buffer in sched_getaffinity

If the guest's "long" type is smaller than the host's, then
our sched_getaffinity wrapper needs to round the buffer size
up to a multiple of the host sizeof(long). This means that when
we copy the data back from the host buffer to the guest's
buffer there might be more than we can fit. Rather than
overflowing the guest's buffer, handle this case by returning
EINVAL or ignoring the unused extra space, as appropriate.

Note that only guests using the syscall interface directly might
run into this bug -- the glibc wrappers around it will always
use a buffer whose size is a multiple of 8 regardless of guest
architecture.

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


  Commit: 480eda2eda7c464e252f17ac87ec61bccc14f285
      
https://github.com/qemu/qemu/commit/480eda2eda7c464e252f17ac87ec61bccc14f285
  Author: Ed Swierk <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Return correct errno for unsupported netlink socket

This fixes "Cannot open audit interface - aborting." when the
EAFNOSUPPORT errno differs between the target and host
architectures (e.g. mips target and x86_64 host).

Signed-off-by: Ed Swierk <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: d3606f07440ee2c2bebea2b9932938e08b66d90b
      
https://github.com/qemu/qemu/commit/d3606f07440ee2c2bebea2b9932938e08b66d90b
  Author: Craig Heffner <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  User mode support for Linux ELF files with no section header

In user mode Linux, Qemu currently refuses to load ELF files that do not
contain section headers (ehdr->e_shentsize == 0). Since section headers are not
required in order to load an ELF file, simply removing the e_shentsize check in
elf_check_ehdr() allows ELF binaries with no section headers to be run properly
in user mode:

Signed-off-by: Craig Heffner <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 0360fbd076e8bdbb9498598b0c559464346babe4
      
https://github.com/qemu/qemu/commit/0360fbd076e8bdbb9498598b0c559464346babe4
  Author: Peter Maydell <address@hidden>
  Date:   2014-06-17 (Tue, 17 Jun 2014)

  Changed paths:
    M linux-user/elfload.c
    M linux-user/qemu.h
    M linux-user/signal.c
    M linux-user/syscall.c
    M linux-user/uname.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/riku/linux-user-for-upstream' into 
staging

* remotes/riku/linux-user-for-upstream:
  User mode support for Linux ELF files with no section header
  linux-user: Return correct errno for unsupported netlink socket
  linux-user: Don't overrun guest buffer in sched_getaffinity
  linux-user/uname: Return correct uname string for x86_64
  linux-user: fix gcc-4.9 compiler error on __{get,put]}_user
  signal/ppc/do_setcontext remove __get_user return check
  signal/sparc64_set_context: remove __get_user checks
  signal/ppc/{save,restore}_user_regs remove __put/get error checks
  signal/all/setup_frame remove __put_user checks
  signal/all/do_sigreturn - remove __get_user checks
  signal/all/do_sigaltstack remove __get_user value check
  signal/sparc/restore_fpu_state: remove
  signal/all: remove return value from restore_sigcontext
  signal/all: remove return value from setup_sigcontext
  signal/all: remove return value from copy_siginfo_to_user
  signal/x86/setup_frame: __put_user cleanup
  signal/all: remove __get/__put_user return value reading

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


Compare: https://github.com/qemu/qemu/compare/af44da87e926...0360fbd076e8

reply via email to

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