mbox

[PULL,00/23] TCG and misc patches for 2.7 hard freeze from 2016-07-18

Message ID 1468834075-25669-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 July 18, 2016, 9:27 a.m. UTC
The following changes since commit 6b92bbfe812746fe7841a24c24e6460f5359ce72:

  Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2016-07-15 16:56:08 +0100)

are available in the git repository at:

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

for you to fetch changes up to 6e5532eb16b1fcc7b6d5a15bc5fc0089c1f776f0:

  block/iscsi: allow caching of the allocation map (2016-07-18 11:19:47 +0200)

----------------------------------------------------------------
* tb_lock-less
* two old patches from prospective GSoC students
* i386 -kernel device tree support
* Coverity fix
* memory usage improvement from Peter
* checkpatch fix
* g_path_get_dirname cleanup
* caching of block status for iSCSI

----------------------------------------------------------------
Alex Bennée (2):
      tcg: set up tb->page_addr before insertion
      tcg: cpu-exec: remove tb_lock from the hot-path

Antonio Borneo (1):
      hw/i386: add device tree support

Md Haris Iqbal (1):
      Changed malloc to g_malloc, free to g_free in bsd-user/qemu.h

Paolo Bonzini (3):
      compiler: never omit assertions if using a static analysis tool
      megasas: remove useless check for cmd->frame
      util/qht: Document memory ordering assumptions

Peter Lieven (3):
      exec: avoid realloc in phys_map_node_reserve
      block/iscsi: fix rounding in iscsi_allocationmap_set
      block/iscsi: allow caching of the allocation map

Pranith Kumar (1):
      Move README to markdown

Sergey Fedorov (10):
      cpu-exec: Move down some declarations in cpu_exec()
      tcg: Pass last_tb by value to tb_find_fast()
      tcg: Prepare safe tb_jmp_cache lookup out of tb_lock
      tcg: Prepare safe access to tb_flushed out of tb_lock
      target-i386: Remove redundant HF_SOFTMMU_MASK
      tcg: Introduce tb_mark_invalid() and tb_is_invalid()
      tcg: Prepare TB invalidation for lockless TB lookup
      tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()
      tcg: Merge tb_find_slow() and tb_find_fast()
      tcg: rename tb_find_physical()

Stefan Hajnoczi (1):
      checkpatch: consider git extended headers valid patches

Wei Jiangang (1):
      use g_path_get_dirname instead of dirname

 README => README.md      |  41 ++++----
 block/iscsi.c            | 248 ++++++++++++++++++++++++++++++++++++-----------
 bsd-user/qemu.h          |   4 +-
 cpu-exec.c               | 124 +++++++++++-------------
 exec.c                   |   4 +-
 hw/i386/pc.c             |  46 +++++++++
 hw/scsi/megasas.c        |   6 +-
 include/exec/exec-all.h  |  16 +++
 include/qemu/compiler.h  |   3 +
 include/qemu/qht.h       |   5 +
 os-posix.c               |   3 +-
 scripts/checkpatch.pl    |   5 +
 target-alpha/cpu.h       |  14 +++
 target-arm/cpu.h         |  14 +++
 target-cris/cpu.h        |  14 +++
 target-i386/cpu.c        |   3 -
 target-i386/cpu.h        |  20 +++-
 target-i386/translate.c  |  12 +--
 target-lm32/cpu.h        |  14 +++
 target-m68k/cpu.h        |  14 +++
 target-microblaze/cpu.h  |  14 +++
 target-mips/cpu.h        |  14 +++
 target-moxie/cpu.h       |  14 +++
 target-openrisc/cpu.h    |  14 +++
 target-ppc/cpu.h         |  14 +++
 target-s390x/cpu.h       |  14 +++
 target-sh4/cpu.h         |  14 +++
 target-sparc/cpu.h       |  14 +++
 target-sparc/translate.c |   1 +
 target-tilegx/cpu.h      |  14 +++
 target-tricore/cpu.h     |  14 +++
 target-unicore32/cpu.h   |  14 +++
 target-xtensa/cpu.h      |  14 +++
 tcg/tcg.h                |   2 +-
 translate-all.c          |  29 +++---
 util/oslib-posix.c       |   4 +-
 util/qht.c               |   7 +-
 37 files changed, 633 insertions(+), 188 deletions(-)
 rename README => README.md (85%)

Comments

Peter Maydell July 18, 2016, 11:51 a.m. UTC | #1
On 18 July 2016 at 10:27, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 6b92bbfe812746fe7841a24c24e6460f5359ce72:
>
>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2016-07-15 16:56:08 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 6e5532eb16b1fcc7b6d5a15bc5fc0089c1f776f0:
>
>   block/iscsi: allow caching of the allocation map (2016-07-18 11:19:47 +0200)
>
> ----------------------------------------------------------------
> * tb_lock-less
> * two old patches from prospective GSoC students
> * i386 -kernel device tree support
> * Coverity fix
> * memory usage improvement from Peter
> * checkpatch fix
> * g_path_get_dirname cleanup
> * caching of block status for iSCSI
>

