qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d67f4a: linux-user: /proc/self/maps content


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d67f4a: linux-user: /proc/self/maps content
Date: Fri, 22 Aug 2014 08:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d67f4aaae8379b44b3b51ff07df75f693012983c
      
https://github.com/qemu/qemu/commit/d67f4aaae8379b44b3b51ff07df75f693012983c
  Author: Mikhail Ilyin <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M include/exec/cpu-all.h
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: /proc/self/maps content

Build /proc/self/maps doing a match against guest memory translation table.
Output only that map records which are valid for guest memory layout.

Signed-off-by: Mikhail Ilyin <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 0b2effd744471adea1cc82966df8a54fd6afa200
      
https://github.com/qemu/qemu/commit/0b2effd744471adea1cc82966df8a54fd6afa200
  Author: Riku Voipio <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: redirect openat calls

While Mikhail fixed /proc/self/maps, it was noticed openat calls are
not redirected currently. Some archs don't have open at all, so
openat needs to be redirected.

Fix this by consolidating open/openat code to do_openat - open
is implemented using openat(AT_FDCWD, ... ), which according
to open(2) man page is identical.

Since all targets now have openat, remove the ifdef around sys_openat
and openat: case in do_syscall.

Cc: Mikhail Ilin <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 47575997be9e0cae44a4fcaecbd172fec3746c96
      
https://github.com/qemu/qemu/commit/47575997be9e0cae44a4fcaecbd172fec3746c96
  Author: Jincheng Miao <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/main.c
    M target-i386/seg_helper.c

  Log Message:
  -----------
  linux-user: Fix syscall instruction usermode emulation on X86_64

Currently syscall instruction is buggy on user mode X86_64,
the EIP is updated after do_syscall(), that is too late for
clone(). Because clone() will create a thread at the env->EIP
(the address of syscall insn), and then child thread enters
do_syscall() again, that is not expected. Sometimes it is tragic.

User mode syscall insn emulation is not used MSR, so the
action should be same to INT 0x80. INT 0x80 will update EIP in
do_interrupt(), ditto for syscall() for consistency.

Signed-off-by: Jincheng Miao <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: c065976f2bca9b87bc699c5fdeb4d3ff1299b8c4
      
https://github.com/qemu/qemu/commit/c065976f2bca9b87bc699c5fdeb4d3ff1299b8c4
  Author: Peter Maydell <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix conversion of sigevent argument to timer_create

There were a number of bugs in the conversion of the sigevent
argument to timer_create from target to host format:
 * signal number not converted from target to host
 * thread ID not copied across
 * sigev_value not copied across
 * we never unlocked the struct when we were done

Between them, these problems meant that SIGEV_THREAD_ID
timers (and the glibc-implemented SIGEV_THREAD timers which
depend on them) didn't work.

Fix these problems and clean up the code a little by pulling
the struct conversion out into its own function, in line with
how we convert various other structs. This allows the test
program in bug LP:1042388 to run.

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


  Commit: f17f4989fa193fa8279474c5462289a3cfe69aea
      
https://github.com/qemu/qemu/commit/f17f4989fa193fa8279474c5462289a3cfe69aea
  Author: Mike Frysinger <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix readlink handling with magic exe symlink

The current code always returns the length of the path when it should
be returning the number of bytes it wrote to the output string.

Further, readlink is not supposed to append a NUL byte, but the current
snprintf logic will always do just that.

Even further, if you pass in a length of 0, you're suppoesd to get back
an error (EINVAL), but the current logic just returns 0.

Further still, if there was an error reading the symlink, we should not
go ahead and try to read the target buffer as it is garbage.

Simple test for the first two issues:
$ cat test.c
int main() {
    char buf[50];
    size_t len;
    for (len = 0; len < 10; ++len) {
  memset(buf, '!', sizeof(buf));
  ssize_t ret = readlink("/proc/self/exe", buf, len);
  buf[20] = '\0';
  printf("readlink(/proc/self/exe, {%s}, %zu) = %zi\n", buf, len, ret);
    }
    return 0;
}

Now compare the output of the native:
$ gcc test.c -o /tmp/x
$ /tmp/x
$ strace /tmp/x

