Message ID | 1468834075-25669-1-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show |
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
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
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
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
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
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
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
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