Hi. I'm afraid this fails to build on 32-bit:

In file included from /home/petmay01/qemu/include/qemu/osdep.h:36:0,
                 from /home/petmay01/qemu/exec.c:19:
/home/petmay01/qemu/include/exec/exec-all.h: In function 'tb_mark_invalid':
/home/petmay01/qemu/include/qemu/compiler.h:85:23: error: size of
array 'qemu_build_bug_on__265' is negative
     typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
__attribute__((unused));
                       ^
/home/petmay01/qemu/include/qemu/compiler.h:50:21: note: in definition
of macro 'xglue'
 #define xglue(x, y) x ## y
                     ^
/home/petmay01/qemu/include/qemu/compiler.h:85:18: note: in expansion
of macro 'glue'
     typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
__attribute__((unused));
                  ^
/home/petmay01/qemu/include/qemu/atomic.h:63:5: note: in expansion of
macro 'QEMU_BUILD_BUG_ON'
     QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
     ^
/home/petmay01/qemu/include/exec/exec-all.h:265:5: note: in expansion
of macro 'atomic_set'
     atomic_set(&tb->pc, pc);
     ^
/home/petmay01/qemu/include/qemu/compiler.h:85:23: error: size of
array 'qemu_build_bug_on__266' is negative
     typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
__attribute__((unused));
                       ^
/home/petmay01/qemu/include/qemu/compiler.h:50:21: note: in definition
of macro 'xglue'
 #define xglue(x, y) x ## y
                     ^
/home/petmay01/qemu/include/qemu/compiler.h:85:18: note: in expansion
of macro 'glue'
     typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
__attribute__((unused));
                  ^
/home/petmay01/qemu/include/qemu/atomic.h:63:5: note: in expansion of
macro 'QEMU_BUILD_BUG_ON'
     QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
     ^
/home/petmay01/qemu/include/exec/exec-all.h:266:5: note: in expansion
of macro 'atomic_set'
     atomic_set(&tb->cs_base, cs_base);
     ^

Looks like an attempt to do an atomic op on a larger-than-host-pointer type.

thanks
-- PMM
Paolo Bonzini July 18, 2016, 11:54 a.m. UTC | #2
On 18/07/2016 13:51, Peter Maydell wrote:
> On 18 July 2016 at 10:27, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> The following changes since commit 6b92bbfe812746fe7841a24c24e6460f5359ce72:
>>
>>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2016-07-15 16:56:08 +0100)
>>
>> are available in the git repository at:
>>
>>   git://github.com/bonzini/qemu.git tags/for-upstream
>>
>> for you to fetch changes up to 6e5532eb16b1fcc7b6d5a15bc5fc0089c1f776f0:
>>
>>   block/iscsi: allow caching of the allocation map (2016-07-18 11:19:47 +0200)
>>
>> ----------------------------------------------------------------
>> * tb_lock-less
>> * two old patches from prospective GSoC students
>> * i386 -kernel device tree support
>> * Coverity fix
>> * memory usage improvement from Peter
>> * checkpatch fix
>> * g_path_get_dirname cleanup
>> * caching of block status for iSCSI
>>
> 
> Hi. I'm afraid this fails to build on 32-bit:
> 
> In file included from /home/petmay01/qemu/include/qemu/osdep.h:36:0,
>                  from /home/petmay01/qemu/exec.c:19:
> /home/petmay01/qemu/include/exec/exec-all.h: In function 'tb_mark_invalid':
> /home/petmay01/qemu/include/qemu/compiler.h:85:23: error: size of
> array 'qemu_build_bug_on__265' is negative
>      typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> __attribute__((unused));
>                        ^
> /home/petmay01/qemu/include/qemu/compiler.h:50:21: note: in definition
> of macro 'xglue'
>  #define xglue(x, y) x ## y
>                      ^
> /home/petmay01/qemu/include/qemu/compiler.h:85:18: note: in expansion
> of macro 'glue'
>      typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> __attribute__((unused));
>                   ^
> /home/petmay01/qemu/include/qemu/atomic.h:63:5: note: in expansion of
> macro 'QEMU_BUILD_BUG_ON'
>      QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
>      ^
> /home/petmay01/qemu/include/exec/exec-all.h:265:5: note: in expansion
> of macro 'atomic_set'
>      atomic_set(&tb->pc, pc);
>      ^
> /home/petmay01/qemu/include/qemu/compiler.h:85:23: error: size of
> array 'qemu_build_bug_on__266' is negative
>      typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> __attribute__((unused));
>                        ^
> /home/petmay01/qemu/include/qemu/compiler.h:50:21: note: in definition
> of macro 'xglue'
>  #define xglue(x, y) x ## y
>                      ^
> /home/petmay01/qemu/include/qemu/compiler.h:85:18: note: in expansion
> of macro 'glue'
>      typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> __attribute__((unused));
>                   ^
> /home/petmay01/qemu/include/qemu/atomic.h:63:5: note: in expansion of
> macro 'QEMU_BUILD_BUG_ON'
>      QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
>      ^
> /home/petmay01/qemu/include/exec/exec-all.h:266:5: note: in expansion
> of macro 'atomic_set'
>      atomic_set(&tb->cs_base, cs_base);
>      ^
> 
> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.