With what qemu does:
$ armv7a-cros-linux-gnueabi-gcc test.c -o /tmp/x -static
$ qemu-arm /tmp/x
$ qemu-arm -strace /tmp/x

Signed-off-by: Mike Frysinger <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 518343413fd311a3d95798b2c1d51853fd8d3c85
      
https://github.com/qemu/qemu/commit/518343413fd311a3d95798b2c1d51853fd8d3c85
  Author: Riku Voipio <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

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

  Log Message:
  -----------
  linux-user: support timerfd_{create, gettime, settime} syscalls

Adds support for the timerfd_create, timerfd_gettime & timerfd_settime
syscalls, allowing use of timerfds by target programs.

v2: By Riku - added configure check for timerfd and ifdefs
for benefit of old distributions like RHEL5.

Signed-off-by: Paul Burton <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ab31cda3270994ab7a59a3ed8d44029a52af95a3
      
https://github.com/qemu/qemu/commit/ab31cda3270994ab7a59a3ed8d44029a52af95a3
  Author: Paul Burton <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: support ioprio_{get, set} syscalls

Add support for the ioprio_get & ioprio_set syscalls, allowing their
use by target programs.

Signed-off-by: Paul Burton <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 9af5c906d189d8f4aae902d75567639d2a8f4e22
      
https://github.com/qemu/qemu/commit/9af5c906d189d8f4aae902d75567639d2a8f4e22
  Author: Riku Voipio <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

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

  Log Message:
  -----------
  linux-user: add setns and unshare

Add support for the setns and unshare syscalls, trivially passed through to
the host. Based on patches by Paul Burton, added configure check.

Signed-off-by: Paul Burton <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 035273440b4d12c6e8b1cf2787778064355d21e2
      
https://github.com/qemu/qemu/commit/035273440b4d12c6e8b1cf2787778064355d21e2
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: PPC64 semid_ds Doesnt Include _unused1 and _unused2

The 64 bit PowerPC platforms eliminate the _unused1 and _unused2
elements of the semid_ds structure from <sys/sem.h>.  So eliminate
these from the target_semid_ds structure.

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 5d2fa8ebb4dae0057ed9baab617971dcd5ea493f
      
https://github.com/qemu/qemu/commit/5d2fa8ebb4dae0057ed9baab617971dcd5ea493f
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Dereference Pointer Argument to ipc/semctl Sys Call

When the ipc system call is used to wrap a semctl system call,
the ptr argument to ipc needs to be dereferenced prior to passing
it to the semctl handler.  This is because the fourth argument to
semctl is a union and not a pointer to a union.

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 5464baecf521d1ca8095604f5a7371443c94226a
      
https://github.com/qemu/qemu/commit/5464baecf521d1ca8095604f5a7371443c94226a
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Properly Handle semun Structure In Cross-Endian Situations

The semun union used in the semctl system call contains both an int (val) and
pointers.  In cross-endian situations on 64 bit targets, the value passed to
semctl is an 8 byte (abi_long) value and thus does not have the 4-byte val
field in the correct location.  In order to rectify this, the other half
of the union must be accessed.  This is achieved in code by performing
a byte swap on the entire 8 byte union, followed by a 4-byte swap of the
first half.

Also, eliminate an extraneous (dead) line of code that sets target_su.val in
the IPC_SET/IPC_GET case.

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 37ed09560c51465c3b8a659b9d18d43e75726c04
      
https://github.com/qemu/qemu/commit/37ed09560c51465c3b8a659b9d18d43e75726c04
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Make ipc syscall's third argument an abi_long

For those target ABIs that use the ipc system call (e.g. POWER),
the third argument is used in the shmat path as a pointer.  It
therefore must be declared as an abi_long (versus int) so that
the address bits are not lost in truncation.  In fact, all arguments
to do_ipc should be declared as abit_long.

In fact, it makes more sense for all of the arguments to be declaried
as abi_long (except call).

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: b6ce1f6b90903961f66b0aec7be75d6c94560e40
      
https://github.com/qemu/qemu/commit/b6ce1f6b90903961f66b0aec7be75d6c94560e40
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Conditionally Pass Attribute Pointer to mq_open()

