[PATCH v3 00/10] Atomic cleanup + clang-12 build fix

Richard Henderson posted 10 patches 2 years, 9 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210717192419.2066778-1-richard.henderson@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <ehabkost@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Cornelia Huck <cohuck@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>, Peter Maydell <peter.maydell@linaro.org>, David Hildenbrand <david@redhat.com>, Thomas Huth <thuth@redhat.com>, Greg Kurz <groug@kaod.org>
There is a newer version of this series
configure                     |   7 -
accel/tcg/atomic_template.h   | 141 +++++++++-----------
accel/tcg/tcg-runtime.h       |  46 -------
include/qemu/atomic.h         | 243 ++++------------------------------
include/qemu/stats64.h        |   2 +-
include/tcg/tcg.h             |  78 +++++------
softmmu/timers-state.h        |   2 +-
trace/mem-internal.h          |  50 -------
trace/mem.h                   |  50 +++++--
accel/tcg/cputlb.c            |  49 +------
accel/tcg/user-exec.c         |  41 +++---
linux-user/hppa/cpu_loop.c    |   2 +-
plugins/core.c                |   2 +-
target/arm/helper-a64.c       |   8 +-
target/i386/tcg/mem_helper.c  |  15 +--
target/m68k/op_helper.c       |  19 +--
target/ppc/mem_helper.c       |  16 +--
target/s390x/tcg/mem_helper.c |  19 +--
tcg/tcg-op.c                  |  47 ++-----
util/qsp.c                    |   4 +-
accel/tcg/atomic_common.c.inc | 107 +++++++++++++--
21 files changed, 321 insertions(+), 627 deletions(-)
delete mode 100644 trace/mem-internal.h
[PATCH v3 00/10] Atomic cleanup + clang-12 build fix
Posted by Richard Henderson 2 years, 9 months ago
This is intended to fix building with clang-12 on i386.
In the process, I found bugs wrt handling of guest memory in target/
with respect to atomics, fixed by unifying the api between softmmu
and user-only and removing some ifdefs under target/.

Unification of the api allowed some further cleanups.

I think that patches 1-5 fix all of the bugs, and that 6-10 are only
cleanup and could be left to next cycle.

Changes for v3:
  * Dropped the typeof_strip_qual patch with broader testing.
  * Squashed an include fix for trace/mem.h, with plugins enabled.
  * Applied Phil's R-b.


r~


Richard Henderson (10):
  qemu/atomic: Use macros for CONFIG_ATOMIC64
  qemu/atomic: Remove pre-C11 atomic fallbacks
  qemu/atomic: Add aligned_{int64,uint64}_t types
  tcg: Rename helper_atomic_*_mmu and provide for user-only
  accel/tcg: Standardize atomic helpers on softmmu api
  accel/tcg: Fold EXTRA_ARGS into atomic_template.h
  accel/tcg: Remove ATOMIC_MMU_DECLS
  accel/tcg: Expand ATOMIC_MMU_LOOKUP_*
  trace: Fold mem-internal.h into mem.h
  accel/tcg: Push trace info building into atomic_common.c.inc

 configure                     |   7 -
 accel/tcg/atomic_template.h   | 141 +++++++++-----------
 accel/tcg/tcg-runtime.h       |  46 -------
 include/qemu/atomic.h         | 243 ++++------------------------------
 include/qemu/stats64.h        |   2 +-
 include/tcg/tcg.h             |  78 +++++------
 softmmu/timers-state.h        |   2 +-
 trace/mem-internal.h          |  50 -------
 trace/mem.h                   |  50 +++++--
 accel/tcg/cputlb.c            |  49 +------
 accel/tcg/user-exec.c         |  41 +++---
 linux-user/hppa/cpu_loop.c    |   2 +-
 plugins/core.c                |   2 +-
 target/arm/helper-a64.c       |   8 +-
 target/i386/tcg/mem_helper.c  |  15 +--
 target/m68k/op_helper.c       |  19 +--
 target/ppc/mem_helper.c       |  16 +--
 target/s390x/tcg/mem_helper.c |  19 +--
 tcg/tcg-op.c                  |  47 ++-----
 util/qsp.c                    |   4 +-
 accel/tcg/atomic_common.c.inc | 107 +++++++++++++--
 21 files changed, 321 insertions(+), 627 deletions(-)
 delete mode 100644 trace/mem-internal.h

-- 
2.25.1


Re: [PATCH v3 00/10] Atomic cleanup + clang-12 build fix
Posted by Cole Robinson 2 years, 9 months ago
On 7/17/21 3:24 PM, Richard Henderson wrote:
> This is intended to fix building with clang-12 on i386.
> In the process, I found bugs wrt handling of guest memory in target/
> with respect to atomics, fixed by unifying the api between softmmu
> and user-only and removing some ifdefs under target/.
> 
> Unification of the api allowed some further cleanups.
> 
> I think that patches 1-5 fix all of the bugs, and that 6-10 are only
> cleanup and could be left to next cycle.
> 
> Changes for v3:
>   * Dropped the typeof_strip_qual patch with broader testing.
>   * Squashed an include fix for trace/mem.h, with plugins enabled.
>   * Applied Phil's R-b.
> 
> 
> r~
> 
> 
> Richard Henderson (10):
>   qemu/atomic: Use macros for CONFIG_ATOMIC64
>   qemu/atomic: Remove pre-C11 atomic fallbacks
>   qemu/atomic: Add aligned_{int64,uint64}_t types
>   tcg: Rename helper_atomic_*_mmu and provide for user-only
>   accel/tcg: Standardize atomic helpers on softmmu api
>   accel/tcg: Fold EXTRA_ARGS into atomic_template.h
>   accel/tcg: Remove ATOMIC_MMU_DECLS
>   accel/tcg: Expand ATOMIC_MMU_LOOKUP_*
>   trace: Fold mem-internal.h into mem.h
>   accel/tcg: Push trace info building into atomic_common.c.inc
> 
>  configure                     |   7 -
>  accel/tcg/atomic_template.h   | 141 +++++++++-----------
>  accel/tcg/tcg-runtime.h       |  46 -------
>  include/qemu/atomic.h         | 243 ++++------------------------------
>  include/qemu/stats64.h        |   2 +-
>  include/tcg/tcg.h             |  78 +++++------
>  softmmu/timers-state.h        |   2 +-
>  trace/mem-internal.h          |  50 -------
>  trace/mem.h                   |  50 +++++--
>  accel/tcg/cputlb.c            |  49 +------
>  accel/tcg/user-exec.c         |  41 +++---
>  linux-user/hppa/cpu_loop.c    |   2 +-
>  plugins/core.c                |   2 +-
>  target/arm/helper-a64.c       |   8 +-
>  target/i386/tcg/mem_helper.c  |  15 +--
>  target/m68k/op_helper.c       |  19 +--
>  target/ppc/mem_helper.c       |  16 +--
>  target/s390x/tcg/mem_helper.c |  19 +--
>  tcg/tcg-op.c                  |  47 ++-----
>  util/qsp.c                    |   4 +-
>  accel/tcg/atomic_common.c.inc | 107 +++++++++++++--
>  21 files changed, 321 insertions(+), 627 deletions(-)
>  delete mode 100644 trace/mem-internal.h
> 

This series fixes the clang i686 build issue for me. Thanks Richard!

Tested-by: Cole Robinson <crobinso@redhat.com>

- Cole