Hmm, atomic_set should be acceptable even on 64-bit.  I'll fix that up,
atomics are not necessary here because there's always a smp_wmb afterwards.

Paolo
Peter Maydell July 18, 2016, 11:57 a.m. UTC | #3
On 18 July 2016 at 12:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 18/07/2016 13:51, Peter Maydell wrote:
>> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.
>
> Hmm, atomic_set should be acceptable even on 64-bit.

How does that work, when the host might not have an atomic
64-bit write?

thanks
-- PMM
Paolo Bonzini July 18, 2016, 11:59 a.m. UTC | #4
On 18/07/2016 13:57, Peter Maydell wrote:
> On 18 July 2016 at 12:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 18/07/2016 13:51, Peter Maydell wrote:
>>> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.
>>
>> Hmm, atomic_set should be acceptable even on 64-bit.
> 
> How does that work, when the host might not have an atomic
> 64-bit write?

All hosts we support should have it.  Worst case, it could be done
through FP registers.

Paolo
Peter Maydell July 18, 2016, 12:50 p.m. UTC | #5
On 18 July 2016 at 12:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 18/07/2016 13:57, Peter Maydell wrote:
>> On 18 July 2016 at 12:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>> On 18/07/2016 13:51, Peter Maydell wrote:
>>>> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.
>>>
>>> Hmm, atomic_set should be acceptable even on 64-bit.
>>
>> How does that work, when the host might not have an atomic
>> 64-bit write?
>
> All hosts we support should have it.

32-bit ARM does not guarantee that you can have 64-bit atomic
operations.

thanks
-- PMM
Paolo Bonzini July 18, 2016, 1:22 p.m. UTC | #6
On 18/07/2016 14:50, Peter Maydell wrote:
> On 18 July 2016 at 12:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 18/07/2016 13:57, Peter Maydell wrote:
>>> On 18 July 2016 at 12:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>> On 18/07/2016 13:51, Peter Maydell wrote:
>>>>> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.
>>>>
>>>> Hmm, atomic_set should be acceptable even on 64-bit.
>>>
>>> How does that work, when the host might not have an atomic
>>> 64-bit write?
>>
>> All hosts we support should have it.
> 
> 32-bit ARM does not guarantee that you can have 64-bit atomic
> operations.

Doesn't it have LDRDEX and STRDEX?

Paolo
Peter Maydell July 18, 2016, 1:41 p.m. UTC | #7
On 18 July 2016 at 14:22, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 18/07/2016 14:50, Peter Maydell wrote:
>> On 18 July 2016 at 12:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>
>>> On 18/07/2016 13:57, Peter Maydell wrote:
>>>> On 18 July 2016 at 12:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>> On 18/07/2016 13:51, Peter Maydell wrote:
>>>>>> Looks like an attempt to do an atomic op on a larger-than-host-pointer type.
>>>>>
>>>>> Hmm, atomic_set should be acceptable even on 64-bit.
>>>>
>>>> How does that work, when the host might not have an atomic
>>>> 64-bit write?
>>>
>>> All hosts we support should have it.
>>
>> 32-bit ARM does not guarantee that you can have 64-bit atomic
>> operations.
>
> Doesn't it have LDRDEX and STRDEX?

Yes, you could use a LDREXD/STREXD sequence for ARMv7 (and it
looks like gcc does so). Doesn't work on ARMv5, though.

MIPS32 and PPC32 are the hosts where attempted 64-bit
atomics generally fail (they want to call out to libatomic),
so those would be the other ones to test before widening the use
of atomic_set.

thanks
-- PMM
Paolo Bonzini July 18, 2016, 1:59 p.m. UTC | #8
On 18/07/2016 15:41, Peter Maydell wrote:
>> > Doesn't it have LDRDEX and STRDEX?
> Yes, you could use a LDREXD/STREXD sequence for ARMv7 (and it
> looks like gcc does so). Doesn't work on ARMv5, though.
> 
> MIPS32 and PPC32 are the hosts where attempted 64-bit
> atomics generally fail (they want to call out to libatomic),
> so those would be the other ones to test before widening the use
> of atomic_set.

In the meanwhile we can degrade these particular accesses to volatile.

Paolo