The mq_open system call takes an optional struct mq_attr pointer
argument in the fourth position.  This pointer is used when O_CREAT
is specified in the flags (second) argument.  It may be NULL, in
which case the queue is created with implementation defined attributes.

Change the code to properly handle the case when NULL is passed in the
arg4 position.

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


  Commit: edcc5f9dc39309d32f4b3737e6b750ae967f5bbd
      
https://github.com/qemu/qemu/commit/edcc5f9dc39309d32f4b3737e6b750ae967f5bbd
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Detect Negative Message Sizes in msgsnd System Call

The msgsnd system call takes an argument that describes the message
size (msgsz) and is of type size_t.  The system call should set
errno to EINVAL in the event that a negative message size is passed.

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


  Commit: a1d5c5b25d06b68aec76e4b0eb7d8aacb5fbd191
      
https://github.com/qemu/qemu/commit/a1d5c5b25d06b68aec76e4b0eb7d8aacb5fbd191
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Handle NULL sched_param argument to sched_*

The sched_getparam, sched_setparam and sched_setscheduler system
calls take a pointer argument to a sched_param structure.  When
this pointer is null, errno should be set to EINVAL.

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: d4290c40a4bf297e9af132be81d51bf796882ff2
      
https://github.com/qemu/qemu/commit/d4290c40a4bf297e9af132be81d51bf796882ff2
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Detect fault in sched_rr_get_interval

Properly detect a fault when attempting to store into an invalid
struct timespec pointer.

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


  Commit: 67d6d829cdc4e76f64162e6ba8861ee527987bd5
      
https://github.com/qemu/qemu/commit/67d6d829cdc4e76f64162e6ba8861ee527987bd5
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/elfload.c
    M linux-user/ppc/target_cpu.h

  Log Message:
  -----------
  linux-user: Move get_ppc64_abi

The get_ppc64_abi is used to determine the ELF ABI (i.e. V1 or V2). This
routine is currently implemented in the linux-user/elfload.c file but
is useful in other scenarios.  Move the routine to a more generally
available location (linux-user/ppc/target_cpu.h).

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 0903c8be9ee7925863c6c50a2096b6e919be861c
      
https://github.com/qemu/qemu/commit/0903c8be9ee7925863c6c50a2096b6e919be861c
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/aarch64/syscall.h
    M linux-user/alpha/syscall.h
    M linux-user/arm/syscall.h
    M linux-user/cris/syscall.h
    M linux-user/i386/syscall.h
    M linux-user/m68k/syscall.h
    M linux-user/microblaze/syscall.h
    M linux-user/mips/syscall.h
    M linux-user/mips64/syscall.h
    M linux-user/openrisc/syscall.h
    M linux-user/ppc/syscall.h
    M linux-user/s390x/syscall.h
    M linux-user/sh4/syscall.h
    M linux-user/signal.c
    M linux-user/sparc/syscall.h
    M linux-user/sparc64/syscall.h
    M linux-user/unicore32/syscall.h
    M linux-user/x86_64/syscall.h

  Log Message:
  -----------
  linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2

The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was
2048 previously.

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 8fbe8fdfbc7576c58c59b605354457cc02076304
      
https://github.com/qemu/qemu/commit/8fbe8fdfbc7576c58c59b605354457cc02076304
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: clock_nanosleep errno Handling on PPC

The clock_nanosleep syscall is unusual in that it returns positive
numbers in error handling situations, versus returning -1 and setting
errno, or returning a negative errno value.  On POWER, the kernel will
set the SO bit of CR0 to indicate failure in a syscall.  QEMU has
generic handling to do this for syscalls with standard return values.

Add special case code for clock_nanosleep to handle CR0 properly.

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


  Commit: 6f6a40328b6f4679082583c2b3a949cda451a991
      
https://github.com/qemu/qemu/commit/6f6a40328b6f4679082583c2b3a949cda451a991
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/aarch64/syscall.h
    M linux-user/alpha/syscall.h
    M linux-user/arm/syscall.h
    M linux-user/cris/syscall.h
    M linux-user/i386/syscall.h
    M linux-user/m68k/syscall.h
    M linux-user/microblaze/syscall.h
    M linux-user/mips/syscall.h
    M linux-user/mips64/syscall.h
    M linux-user/openrisc/syscall.h
    M linux-user/ppc/syscall.h
    M linux-user/s390x/syscall.h
    M linux-user/sh4/syscall.h
    M linux-user/sparc/syscall.h
    M linux-user/sparc64/syscall.h
    M linux-user/syscall.c
    M linux-user/unicore32/syscall.h
    M linux-user/x86_64/syscall.h

  Log Message:
  -----------
  linux-user: Support target-to-host translation of mlockall argument

