mbox

[PULL,00/43] First batch of misc changes for 2.5 (2015-09-09)

Message ID 1441806613-13775-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Pull-request

git://github.com/bonzini/qemu.git tags/for-upstream

Message

Paolo Bonzini Sept. 9, 2015, 1:49 p.m. UTC
The following changes since commit 090d0bfd948343d522cd20bc634105b5cfe2483b:

  s390: fix softmmu compilation (2015-08-28 16:05:24 +0100)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 9fd1a94888cd6a559f95c3596ec1ac28b74838c1:

  cpu-exec: fix lock hierarchy for user-mode emulation (2015-09-09 15:34:56 +0200)

----------------------------------------------------------------
* Support for jemalloc
* qemu_mutex_lock_iothread "No such process" fix
* cutils: qemu_strto* wrappers
* iohandler.c simplification
* Many other fixes and misc patches.

And some MTTCG work (with Emilio's fixes squashed):
* Signal-free TCG kick
* Removing spinlock in favor of QemuMutex
* User-mode emulation multi-threading fixes/docs

----------------------------------------------------------------
Alexandre Derumier (1):
      configure: Add support for jemalloc

Andrey Smetanin (1):
      Added generic panic handler qemu_system_guest_panicked()

Aníbal Limón (1):
      cpus.c: qemu_mutex_lock_iothread fix race condition at cpu thread init

Carlos L. Torres (5):
      cutils: Add qemu_strtol() wrapper
      cutils: Add qemu_strtoul() wrapper
      cutils: Add qemu_strtoll() wrapper
      cutils: Add qemu_strtoull() wrapper
      qmp: Add example usage of strto*l() qemu wrapper

Dr. David Alan Gilbert (1):
      Move RAMBlock and ram_list to ram_addr.h

Emilio G. Cota (7):
      qemu-thread: handle spurious futex_wait wakeups
      seqlock: add missing 'inline' to seqlock_read_retry
      seqlock: read sequence number atomically
      rcu: init rcu_registry_lock after fork
      rcu: fix comment with s/rcu_gp_lock/rcu_registry_lock/
      linux-user: call rcu_(un)register_thread on pthread_(exit|create)
      translate-all: remove obsolete comment about l1_map

Fam Zheng (1):
      iohandler: Use aio API

Gonglei (1):
      vhost-scsi: fix wrong vhost-scsi firmware path

KONRAD Frederic (3):
      cpus: remove tcg_halt_cond and tcg_cpu_thread globals
      replace spinlock by QemuMutex.
      remove unused spinlock.

Michael Marineau (1):
      Makefile.target: include top level build dir in vpath

Michael S. Tsirkin (1):
      scripts/dump-guest-memory.py: fix after RAMBlock change

Paolo Bonzini (18):
      i8257: rewrite DMA_schedule to avoid hooking into the CPU loop
      i8257: remove cpu_request_exit irq
      tcg: introduce tcg_current_cpu
      remove qemu/tls.h
      tcg: assign cpu->current_tb in a simpler place
      tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses
      tcg: synchronize exit_request and tcg_current_cpu accesses
      use qemu_cpu_kick instead of cpu_exit or qemu_cpu_kick_thread
      tcg: signal-free qemu_cpu_kick
      CODING_STYLE: update mixed declaration rules
      checkpatch: adapt some tests to QEMU
      checkpatch: remove tests that are not relevant outside the kernel
      add macro file for coccinelle
      cpus: protect work list with work_mutex
      tcg: add memory barriers in page_find_alloc accesses
      tcg: comment on which functions have to be called with mmap_lock held
      exec: make mmap_lock/mmap_unlock globally available
      cpu-exec: fix lock hierarchy for user-mode emulation

Peter Crosthwaite (1):
      configure: factor out adding disas configure

Peter Lieven (1):
      block/iscsi: validate block size returned from target

 CODING_STYLE                 |   13 +-
 Makefile.target              |    2 +-
 block/iscsi.c                |    4 +
 bsd-user/qemu.h              |    2 -
 configure                    |   93 +--
 cpu-exec.c                   |  119 ++--
 cpus.c                       |  130 ++---
 exec.c                       |    2 +-
 gdbstub.c                    |    2 +-
 hw/block/fdc.c               |    2 +-
 hw/dma/i82374.c              |    5 +-
 hw/dma/i8257.c               |   31 +-
 hw/i386/pc.c                 |   13 +-
 hw/isa/i82378.c              |    3 +-
 hw/mips/mips_fulong2e.c      |   13 +-
 hw/mips/mips_jazz.c          |   13 +-
 hw/mips/mips_malta.c         |   13 +-
 hw/misc/pvpanic.c            |    3 +-
 hw/ppc/prep.c                |   11 -
 hw/ppc/spapr_rtas.c          |    2 +-
 hw/scsi/vhost-scsi.c         |    2 +-
 hw/sparc/sun4m.c             |    4 +-
 hw/sparc64/sun4u.c           |    4 +-
 include/exec/cpu-all.h       |   41 --
 include/exec/exec-all.h      |   15 +-
 include/exec/ram_addr.h      |   40 ++
 include/exec/spinlock.h      |   49 --
 include/hw/isa/isa.h         |    4 +-
 include/qemu-common.h        |    8 +
 include/qemu/main-loop.h     |    3 +-
 include/qemu/rcu.h           |    2 +-
 include/qemu/seqlock.h       |    8 +-
 include/qemu/tls.h           |   52 --
 include/qom/cpu.h            |   14 +-
 include/sysemu/sysemu.h      |    1 +
 iohandler.c                  |  111 +---
 linux-user/main.c            |    6 +-
 linux-user/qemu.h            |    2 -
 linux-user/syscall.c         |    2 +
 main-loop.c                  |    5 +-
 qmp.c                        |   14 +-
 qom/cpu.c                    |    3 +
 scripts/checkpatch.pl        |  540 +++---------------
 scripts/cocci-macro-file.h   |  119 ++++
 scripts/dump-guest-memory.py |    2 +-
 target-i386/cpu.h            |    3 +
 target-i386/mem_helper.c     |   25 +-
 target-i386/translate.c      |    2 +
 target-s390x/kvm.c           |   11 +-
 tcg/tcg.h                    |    4 +
 tests/test-cutils.c          | 1280 ++++++++++++++++++++++++++++++++++++++++++
 translate-all.c              |   85 ++-
 util/cutils.c                |  136 +++++
 util/qemu-thread-posix.c     |   11 +-
 util/rcu.c                   |    7 +-
 vl.c                         |    6 +
 56 files changed, 2057 insertions(+), 1040 deletions(-)
 delete mode 100644 include/exec/spinlock.h
 delete mode 100644 include/qemu/tls.h
 create mode 100644 scripts/cocci-macro-file.h

Comments

Peter Maydell Sept. 9, 2015, 6:41 p.m. UTC | #1
On 9 September 2015 at 14:49, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 090d0bfd948343d522cd20bc634105b5cfe2483b:
>
>   s390: fix softmmu compilation (2015-08-28 16:05:24 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 9fd1a94888cd6a559f95c3596ec1ac28b74838c1:
>
>   cpu-exec: fix lock hierarchy for user-mode emulation (2015-09-09 15:34:56 +0200)
>
> ----------------------------------------------------------------
> * Support for jemalloc
> * qemu_mutex_lock_iothread "No such process" fix
> * cutils: qemu_strto* wrappers
> * iohandler.c simplification
> * Many other fixes and misc patches.
>
> And some MTTCG work (with Emilio's fixes squashed):
> * Signal-free TCG kick
> * Removing spinlock in favor of QemuMutex
> * User-mode emulation multi-threading fixes/docs
>
> ----------------------------------------------------------------

Hi. I'm afraid 'make check' fails on OSX:

GTESTER tests/test-cutils
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:267:void
test_qemu_strtol_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sab816860e6f76841220ea943985e84ad
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:282:void
test_qemu_strtol_whitespace(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sf54276ef91a62d445403b86533fd5107
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:297:void
test_qemu_strtol_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sc7bdef393984a4b2f2d4e4f27abeb15d
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:481:void
test_qemu_strtol_full_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S4997e0b4ab30ebccffa73bc1781328b2
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:558:void
test_qemu_strtoul_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S698648c46f24ad5a964b9d17af6bc4e8
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:573:void
test_qemu_strtoul_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S1104b6fe236e206ba8fcf92362809c51
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:588:void
test_qemu_strtoul_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S174ff5853966067468f62d748943c2b7
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:768:void
test_qemu_strtoul_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S3ce87fc2cc5682c83e1e1d52621b4da5
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:843:void
test_qemu_strtoll_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S63bf7c10814c2a2bd2d17434e0aa02cf
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:858:void
test_qemu_strtoll_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S99d2c928c55415df4469f03edce5f1b3
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:873:void
test_qemu_strtoll_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S6c849584fb36a603f2261d0c215691bc
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1053:void
test_qemu_strtoll_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S8685bb488d3e6869e053fe9bbf7e99d0
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1131:void
test_qemu_strtoull_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sd7cef3a007a563c9ffa77f7ed3a60ab6
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1146:void
test_qemu_strtoull_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02Sad8be510623b0ddc095987c6bd300454
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1161:void
test_qemu_strtoull_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sc012647d52c18c0917f45222650e10b0
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1341:void
test_qemu_strtoull_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02Scf2405f86a11f03b0ec039a0af727ebd
make: *** [check-tests/test-cutils] Error 1

(errno 22 on OSX is EINVAL.)

These tests appear to be testing the behaviour of the system
strtol on invalid sequences (for instance the first one is
using the empty string ""). POSIX says
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
"If the subject sequence is empty or does not have the expected
 form, no conversion is performed; the value of str shall be
 stored in the object pointed to by endptr, provided that endptr
 is not a null pointer."
and later
"These functions may fail if:
  [EINVAL]   No conversion could be performed."

That is, it's implementation defined whether this kind of
failing conversion sets errno to EINVAL or leaves it alone,
and it looks like the test cases are assuming the latter
behaviour. I imagine they won't work on the BSDs either,
though I haven't tested.

thanks
-- PMM
Paolo Bonzini Sept. 9, 2015, 7:25 p.m. UTC | #2
I will add a patch to detect the invalid sequences, as the OS X behavior seems preferable. Something like returning -EINVAL if result == 0 && (endptr == p || endptr[-1] != '0'). Nice to have the testcases.

And I thought I had tested this pull request really a lot. :-)

Paolo


-----Original Message-----
From: Peter Maydell [peter.maydell@linaro.org]
Received: mercoledì, 09 set 2015, 20:42
To: Paolo Bonzini [pbonzini@redhat.com]
CC: QEMU Developers [qemu-devel@nongnu.org]
Subject: Re: [Qemu-devel] [PULL 00/43] First batch of misc changes for 2.5 (2015-09-09)

On 9 September 2015 at 14:49, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 090d0bfd948343d522cd20bc634105b5cfe2483b:
>
>   s390: fix softmmu compilation (2015-08-28 16:05:24 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 9fd1a94888cd6a559f95c3596ec1ac28b74838c1:
>
>   cpu-exec: fix lock hierarchy for user-mode emulation (2015-09-09 15:34:56 +0200)
>
> ----------------------------------------------------------------
> * Support for jemalloc
> * qemu_mutex_lock_iothread "No such process" fix
> * cutils: qemu_strto* wrappers
> * iohandler.c simplification
> * Many other fixes and misc patches.
>
> And some MTTCG work (with Emilio's fixes squashed):
> * Signal-free TCG kick
> * Removing spinlock in favor of QemuMutex
> * User-mode emulation multi-threading fixes/docs
>
> ----------------------------------------------------------------

Hi. I'm afraid 'make check' fails on OSX:

GTESTER tests/test-cutils
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:267:void
test_qemu_strtol_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sab816860e6f76841220ea943985e84ad
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:282:void
test_qemu_strtol_whitespace(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sf54276ef91a62d445403b86533fd5107
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:297:void
test_qemu_strtol_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sc7bdef393984a4b2f2d4e4f27abeb15d
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:481:void
test_qemu_strtol_full_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S4997e0b4ab30ebccffa73bc1781328b2
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:558:void
test_qemu_strtoul_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S698648c46f24ad5a964b9d17af6bc4e8
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:573:void
test_qemu_strtoul_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S1104b6fe236e206ba8fcf92362809c51
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:588:void
test_qemu_strtoul_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S174ff5853966067468f62d748943c2b7
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:768:void
test_qemu_strtoul_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S3ce87fc2cc5682c83e1e1d52621b4da5
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:843:void
test_qemu_strtoll_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S63bf7c10814c2a2bd2d17434e0aa02cf
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:858:void
test_qemu_strtoll_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S99d2c928c55415df4469f03edce5f1b3
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:873:void
test_qemu_strtoll_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02S6c849584fb36a603f2261d0c215691bc
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1053:void
test_qemu_strtoll_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02S8685bb488d3e6869e053fe9bbf7e99d0
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1131:void
test_qemu_strtoull_empty(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sd7cef3a007a563c9ffa77f7ed3a60ab6
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1146:void
test_qemu_strtoull_whitespace(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02Sad8be510623b0ddc095987c6bd300454
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1161:void
test_qemu_strtoull_invalid(): assertion failed (err == 0): (-22 == 0)
GTester: last random seed: R02Sc012647d52c18c0917f45222650e10b0
**
ERROR:/Users/pm215/src/qemu/tests/test-cutils.c:1341:void
test_qemu_strtoull_full_empty(): assertion failed (err == 0): (-22 ==
0)
GTester: last random seed: R02Scf2405f86a11f03b0ec039a0af727ebd
make: *** [check-tests/test-cutils] Error 1

(errno 22 on OSX is EINVAL.)

These tests appear to be testing the behaviour of the system
strtol on invalid sequences (for instance the first one is
using the empty string ""). POSIX says
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
"If the subject sequence is empty or does not have the expected
 form, no conversion is performed; the value of str shall be
 stored in the object pointed to by endptr, provided that endptr
 is not a null pointer."
and later
"These functions may fail if:
  [EINVAL]   No conversion could be performed."

That is, it's implementation defined whether this kind of
failing conversion sets errno to EINVAL or leaves it alone,
and it looks like the test cases are assuming the latter
behaviour. I imagine they won't work on the BSDs either,
though I haven't tested.

thanks
-- PMM