qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL v2 00/29] Misc patches for 2023-01-10
@ 2023-01-12 13:43 Paolo Bonzini
  2023-01-12 13:43 ` [PULL v2 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paolo Bonzini @ 2023-01-12 13:43 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit aa96ab7c9df59c615ca82b49c9062819e0a1c287:

  Merge tag 'pull-request-2023-01-09' of https://gitlab.com/thuth/qemu into staging (2023-01-09 15:54:31 +0000)

are available in the Git repository at:

  https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 75cc286485742feeb00f4b446f5682765792323e:

  configure: remove backwards-compatibility code (2023-01-11 10:44:35 +0100)

----------------------------------------------------------------
* Atomic memslot updates for KVM (Emanuele, David)
* libvhost-user/libvduse warnings fixes (Marcel)
* i386 TCG fixes (Joe, myself)
* Remove compilation errors when -Werror=maybe-uninitialized (Eric)
* fix GLIB_VERSION for cross-compilation (Paolo)

----------------------------------------------------------------
patch 6: replace with newer version
patch 14: disable warning in testfloat submodule

Daniel P. Berrangé (8):
      gitlab: remove redundant setting of PKG_CONFIG_PATH
      disas: add G_GNUC_PRINTF to gstring_printf
      hw/xen: use G_GNUC_PRINTF/SCANF for various functions
      tools/virtiofsd: add G_GNUC_PRINTF for logging functions
      util/error: add G_GNUC_PRINTF for various functions
      tests: add G_GNUC_PRINTF for various functions
      enforce use of G_GNUC_PRINTF attributes
      hw/display: avoid creating empty loadable modules

David Hildenbrand (1):
      kvm: Atomic memslot updates

Emanuele Giuseppe Esposito (2):
      accel: introduce accelerator blocker API
      KVM: keep track of running ioctls

Eric Auger (1):
      target/i386: Remove compilation errors when -Werror=maybe-uninitialized

Joe Richey (1):
      i386: Emit correct error code for 64-bit IDT entry

Marcel Holtmann (12):
      libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
      libvhost-user: Replace typeof with __typeof__
      libvhost-user: Cast rc variable to avoid compiler warning
      libvhost-user: Use unsigned int i for some for-loop iterations
      libvhost-user: Declare uffdio_register early to make it C90 compliant
      libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
      libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
      libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
      libvduse: Fix assignment in vring_set_avail_event
      libvhost-user: Fix assignment in vring_set_avail_event
      libvhost-user: Add extra compiler warnings
      libvduse: Add extra compiler warnings

Paolo Bonzini (4):
      configure: fix GLIB_VERSION for cross-compilation
      chardev: clean up chardev-parallel.c
      target/i386: fix operand size of unary SSE operations
      configure: remove backwards-compatibility code

 .gitlab-ci.d/crossbuild-template.yml      |   9 +-
 accel/accel-blocker.c                     | 154 ++++++++++++++++++++++++++++++
 accel/kvm/kvm-all.c                       | 108 ++++++++++++++++++---
 accel/meson.build                         |   2 +-
 chardev/char-parallel.c                   |  15 +--
 chardev/meson.build                       |   5 +-
 configure                                 |  13 +--
 disas.c                                   |   3 +-
 hw/core/cpu-common.c                      |   2 +
 hw/display/meson.build                    |  20 ++--
 hw/xen/xen-bus.c                          |   1 +
 hw/xen/xen_pvdev.c                        |   1 +
 include/hw/core/cpu.h                     |   3 +
 include/hw/xen/xen-bus-helper.h           |   6 +-
 include/hw/xen/xen-bus.h                  |   3 +-
 include/qemu/osdep.h                      |   5 -
 include/sysemu/accel-blocker.h            |  56 +++++++++++
 include/sysemu/kvm_int.h                  |   8 ++
 subprojects/libvduse/libvduse.c           |   9 +-
 subprojects/libvduse/meson.build          |   8 +-
 subprojects/libvhost-user/libvhost-user.c |  36 ++++---
 subprojects/libvhost-user/meson.build     |   8 +-
 target/i386/ops_sse.h                     |   4 +
 target/i386/tcg/decode-new.c.inc          |  11 ++-
 target/i386/tcg/seg_helper.c              |   8 +-
 tests/fp/meson.build                      |   1 +
 tests/qtest/ahci-test.c                   |   3 +
 tests/qtest/arm-cpu-features.c            |   1 +
 tests/qtest/erst-test.c                   |   2 +-
 tests/qtest/ide-test.c                    |   3 +-
 tests/qtest/ivshmem-test.c                |   4 +-
 tests/qtest/libqmp.c                      |   2 +-
 tests/qtest/libqos/libqos-pc.h            |   6 +-
 tests/qtest/libqos/libqos-spapr.h         |   6 +-
 tests/qtest/libqos/libqos.h               |   6 +-
 tests/qtest/libqos/virtio-9p.c            |   1 +
 tests/qtest/migration-helpers.h           |   1 +
 tests/qtest/rtas-test.c                   |   2 +-
 tests/qtest/usb-hcd-uhci-test.c           |   4 +-
 tests/unit/test-qmp-cmds.c                |  13 ++-
 tools/virtiofsd/fuse_log.c                |   1 +
 tools/virtiofsd/fuse_log.h                |   6 +-
 tools/virtiofsd/passthrough_ll.c          |   1 +
 util/error-report.c                       |   1 +
 util/error.c                              |   1 +
 util/meson.build                          |   2 +-
 46 files changed, 456 insertions(+), 109 deletions(-)
 create mode 100644 accel/accel-blocker.c
 create mode 100644 include/sysemu/accel-blocker.h
-- 
2.38.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL v2 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized
  2023-01-12 13:43 [PULL v2 00/29] Misc patches for 2023-01-10 Paolo Bonzini
@ 2023-01-12 13:43 ` Paolo Bonzini
  2023-01-12 13:43 ` [PULL v2 14/29] enforce use of G_GNUC_PRINTF attributes Paolo Bonzini
  2023-01-12 15:42 ` [PULL v2 00/29] Misc patches for 2023-01-10 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2023-01-12 13:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Auger