The argument to the mlockall system call is not necessarily the same on
all platforms and thus may require translation prior to passing to the
host.

For example, PowerPC 64 bit platforms define values for MCL_CURRENT
(0x2000) and MCL_FUTURE (0x4000) which are different from Intel platforms
(0x1 and 0x2, respectively)

Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 29560a6cb7a7a705de3d7dfb44e8b1c0a12ad37d
      
https://github.com/qemu/qemu/commit/29560a6cb7a7a705de3d7dfb44e8b1c0a12ad37d
  Author: Tom Musta <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: writev Partial Writes

Although not technically not required by POSIX, the writev system call will
typically write out its buffers individually.  That is, if the first buffer
is written successfully, but the second buffer pointer is invalid, then
the first chuck will be written and its size is returned.

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


  Commit: 29e03fcb62d413cf5fba06978346893ab72a1f64
      
https://github.com/qemu/qemu/commit/29e03fcb62d413cf5fba06978346893ab72a1f64
  Author: zhanghailiang <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: check return value of malloc()

Signed-off-by: zhanghailiang <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 43fe62757b0b90af448e02c9bd55b62960556360
      
https://github.com/qemu/qemu/commit/43fe62757b0b90af448e02c9bd55b62960556360
  Author: Peter Maydell <address@hidden>
  Date:   2014-08-22 (Fri, 22 Aug 2014)

  Changed paths:
    M configure
    M include/exec/cpu-all.h
    M linux-user/aarch64/syscall.h
    M linux-user/alpha/syscall.h
    M linux-user/arm/syscall.h
    M linux-user/cris/syscall.h
    M linux-user/elfload.c
    M linux-user/i386/syscall.h
    M linux-user/m68k/syscall.h
    M linux-user/main.c
    M linux-user/microblaze/syscall.h
    M linux-user/mips/syscall.h
    M linux-user/mips64/syscall.h
    M linux-user/openrisc/syscall.h
    M linux-user/ppc/syscall.h
    M linux-user/ppc/target_cpu.h
    M linux-user/s390x/syscall.h
    M linux-user/sh4/syscall.h
    M linux-user/signal.c
    M linux-user/sparc/syscall.h
    M linux-user/sparc64/syscall.h
    M linux-user/strace.list
    M linux-user/syscall.c
    M linux-user/unicore32/syscall.h
    M linux-user/x86_64/syscall.h
    M target-i386/seg_helper.c

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

* remotes/riku/linux-user-for-upstream: (22 commits)
  linux-user: check return value of malloc()
  linux-user: writev Partial Writes
  linux-user: Support target-to-host translation of mlockall argument
  linux-user: clock_nanosleep errno Handling on PPC
  linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2
  linux-user: Move get_ppc64_abi
  linux-user: Detect fault in sched_rr_get_interval
  linux-user: Handle NULL sched_param argument to sched_*
  linux-user: Detect Negative Message Sizes in msgsnd System Call
  linux-user: Conditionally Pass Attribute Pointer to mq_open()
  linux-user: Make ipc syscall's third argument an abi_long
  linux-user: Properly Handle semun Structure In Cross-Endian Situations
  linux-user: Dereference Pointer Argument to ipc/semctl Sys Call
  linux-user: PPC64 semid_ds Doesnt Include _unused1 and _unused2
  linux-user: add setns and unshare
  linux-user: support ioprio_{get, set} syscalls
  linux-user: support timerfd_{create, gettime, settime} syscalls
  linux-user: fix readlink handling with magic exe symlink
  linux-user: Fix conversion of sigevent argument to timer_create
  linux-user: Fix syscall instruction usermode emulation on X86_64
  ...

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


Compare: https://github.com/qemu/qemu/compare/fd3cced36695...43fe62757b0b

reply via email to

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