From: Eric Auger <eric.auger@redhat.com>

To avoid compilation errors when -Werror=maybe-uninitialized is used,
add a default case with g_assert_not_reached().

Otherwise with GCC 11.3.1 "cc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)"
we get:

../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’:
../target/i386/ops_sse.h:2495:13: error: ‘r3’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
     2495 |     d->Q(3) = r3;
          |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2494:13: error: ‘r2’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
     2494 |     d->Q(2) = r2;
          |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2493:13: error: ‘r1’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
     2493 |     d->Q(1) = r1;
          |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2492:13: error: ‘r0’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
     2492 |     d->Q(0) = r0;
          |     ~~~~~~~~^~~~

Signed-off-by: Eric Auger <eric.auger@redhat.com>

Message-Id: <20221222140158.1260748-1-eric.auger@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/ops_sse.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index 3cbc36a59d1a..0bd6bfad8a17 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -2470,6 +2470,8 @@ void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order)
         r0 = s->Q(2);
         r1 = s->Q(3);
         break;
+    default: /* default case added to help the compiler to avoid warnings */
+        g_assert_not_reached();
     }
     switch ((order >> 4) & 3) {
     case 0:
@@ -2488,6 +2490,8 @@ void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order)
         r2 = s->Q(2);
         r3 = s->Q(3);
         break;
+    default: /* default case added to help the compiler to avoid warnings */
+        g_assert_not_reached();
     }
     d->Q(0) = r0;
     d->Q(1) = r1;
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PULL v2 14/29] enforce use of G_GNUC_PRINTF attributes
  2023-01-12 13:43 [PULL v2 00/29] Misc patches for 2023-01-10 Paolo Bonzini
  2023-01-12 13:43 ` [PULL v2 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized Paolo Bonzini
@ 2023-01-12 13:43 ` Paolo Bonzini
  2023-01-12 15:42 ` [PULL v2 00/29] Misc patches for 2023-01-10 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2023-01-12 13:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

We've been very gradually adding G_GNUC_PRINTF annotations
to functions over years. This has been useful in detecting
certain malformed printf strings, or cases where we pass
user data as the printf format which is a potential security
flaw.

Given the inherant memory corruption danger in use of format
strings vs mis-matched variadic arguments, it is worth applying
G_GNUC_PRINTF to all functions using printf, even if we know
they are safe.

The compilers can reasonably reliably identify such places
with the -Wsuggest-attribute=format / -Wmissing-format-attribute
flags.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221219130205.687815-7-berrange@redhat.com>
[-Wsuggest-attribute=format and -Wmissing-format-attribute are
 synonyms, only include one; disable it for testfloat. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure            | 1 +
 tests/fp/meson.build | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configure b/configure
index 6f5e77a71361..643aed7533c2 100755
--- a/configure
+++ b/configure
@@ -1183,6 +1183,7 @@ add_to warn_flags -Wnested-externs
 add_to warn_flags -Wendif-labels
 add_to warn_flags -Wexpansion-to-defined
 add_to warn_flags -Wimplicit-fallthrough=2
+add_to warn_flags -Wmissing-format-attribute
 
 nowarn_flags=
 add_to nowarn_flags -Wno-initializer-overrides
diff --git a/tests/fp/meson.build b/tests/fp/meson.build
index 6258e2bd7d13..312a4d301fd9 100644
--- a/tests/fp/meson.build
+++ b/tests/fp/meson.build
@@ -37,6 +37,7 @@ tfcflags = [
   '-Wno-missing-prototypes',
   '-Wno-return-type',
   '-Wno-unused-function',
+  '-Wno-missing-format-attribute',
   '-Wno-error',
 ]
 
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PULL v2 00/29] Misc patches for 2023-01-10
  2023-01-12 13:43 [PULL v2 00/29] Misc patches for 2023-01-10 Paolo Bonzini
  2023-01-12 13:43 ` [PULL v2 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized Paolo Bonzini
  2023-01-12 13:43 ` [PULL v2 14/29] enforce use of G_GNUC_PRINTF attributes Paolo Bonzini
@ 2023-01-12 15:42 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-01-12 15:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Thu, 12 Jan 2023 at 13:45, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit aa96ab7c9df59c615ca82b49c9062819e0a1c287:
>
>   Merge tag 'pull-request-2023-01-09' of https://gitlab.com/thuth/qemu into staging (2023-01-09 15:54:31 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 75cc286485742feeb00f4b446f5682765792323e:
>
>   configure: remove backwards-compatibility code (2023-01-11 10:44:35 +0100)
>
> ----------------------------------------------------------------
> * Atomic memslot updates for KVM (Emanuele, David)
> * libvhost-user/libvduse warnings fixes (Marcel)
> * i386 TCG fixes (Joe, myself)
> * Remove compilation errors when -Werror=maybe-uninitialized (Eric)
> * fix GLIB_VERSION for cross-compilation (Paolo)
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-12 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12 13:43 [PULL v2 00/29] Misc patches for 2023-01-10 Paolo Bonzini
2023-01-12 13:43 ` [PULL v2 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized Paolo Bonzini
2023-01-12 13:43 ` [PULL v2 14/29] enforce use of G_GNUC_PRINTF attributes Paolo Bonzini
2023-01-12 15:42 ` [PULL v2 00/29] Misc patches for 2023-01-10 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).