qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/51] Build system, i386 changes for 2023-09-07
@ 2023-09-07 12:59 Paolo Bonzini
  2023-09-07 12:59 ` [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
                   ` (51 more replies)
  0 siblings, 52 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 17780edd81d27fcfdb7a802efc870a99788bd2fc:

  Merge tag 'quick-fix-pull-request' of https://gitlab.com/bsdimp/qemu into staging (2023-08-31 10:06:29 -0400)

are available in the Git repository at:

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

for you to fetch changes up to 34e8182053c065e5e99017f798fb79259e26f583:

  docs/system/replay: do not show removed command line option (2023-09-07 13:32:37 +0200)

----------------------------------------------------------------
* only build util/async-teardown.c when system build is requested
* target/i386: fix BQL handling of the legacy FERR interrupts
* target/i386: fix memory operand size for CVTPS2PD
* target/i386: Add support for AMX-COMPLEX in CPUID enumeration
* compile plugins on Darwin
* configure and meson cleanups
* drop mkvenv support for Python 3.7 and Debian10
* add wrap file for libblkio
* tweak KVM stubs

----------------------------------------------------------------
Michael Tokarev (8):
      include/sysemu/os-posix.h: move *daemonize* declarations together
      os-posix.c: create and export os_set_runas()
      os-posix.c: create and export os_set_chroot()
      os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init()
      os-posix.c: move code around
      os-posix.c: remove unneeded #includes
      softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c
      util/async-teardown.c: move to softmmu/, only build it when system build is requested

Paolo Bonzini (25):
      linux-user, bsd-user: disable on unsupported host architectures
      target/i386: raise FERR interrupt with iothread locked
      target/i386: generalize operand size "ph" for use in CVTPS2PD
      target/i386: fix memory operand size for CVTPS2PD
      contrib/plugins: remove -soname argument
      contrib/plugins: add Darwin support
      meson: do not unnecessarily use cmake for dependencies
      meson: update unsupported host/CPU messages
      configure: remove HOST_CC
      configure: create native file with contents of $host_cc
      meson: compile bundled device trees
      configure: remove boolean variables for targets
      configure: move --enable-debug-tcg to meson
      contrib/plugins: use an independent makefile
      configure: unify recursion into sub-Makefiles
      configure, meson: move --enable-plugins to meson
      configure, meson: remove CONFIG_SOLARIS from config-host.mak
      configure, meson: remove target OS symbols from config-host.mak
      meson: list leftover CONFIG_* symbols
      configure: remove dead code
      Python: Drop support for Python 3.7
      mkvenv: assume presence of importlib.metadata
      Revert "mkvenv: work around broken pip installations on Debian 10"
      subprojects: add wrap file for libblkio
      docs/system/replay: do not show removed command line option

Philippe Mathieu-Daudé (17):
      contrib/plugins/cache: Fix string format
      contrib/plugins/drcov: Fix string format
      contrib/plugins/howvec: Fix string format
      contrib/plugins/lockstep: Fix string format
      hw/i386/pc: Include missing 'sysemu/tcg.h' header
      hw/i386/pc: Include missing 'cpu.h' header
      hw/i386/fw_cfg: Include missing 'cpu.h' header
      target/i386/helper: Restrict KVM declarations to system emulation
      target/i386/cpu-sysemu: Inline kvm_apic_in_kernel()
      target/i386: Remove unused KVM stubs
      target/i386: Allow elision of kvm_enable_x2apic()
      target/i386: Allow elision of kvm_hv_vpindex_settable()
      target/i386: Restrict declarations specific to CONFIG_KVM
      sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets
      sysemu/kvm: Restrict kvm_get_apic_state() to x86 targets
      sysemu/kvm: Restrict kvm_has_pit_state2() to x86 targets
      sysemu/kvm: Restrict kvm_pc_setup_irq_routing() to x86 targets

Tao Su (1):
      target/i386: Add support for AMX-COMPLEX in CPUID enumeration

 Makefile                                  |  29 ++--
 accel/tcg/meson.build                     |   4 +-
 chardev/meson.build                       |   2 +-
 configure                                 | 176 +++++++------------
 contrib/plugins/Makefile                  |  22 ++-
 contrib/plugins/cache.c                   |  19 ++-
 contrib/plugins/drcov.c                   |   2 +-
 contrib/plugins/howvec.c                  |   6 +-
 contrib/plugins/lockstep.c                |  11 +-
 docs/devel/build-system.rst               |   8 +-
 docs/devel/kconfig.rst                    |   2 +-
 docs/system/replay.rst                    |   2 +-
 gdbstub/meson.build                       |   4 +-
 hw/i386/fw_cfg.c                          |   1 +
 hw/i386/intel_iommu.c                     |   2 +-
 hw/i386/kvm/i8254.c                       |   1 +
 hw/i386/kvm/ioapic.c                      |   1 +
 hw/i386/pc_piix.c                         |   1 +
 hw/i386/pc_q35.c                          |   2 +
 hw/i386/x86.c                             |  11 +-
 include/qemu/qemu-options.h               |  41 -----
 include/sysemu/kvm.h                      |  10 --
 include/sysemu/os-posix.h                 |  10 +-
 include/sysemu/os-win32.h                 |   1 -
 meson.build                               | 111 +++++++-----
 meson_options.txt                         |   4 +
 net/meson.build                           |  18 +-
 os-posix.c                                | 157 +++++------------
 pc-bios/Makefile                          |  19 ---
 pc-bios/meson.build                       |  25 ++-
 plugins/meson.build                       |  12 +-
 python/Makefile                           |   8 +-
 python/scripts/mkvenv.py                  | 272 +++++-------------------------
 python/setup.cfg                          |  16 +-
 python/tests/minreqs.txt                  |   2 +-
 qga/meson.build                           |   4 +-
 scripts/meson-buildoptions.sh             |   6 +
 scripts/qapi/mypy.ini                     |   2 +-
 {util => softmmu}/async-teardown.c        |   0
 softmmu/meson.build                       |   1 +
 softmmu/vl.c                              |  87 +++++++++-
 storage-daemon/meson.build                |   2 +-
 subprojects/libblkio.wrap                 |   6 +
 target/i386/cpu-sysemu.c                  |   4 +-
 target/i386/cpu.c                         |   2 +-
 target/i386/cpu.h                         |   2 +
 target/i386/helper.c                      |   2 +-
 target/i386/kvm/kvm-stub.c                |  51 ------
 target/i386/kvm/kvm.c                     |   4 +-
 target/i386/kvm/kvm_i386.h                |  36 ++--
 target/i386/kvm/meson.build               |   2 -
 target/i386/tcg/decode-new.c.inc          |  20 ++-
 target/i386/tcg/decode-new.h              |   2 +-
 target/i386/tcg/emit.c.inc                |  30 +++-
 target/i386/tcg/sysemu/fpu_helper.c       |   6 +
 target/i386/tcg/translate.c               |   8 +-
 tcg/meson.build                           |   2 +-
 tests/Makefile.include                    |   2 +-
 tests/meson.build                         |   8 +-
 tests/migration/meson.build               |   2 +-
 tests/qtest/meson.build                   |  14 +-
 tests/tcg/tricore/Makefile.softmmu-target |   2 +-
 tests/unit/meson.build                    |   6 +-
 util/meson.build                          |   1 -
 64 files changed, 551 insertions(+), 775 deletions(-)
 delete mode 100644 include/qemu/qemu-options.h
 delete mode 100644 pc-bios/Makefile
 rename {util => softmmu}/async-teardown.c (100%)
 create mode 100644 subprojects/libblkio.wrap
 delete mode 100644 target/i386/kvm/kvm-stub.c
-- 
2.41.0



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

* [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 02/51] target/i386: raise FERR interrupt with iothread locked Paolo Bonzini
                   ` (50 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

Safe signal handling around system calls is mandatory for user-mode
emulation, and requires a small piece of handwritten assembly code.
So refuse to compile unless the common-user/host subdirectory exists
for the host architecture that was detected or selected with --cpu.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index b9bd008592a..b9af8282293 100755
--- a/configure
+++ b/configure
@@ -871,30 +871,36 @@ fi
 default_target_list=""
 mak_wilds=""
 
-if [ "$linux_user" != no ]; then
-    if [ "$targetos" = linux ] && [ -n "$host_arch" ]; then
-        linux_user=yes
-    elif [ "$linux_user" = yes ]; then
-        error_exit "linux-user not supported on this architecture"
+if [ -n "$host_arch" ] && [ -d "$source_path/common-user/host/$host_arch" ]; then
+    if [ "$linux_user" != no ]; then
+        if [ "$targetos" = linux ]; then
+            linux_user=yes
+        elif [ "$linux_user" = yes ]; then
+            error_exit "linux-user not supported on this architecture"
+        fi
+        if [ "$linux_user" = "yes" ]; then
+            mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
+        fi
     fi
-fi
-if [ "$bsd_user" != no ]; then
-    if [ "$bsd_user" = "" ]; then
-        test $targetos = freebsd && bsd_user=yes
+    if [ "$bsd_user" != no ]; then
+        if [ "$bsd_user" = "" ]; then
+            test $targetos = freebsd && bsd_user=yes
+        fi
+        if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
+            error_exit "bsd-user not supported on this host OS"
+        fi
+        if [ "$bsd_user" = "yes" ]; then
+            mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
+        fi
     fi
-    if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
-        error_exit "bsd-user not supported on this host OS"
+else
+    if [ "$linux_user" = yes ] || [ "$bsd_user" = yes ]; then
+        error_exit "user mode emulation not supported on this architecture"
     fi
 fi
 if [ "$softmmu" = "yes" ]; then
     mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak"
 fi
-if [ "$linux_user" = "yes" ]; then
-    mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
-fi
-if [ "$bsd_user" = "yes" ]; then
-    mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
-fi
 
 for config in $mak_wilds; do
     target="$(basename "$config" .mak)"
-- 
2.41.0



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

* [PULL 02/51] target/i386: raise FERR interrupt with iothread locked
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
  2023-09-07 12:59 ` [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 03/51] target/i386: generalize operand size "ph" for use in CVTPS2PD Paolo Bonzini
                   ` (49 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Philippe Mathieu-Daudé

Otherwise tcg_handle_interrupt() triggers an assertion failure:

  #5  0x0000555555c97369 in tcg_handle_interrupt (cpu=0x555557434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:83
  #6  tcg_handle_interrupt (cpu=0x555557434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:81
  #7  0x0000555555b4d58b in pic_irq_request (opaque=<optimized out>, irq=<optimized out>, level=1) at ../hw/i386/x86.c:555
  #8  0x0000555555b4f218 in gsi_handler (opaque=0x5555579423d0, n=13, level=1) at ../hw/i386/x86.c:611
  #9  0x00007fffa42bde14 in code_gen_buffer ()
  #10 0x0000555555c724bb in cpu_tb_exec (cpu=cpu@entry=0x555557434cb0, itb=<optimized out>, tb_exit=tb_exit@entry=0x7fffe9bfd658) at ../accel/tcg/cpu-exec.c:457

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1808
Reported-by: NyanCatTW1 <https://gitlab.com/a0939712328>
Co-developed-by: Richard Henderson <richard.henderson@linaro.org>'
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/sysemu/fpu_helper.c | 6 ++++++
 target/i386/tcg/translate.c         | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/target/i386/tcg/sysemu/fpu_helper.c b/target/i386/tcg/sysemu/fpu_helper.c
index 1c3610da3b9..93506cdd94e 100644
--- a/target/i386/tcg/sysemu/fpu_helper.c
+++ b/target/i386/tcg/sysemu/fpu_helper.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/main-loop.h"
 #include "cpu.h"
 #include "hw/irq.h"
 
@@ -31,7 +32,9 @@ void x86_register_ferr_irq(qemu_irq irq)
 void fpu_check_raise_ferr_irq(CPUX86State *env)
 {
     if (ferr_irq && !(env->hflags2 & HF2_IGNNE_MASK)) {
+        qemu_mutex_lock_iothread();
         qemu_irq_raise(ferr_irq);
+        qemu_mutex_unlock_iothread();
         return;
     }
 }
@@ -45,6 +48,9 @@ void cpu_clear_ignne(void)
 void cpu_set_ignne(void)
 {
     CPUX86State *env = &X86_CPU(first_cpu)->env;
+
+    assert(qemu_mutex_iothread_locked());
+
     env->hflags2 |= HF2_IGNNE_MASK;
     /*
      * We get here in response to a write to port F0h.  The chipset should
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 90c7b32f362..e0a622941cb 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -4619,7 +4619,11 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
                 case 0x0a: /* grp d9/2 */
                     switch (rm) {
                     case 0: /* fnop */
-                        /* check exceptions (FreeBSD FPU probe) */
+                        /*
+                         * check exceptions (FreeBSD FPU probe)
+                         * needs to be treated as I/O because of ferr_irq
+                         */
+                        translator_io_start(&s->base);
                         gen_helper_fwait(cpu_env);
                         update_fip = false;
                         break;
@@ -5548,6 +5552,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
             (HF_MP_MASK | HF_TS_MASK)) {
             gen_exception(s, EXCP07_PREX);
         } else {
+            /* needs to be treated as I/O because of ferr_irq */
+            translator_io_start(&s->base);
             gen_helper_fwait(cpu_env);
         }
         break;
-- 
2.41.0



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

* [PULL 03/51] target/i386: generalize operand size "ph" for use in CVTPS2PD
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
  2023-09-07 12:59 ` [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
  2023-09-07 12:59 ` [PULL 02/51] target/i386: raise FERR interrupt with iothread locked Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 04/51] target/i386: fix memory operand size for CVTPS2PD Paolo Bonzini
                   ` (48 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

CVTPS2PD only loads a half-register for memory, like CVTPH2PS.  It can
reuse the "ph" packed half-precision size to load a half-register,
but rename it to "xh" because it is now a variation of "x" (it is not
used only for half-precision values).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/decode-new.c.inc | 6 +++---
 target/i386/tcg/decode-new.h     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index 8f93a239ddb..43c39aad2aa 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -337,7 +337,7 @@ static const X86OpEntry opcodes_0F38_00toEF[240] = {
     [0x07] = X86_OP_ENTRY3(PHSUBSW,   V,x,  H,x,   W,x,  vex4 cpuid(SSSE3) mmx avx2_256 p_00_66),
 
     [0x10] = X86_OP_ENTRY2(PBLENDVB,  V,x,         W,x,  vex4 cpuid(SSE41) avx2_256 p_66),
-    [0x13] = X86_OP_ENTRY2(VCVTPH2PS, V,x,         W,ph, vex11 cpuid(F16C) p_66),
+    [0x13] = X86_OP_ENTRY2(VCVTPH2PS, V,x,         W,xh, vex11 cpuid(F16C) p_66),
     [0x14] = X86_OP_ENTRY2(BLENDVPS,  V,x,         W,x,  vex4 cpuid(SSE41) p_66),
     [0x15] = X86_OP_ENTRY2(BLENDVPD,  V,x,         W,x,  vex4 cpuid(SSE41) p_66),
     /* Listed incorrectly as type 4 */
@@ -565,7 +565,7 @@ static const X86OpEntry opcodes_0F3A[256] = {
     [0x15] = X86_OP_ENTRY3(PEXTRW,     E,w,  V,dq, I,b,  vex5 cpuid(SSE41) zext0 p_66),
     [0x16] = X86_OP_ENTRY3(PEXTR,      E,y,  V,dq, I,b,  vex5 cpuid(SSE41) p_66),
     [0x17] = X86_OP_ENTRY3(VEXTRACTPS, E,d,  V,dq, I,b,  vex5 cpuid(SSE41) p_66),
-    [0x1d] = X86_OP_ENTRY3(VCVTPS2PH,  W,ph, V,x,  I,b,  vex11 cpuid(F16C) p_66),
+    [0x1d] = X86_OP_ENTRY3(VCVTPS2PH,  W,xh, V,x,  I,b,  vex11 cpuid(F16C) p_66),
 
     [0x20] = X86_OP_ENTRY4(PINSRB,     V,dq, H,dq, E,b,  vex5 cpuid(SSE41) zext2 p_66),
     [0x21] = X86_OP_GROUP0(VINSERTPS),
@@ -1104,7 +1104,7 @@ static bool decode_op_size(DisasContext *s, X86OpEntry *e, X86OpSize size, MemOp
         *ot = s->vex_l ? MO_256 : MO_128;
         return true;
 
-    case X86_SIZE_ph: /* SSE/AVX packed half precision */
+    case X86_SIZE_xh: /* SSE/AVX packed half register */
         *ot = s->vex_l ? MO_128 : MO_64;
         return true;
 
diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h
index cb6b8bcf678..a542ec16813 100644
--- a/target/i386/tcg/decode-new.h
+++ b/target/i386/tcg/decode-new.h
@@ -92,7 +92,7 @@ typedef enum X86OpSize {
     /* Custom */
     X86_SIZE_d64,
     X86_SIZE_f64,
-    X86_SIZE_ph, /* SSE/AVX packed half precision */
+    X86_SIZE_xh, /* SSE/AVX packed half register */
 } X86OpSize;
 
 typedef enum X86CPUIDFeature {
-- 
2.41.0



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

* [PULL 04/51] target/i386: fix memory operand size for CVTPS2PD
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 03/51] target/i386: generalize operand size "ph" for use in CVTPS2PD Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 05/51] target/i386: Add support for AMX-COMPLEX in CPUID enumeration Paolo Bonzini
                   ` (47 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

CVTPS2PD only loads a half-register for memory, unlike the other
operations under 0x0F 0x5A.  "Unpack" the group into separate
emission functions instead of using gen_unary_fp_sse.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/decode-new.c.inc | 14 ++++++++++++--
 target/i386/tcg/emit.c.inc       | 30 +++++++++++++++++++++++++-----
 2 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index 43c39aad2aa..0db19cda3b7 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -805,10 +805,20 @@ static void decode_sse_unary(DisasContext *s, CPUX86State *env, X86OpEntry *entr
     case 0x51: entry->gen = gen_VSQRT; break;
     case 0x52: entry->gen = gen_VRSQRT; break;
     case 0x53: entry->gen = gen_VRCP; break;
-    case 0x5A: entry->gen = gen_VCVTfp2fp; break;
     }
 }
 
+static void decode_0F5A(DisasContext *s, CPUX86State *env, X86OpEntry *entry, uint8_t *b)
+{
+    static const X86OpEntry opcodes_0F5A[4] = {
+        X86_OP_ENTRY2(VCVTPS2PD,  V,x,       W,xh, vex2),      /* VCVTPS2PD */
+        X86_OP_ENTRY2(VCVTPD2PS,  V,x,       W,x,  vex2),      /* VCVTPD2PS */
+        X86_OP_ENTRY3(VCVTSS2SD,  V,x,  H,x, W,x,  vex2_rep3), /* VCVTSS2SD */
+        X86_OP_ENTRY3(VCVTSD2SS,  V,x,  H,x, W,x,  vex2_rep3), /* VCVTSD2SS */
+    };
+    *entry = *decode_by_prefix(s, opcodes_0F5A);
+}
+
 static void decode_0F5B(DisasContext *s, CPUX86State *env, X86OpEntry *entry, uint8_t *b)
 {
     static const X86OpEntry opcodes_0F5B[4] = {
@@ -891,7 +901,7 @@ static const X86OpEntry opcodes_0F[256] = {
 
     [0x58] = X86_OP_ENTRY3(VADD,       V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2),
     [0x59] = X86_OP_ENTRY3(VMUL,       V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2),
-    [0x5a] = X86_OP_GROUP3(sse_unary,  V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), /* CVTPS2PD */
+    [0x5a] = X86_OP_GROUP0(0F5A),
     [0x5b] = X86_OP_GROUP0(0F5B),
     [0x5c] = X86_OP_ENTRY3(VSUB,       V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2),
     [0x5d] = X86_OP_ENTRY3(VMIN,       V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2),
diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
index 4fe8dec4274..45a3e55cbfb 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -1914,12 +1914,22 @@ static void gen_VCOMI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
     set_cc_op(s, CC_OP_EFLAGS);
 }
 
-static void gen_VCVTfp2fp(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
+static void gen_VCVTPD2PS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
 {
-    gen_unary_fp_sse(s, env, decode,
-                     gen_helper_cvtpd2ps_xmm, gen_helper_cvtps2pd_xmm,
-                     gen_helper_cvtpd2ps_ymm, gen_helper_cvtps2pd_ymm,
-                     gen_helper_cvtsd2ss, gen_helper_cvtss2sd);
+    if (s->vex_l) {
+        gen_helper_cvtpd2ps_ymm(cpu_env, OP_PTR0, OP_PTR2);
+    } else {
+        gen_helper_cvtpd2ps_xmm(cpu_env, OP_PTR0, OP_PTR2);
+    }
+}
+
+static void gen_VCVTPS2PD(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
+{
+    if (s->vex_l) {
+        gen_helper_cvtps2pd_ymm(cpu_env, OP_PTR0, OP_PTR2);
+    } else {
+        gen_helper_cvtps2pd_xmm(cpu_env, OP_PTR0, OP_PTR2);
+    }
 }
 
 static void gen_VCVTPS2PH(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
@@ -1936,6 +1946,16 @@ static void gen_VCVTPS2PH(DisasContext *s, CPUX86State *env, X86DecodedInsn *dec
     }
 }
 
+static void gen_VCVTSD2SS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
+{
+    gen_helper_cvtsd2ss(cpu_env, OP_PTR0, OP_PTR1, OP_PTR2);
+}
+
+static void gen_VCVTSS2SD(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
+{
+    gen_helper_cvtss2sd(cpu_env, OP_PTR0, OP_PTR1, OP_PTR2);
+}
+
 static void gen_VCVTSI2Sx(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
 {
     int vec_len = vector_len(s, decode);
-- 
2.41.0



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

* [PULL 05/51] target/i386: Add support for AMX-COMPLEX in CPUID enumeration
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 04/51] target/i386: fix memory operand size for CVTPS2PD Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 06/51] include/sysemu/os-posix.h: move *daemonize* declarations together Paolo Bonzini
                   ` (46 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Tao Su, Xiaoyao Li

From: Tao Su <tao1.su@linux.intel.com>

Latest Intel platform GraniteRapids-D introduces AMX-COMPLEX, which adds
two instructions to perform matrix multiplication of two tiles containing
complex elements and accumulate the results into a packed single precision
tile.

AMX-COMPLEX is enumerated via CPUID.(EAX=7,ECX=1):EDX[bit 8]. Add the CPUID
definition for AMX-COMPLEX, AMX-COMPLEX will be enabled automatically when
using '-cpu host' and KVM advertises AMX-COMPLEX to userspace.

Signed-off-by: Tao Su <tao1.su@linux.intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20230830074324.84059-1-tao1.su@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 00f913b6382..24ee67b42d0 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -980,7 +980,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .feat_names = {
             NULL, NULL, NULL, NULL,
             "avx-vnni-int8", "avx-ne-convert", NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            "amx-complex", NULL, NULL, NULL,
             NULL, NULL, "prefetchiti", NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index a6000e93bd8..fbb05eace57 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -930,6 +930,8 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
 #define CPUID_7_1_EDX_AVX_VNNI_INT8     (1U << 4)
 /* AVX NE CONVERT Instructions */
 #define CPUID_7_1_EDX_AVX_NE_CONVERT    (1U << 5)
+/* AMX COMPLEX Instructions */
+#define CPUID_7_1_EDX_AMX_COMPLEX       (1U << 8)
 /* PREFETCHIT0/1 Instructions */
 #define CPUID_7_1_EDX_PREFETCHITI       (1U << 14)
 
-- 
2.41.0



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

* [PULL 06/51] include/sysemu/os-posix.h: move *daemonize* declarations together
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 05/51] target/i386: Add support for AMX-COMPLEX in CPUID enumeration Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 07/51] os-posix.c: create and export os_set_runas() Paolo Bonzini
                   ` (45 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-2-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/os-posix.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 1030d39904a..65b9c94e919 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -47,13 +47,12 @@ void os_set_line_buffering(void);
 void os_setup_early_signal_handling(void);
 void os_set_proc_name(const char *s);
 void os_setup_signal_handling(void);
+int os_set_daemonize(bool d);
+bool is_daemonized(void);
 void os_daemonize(void);
 void os_setup_post(void);
 int os_mlock(void);
 
-int os_set_daemonize(bool d);
-bool is_daemonized(void);
-
 /**
  * qemu_alloc_stack:
  * @sz: pointer to a size_t holding the requested usable stack size
-- 
2.41.0



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

* [PULL 07/51] os-posix.c: create and export os_set_runas()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 06/51] include/sysemu/os-posix.h: move *daemonize* declarations together Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 08/51] os-posix.c: create and export os_set_chroot() Paolo Bonzini
                   ` (44 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake, Richard Henderson

From: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20230901101302.3618955-3-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/os-posix.h |  1 +
 os-posix.c                | 23 ++++++++++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 65b9c94e919..d32630f9e76 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -50,6 +50,7 @@ void os_setup_signal_handling(void);
 int os_set_daemonize(bool d);
 bool is_daemonized(void);
 void os_daemonize(void);
+bool os_set_runas(const char *optarg);
 void os_setup_post(void);
 int os_mlock(void);
 
diff --git a/os-posix.c b/os-posix.c
index cfcb96533c1..f0ee5c8b002 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -102,8 +102,14 @@ void os_set_proc_name(const char *s)
 #endif
 }
 
-
-static bool os_parse_runas_uid_gid(const char *optarg)
+/*
+ * Prepare to change user ID. optarg can be one of 3 forms:
+ *   - a username, in which case user ID will be changed to its uid,
+ *     with primary and supplementary groups set up too;
+ *   - a numeric uid, in which case only the uid will be set;
+ *   - a pair of numeric uid:gid.
+ */
+bool os_set_runas(const char *optarg)
 {
     unsigned long lv;
     const char *ep;
@@ -111,6 +117,13 @@ static bool os_parse_runas_uid_gid(const char *optarg)
     gid_t got_gid;
     int rc;
 
+    user_pwd = getpwnam(optarg);
+    if (user_pwd) {
+        user_uid = -1;
+        user_gid = -1;
+        return true;
+    }
+
     rc = qemu_strtoul(optarg, &ep, 0, &lv);
     got_uid = lv; /* overflow here is ID in C99 */
     if (rc || *ep != ':' || got_uid != lv || got_uid == (uid_t)-1) {
@@ -137,11 +150,7 @@ int os_parse_cmd_args(int index, const char *optarg)
 {
     switch (index) {
     case QEMU_OPTION_runas:
-        user_pwd = getpwnam(optarg);
-        if (user_pwd) {
-            user_uid = -1;
-            user_gid = -1;
-        } else if (!os_parse_runas_uid_gid(optarg)) {
+        if (!os_set_runas(optarg)) {
             error_report("User \"%s\" doesn't exist"
                          " (and is not <uid>:<gid>)",
                          optarg);
-- 
2.41.0



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

* [PULL 08/51] os-posix.c: create and export os_set_chroot()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 07/51] os-posix.c: create and export os_set_runas() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 09/51] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init() Paolo Bonzini
                   ` (43 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-4-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/os-posix.h | 1 +
 os-posix.c                | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index d32630f9e76..8a667633953 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -51,6 +51,7 @@ int os_set_daemonize(bool d);
 bool is_daemonized(void);
 void os_daemonize(void);
 bool os_set_runas(const char *optarg);
+void os_set_chroot(const char *optarg);
 void os_setup_post(void);
 int os_mlock(void);
 
diff --git a/os-posix.c b/os-posix.c
index f0ee5c8b002..ed0787ecfd9 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -159,7 +159,7 @@ int os_parse_cmd_args(int index, const char *optarg)
         break;
     case QEMU_OPTION_chroot:
         warn_report("option is deprecated, use '-run-with chroot=...' instead");
-        chroot_dir = optarg;
+        os_set_chroot(optarg);
         break;
     case QEMU_OPTION_daemonize:
         daemonize = 1;
@@ -184,7 +184,7 @@ int os_parse_cmd_args(int index, const char *optarg)
 #endif
         str = qemu_opt_get(opts, "chroot");
         if (str) {
-            chroot_dir = str;
+            os_set_chroot(str);
         }
         break;
     }
@@ -232,6 +232,11 @@ static void change_process_uid(void)
     }
 }
 
+void os_set_chroot(const char *optarg)
+{
+    chroot_dir = optarg;
+}
+
 static void change_root(void)
 {
     if (chroot_dir) {
-- 
2.41.0



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

* [PULL 09/51] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 08/51] os-posix.c: create and export os_set_chroot() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 10/51] os-posix.c: move code around Paolo Bonzini
                   ` (42 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

This will stop linking softmmu-specific os_parse_cmd_args() into every
qemu executable which happens to use other functions from os-posix.c,
such as os_set_line_buffering() or os_setup_signal_handling().

Also, since there's no win32-specific options, *all* option parsing is
now done in softmmu/vl.c:qemu_init(), which is easier to read without
extra indirection, - all options are in the single function now.

This effectively reverts commit 59a5264b99434.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-5-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/os-posix.h |  1 -
 include/sysemu/os-win32.h |  1 -
 os-posix.c                | 82 ---------------------------------------
 softmmu/vl.c              | 76 ++++++++++++++++++++++++++++++++++--
 4 files changed, 73 insertions(+), 87 deletions(-)

diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 8a667633953..6dfdcbb0863 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -42,7 +42,6 @@
 extern "C" {
 #endif
 
-int os_parse_cmd_args(int index, const char *optarg);
 void os_set_line_buffering(void);
 void os_setup_early_signal_handling(void);
 void os_set_proc_name(const char *s);
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 91aa0d7ec04..8ae30fac159 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -101,7 +101,6 @@ static inline void os_setup_signal_handling(void) {}
 static inline void os_daemonize(void) {}
 static inline void os_setup_post(void) {}
 static inline void os_set_proc_name(const char *dummy) {}
-static inline int os_parse_cmd_args(int index, const char *optarg) { return -1; }
 void os_set_line_buffering(void);
 void os_setup_early_signal_handling(void);
 
diff --git a/os-posix.c b/os-posix.c
index ed0787ecfd9..fc2883ff82c 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -31,18 +31,13 @@
 
 /* Needed early for CONFIG_BSD etc. */
 #include "net/slirp.h"
-#include "qemu/qemu-options.h"
 #include "qemu/error-report.h"
 #include "qemu/log.h"
 #include "sysemu/runstate.h"
 #include "qemu/cutils.h"
-#include "qemu/config-file.h"
-#include "qemu/option.h"
-#include "qemu/module.h"
 
 #ifdef CONFIG_LINUX
 #include <sys/prctl.h>
-#include "qemu/async-teardown.h"
 #endif
 
 /*
@@ -142,59 +137,6 @@ bool os_set_runas(const char *optarg)
     return true;
 }
 
-/*
- * Parse OS specific command line options.
- * return 0 if option handled, -1 otherwise
- */
-int os_parse_cmd_args(int index, const char *optarg)
-{
-    switch (index) {
-    case QEMU_OPTION_runas:
-        if (!os_set_runas(optarg)) {
-            error_report("User \"%s\" doesn't exist"
-                         " (and is not <uid>:<gid>)",
-                         optarg);
-            exit(1);
-        }
-        break;
-    case QEMU_OPTION_chroot:
-        warn_report("option is deprecated, use '-run-with chroot=...' instead");
-        os_set_chroot(optarg);
-        break;
-    case QEMU_OPTION_daemonize:
-        daemonize = 1;
-        break;
-#if defined(CONFIG_LINUX)
-    /* deprecated */
-    case QEMU_OPTION_asyncteardown:
-        init_async_teardown();
-        break;
-#endif
-    case QEMU_OPTION_run_with: {
-        const char *str;
-        QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"),
-                                                 optarg, false);
-        if (!opts) {
-            exit(1);
-        }
-#if defined(CONFIG_LINUX)
-        if (qemu_opt_get_bool(opts, "async-teardown", false)) {
-            init_async_teardown();
-        }
-#endif
-        str = qemu_opt_get(opts, "chroot");
-        if (str) {
-            os_set_chroot(str);
-        }
-        break;
-    }
-    default:
-        return -1;
-    }
-
-    return 0;
-}
-
 static void change_process_uid(void)
 {
     assert((user_uid == (uid_t)-1) || user_pwd == NULL);
@@ -371,27 +313,3 @@ int os_mlock(void)
     return -ENOSYS;
 #endif
 }
-
-static QemuOptsList qemu_run_with_opts = {
-    .name = "run-with",
-    .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head),
-    .desc = {
-#if defined(CONFIG_LINUX)
-        {
-            .name = "async-teardown",
-            .type = QEMU_OPT_BOOL,
-        },
-#endif
-        {
-            .name = "chroot",
-            .type = QEMU_OPT_STRING,
-        },
-        { /* end of list */ }
-    },
-};
-
-static void register_runwith(void)
-{
-    qemu_add_opts(&qemu_run_with_opts);
-}
-opts_init(register_runwith);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b0b96f67fac..0a74810ca32 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -49,6 +49,7 @@
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "qemu/accel.h"
+#include "qemu/async-teardown.h"
 #include "hw/usb.h"
 #include "hw/isa/isa.h"
 #include "hw/scsi/scsi.h"
@@ -748,6 +749,33 @@ static QemuOptsList qemu_smp_opts = {
     },
 };
 
+#if defined(CONFIG_POSIX)
+static QemuOptsList qemu_run_with_opts = {
+    .name = "run-with",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head),
+    .desc = {
+#if defined(CONFIG_LINUX)
+        {
+            .name = "async-teardown",
+            .type = QEMU_OPT_BOOL,
+        },
+#endif
+        {
+            .name = "chroot",
+            .type = QEMU_OPT_STRING,
+        },
+        { /* end of list */ }
+    },
+};
+
+#define qemu_add_run_with_opts() qemu_add_opts(&qemu_run_with_opts)
+
+#else
+
+#define qemu_add_run_with_opts()
+
+#endif /* CONFIG_POSIX */
+
 static void realtime_init(void)
 {
     if (enable_mlock) {
@@ -2704,6 +2732,7 @@ void qemu_init(int argc, char **argv)
     qemu_add_opts(&qemu_semihosting_config_opts);
     qemu_add_opts(&qemu_fw_cfg_opts);
     qemu_add_opts(&qemu_action_opts);
+    qemu_add_run_with_opts();
     module_call_init(MODULE_INIT_OPTS);
 
     error_init(argv[0]);
@@ -3522,11 +3551,52 @@ void qemu_init(int argc, char **argv)
             case QEMU_OPTION_nouserconfig:
                 /* Nothing to be parsed here. Especially, do not error out below. */
                 break;
-            default:
-                if (os_parse_cmd_args(popt->index, optarg)) {
-                    error_report("Option not supported in this build");
+#if defined(CONFIG_POSIX)
+            case QEMU_OPTION_runas:
+                if (!os_set_runas(optarg)) {
+                    error_report("User \"%s\" doesn't exist"
+                                 " (and is not <uid>:<gid>)",
+                                 optarg);
                     exit(1);
                 }
+                break;
+            case QEMU_OPTION_chroot:
+                warn_report("option is deprecated,"
+                            " use '-run-with chroot=...' instead");
+                os_set_chroot(optarg);
+                break;
+            case QEMU_OPTION_daemonize:
+                os_set_daemonize(true);
+                break;
+#if defined(CONFIG_LINUX)
+            /* deprecated */
+            case QEMU_OPTION_asyncteardown:
+                init_async_teardown();
+                break;
+#endif
+            case QEMU_OPTION_run_with: {
+                const char *str;
+                opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"),
+                                                         optarg, false);
+                if (!opts) {
+                    exit(1);
+                }
+#if defined(CONFIG_LINUX)
+                if (qemu_opt_get_bool(opts, "async-teardown", false)) {
+                    init_async_teardown();
+                }
+#endif
+                str = qemu_opt_get(opts, "chroot");
+                if (str) {
+                    os_set_chroot(str);
+                }
+                break;
+            }
+#endif /* CONFIG_POSIX */
+
+            default:
+                error_report("Option not supported in this build");
+                exit(1);
             }
         }
     }
-- 
2.41.0



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

* [PULL 10/51] os-posix.c: move code around
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 09/51] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 11/51] os-posix.c: remove unneeded #includes Paolo Bonzini
                   ` (41 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

this moves code blocks so that functions and variables which
belongs to the same concept are now close to each other.
There's no actual code changes in there.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-6-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 os-posix.c | 49 +++++++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/os-posix.c b/os-posix.c
index fc2883ff82c..a8e38c02988 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -40,17 +40,6 @@
 #include <sys/prctl.h>
 #endif
 
-/*
- * Must set all three of these at once.
- * Legal combinations are              unset   by name   by uid
- */
-static struct passwd *user_pwd;    /*   NULL   non-NULL   NULL   */
-static uid_t user_uid = (uid_t)-1; /*   -1      -1        >=0    */
-static gid_t user_gid = (gid_t)-1; /*   -1      -1        >=0    */
-
-static const char *chroot_dir;
-static int daemonize;
-static int daemon_pipe;
 
 void os_setup_early_signal_handling(void)
 {
@@ -97,6 +86,15 @@ void os_set_proc_name(const char *s)
 #endif
 }
 
+
+/*
+ * Must set all three of these at once.
+ * Legal combinations are              unset   by name   by uid
+ */
+static struct passwd *user_pwd;    /*   NULL   non-NULL   NULL   */
+static uid_t user_uid = (uid_t)-1; /*   -1      -1        >=0    */
+static gid_t user_gid = (gid_t)-1; /*   -1      -1        >=0    */
+
 /*
  * Prepare to change user ID. optarg can be one of 3 forms:
  *   - a username, in which case user ID will be changed to its uid,
@@ -174,6 +172,9 @@ static void change_process_uid(void)
     }
 }
 
+
+static const char *chroot_dir;
+
 void os_set_chroot(const char *optarg)
 {
     chroot_dir = optarg;
@@ -194,6 +195,21 @@ static void change_root(void)
 
 }
 
+
+static int daemonize;
+static int daemon_pipe;
+
+bool is_daemonized(void)
+{
+    return daemonize;
+}
+
+int os_set_daemonize(bool d)
+{
+    daemonize = d;
+    return 0;
+}
+
 void os_daemonize(void)
 {
     if (daemonize) {
@@ -287,17 +303,6 @@ void os_set_line_buffering(void)
     setvbuf(stdout, NULL, _IOLBF, 0);
 }
 
-bool is_daemonized(void)
-{
-    return daemonize;
-}
-
-int os_set_daemonize(bool d)
-{
-    daemonize = d;
-    return 0;
-}
-
 int os_mlock(void)
 {
 #ifdef HAVE_MLOCKALL
-- 
2.41.0



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

* [PULL 11/51] os-posix.c: remove unneeded #includes
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 10/51] os-posix.c: move code around Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 12/51] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c Paolo Bonzini
                   ` (40 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-7-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 os-posix.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/os-posix.c b/os-posix.c
index a8e38c02988..f90dfda9b0d 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -29,8 +29,6 @@
 #include <grp.h>
 #include <libgen.h>
 
-/* Needed early for CONFIG_BSD etc. */
-#include "net/slirp.h"
 #include "qemu/error-report.h"
 #include "qemu/log.h"
 #include "sysemu/runstate.h"
-- 
2.41.0



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

* [PULL 12/51] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 11/51] os-posix.c: remove unneeded #includes Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 13/51] util/async-teardown.c: move to softmmu/, only build it when system build is requested Paolo Bonzini
                   ` (39 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

qemu-options.h just includes qemu-options.def with some #defines.
We already do this in vl.c in other place. Since no other file
includes qemu-options.h anymore, just inline it in vl.c.

This effectively reverts second half of commit 59a5264b99434.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-8-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qemu/qemu-options.h | 41 -------------------------------------
 softmmu/vl.c                | 11 +++++++++-
 2 files changed, 10 insertions(+), 42 deletions(-)
 delete mode 100644 include/qemu/qemu-options.h

diff --git a/include/qemu/qemu-options.h b/include/qemu/qemu-options.h
deleted file mode 100644
index 4a62c83c453..00000000000
--- a/include/qemu/qemu-options.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * qemu-options.h
- *
- * Defines needed for command line argument processing.
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (c) 2010 Jes Sorensen <Jes.Sorensen@redhat.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef QEMU_OPTIONS_H
-#define QEMU_OPTIONS_H
-
-enum {
-
-#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)     \
-    opt_enum,
-#define DEFHEADING(text)
-#define ARCHHEADING(text, arch_mask)
-
-#include "qemu-options.def"
-};
-
-#endif
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 0a74810ca32..78b6570f19c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -91,7 +91,6 @@
 #include "qapi/qobject-input-visitor.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
-#include "qemu/qemu-options.h"
 #include "qemu/main-loop.h"
 #ifdef CONFIG_VIRTFS
 #include "fsdev/qemu-fsdev.h"
@@ -894,6 +893,16 @@ static void help(int exitcode)
     exit(exitcode);
 }
 
+enum {
+
+#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)     \
+    opt_enum,
+#define DEFHEADING(text)
+#define ARCHHEADING(text, arch_mask)
+
+#include "qemu-options.def"
+};
+
 #define HAS_ARG 0x0001
 
 typedef struct QEMUOption {
-- 
2.41.0



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

* [PULL 13/51] util/async-teardown.c: move to softmmu/, only build it when system build is requested
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 12/51] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 14/51] contrib/plugins: remove -soname argument Paolo Bonzini
                   ` (38 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, Eric Blake

From: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-9-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 {util => softmmu}/async-teardown.c | 0
 softmmu/meson.build                | 1 +
 util/meson.build                   | 1 -
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {util => softmmu}/async-teardown.c (100%)

diff --git a/util/async-teardown.c b/softmmu/async-teardown.c
similarity index 100%
rename from util/async-teardown.c
rename to softmmu/async-teardown.c
diff --git a/softmmu/meson.build b/softmmu/meson.build
index ea5603f0218..c18b7ad7382 100644
--- a/softmmu/meson.build
+++ b/softmmu/meson.build
@@ -37,3 +37,4 @@ endif
 
 system_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
 system_ss.add(when: fdt, if_true: files('device_tree.c'))
+system_ss.add(when: 'CONFIG_LINUX', if_true: files('async-teardown.c'))
diff --git a/util/meson.build b/util/meson.build
index a3751602869..c4827fd70aa 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -3,7 +3,6 @@ util_ss.add(files('thread-context.c'), numa)
 if not config_host_data.get('CONFIG_ATOMIC64')
   util_ss.add(files('atomic64.c'))
 endif
-util_ss.add(when: 'CONFIG_LINUX', if_true: files('async-teardown.c'))
 util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c'))
 util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c'))
 if config_host_data.get('CONFIG_EPOLL_CREATE1')
-- 
2.41.0



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

* [PULL 14/51] contrib/plugins: remove -soname argument
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (12 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 13/51] util/async-teardown.c: move to softmmu/, only build it when system build is requested Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 15/51] contrib/plugins/cache: Fix string format Paolo Bonzini
                   ` (37 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

-soname is not needed for runtime-loaded modules.  For example, Meson says:

            if not isinstance(target, build.SharedModule) or target.force_soname:
                # Add -Wl,-soname arguments on Linux, -install_name on OS X
                commands += linker.get_soname_args(
                    self.environment, target.prefix, target.name, target.suffix,
                    target.soversion, target.darwin_versions)

(force_soname is set is shared modules are linked into a build target, which is not
the case here.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index b2b9db9f51a..db1bd04dfa6 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -37,7 +37,7 @@ all: $(SONAMES)
 	$(CC) $(CFLAGS) -c -o $@ $<
 
 lib%.so: %.o
-	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
+	$(CC) -shared -o $@ $^ $(LDLIBS)
 
 clean:
 	rm -f *.o *.so *.d
-- 
2.41.0



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

* [PULL 15/51] contrib/plugins/cache: Fix string format
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (13 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 14/51] contrib/plugins: remove -soname argument Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 16/51] contrib/plugins/drcov: " Paolo Bonzini
                   ` (36 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

This fixes on Darwin:

  plugins/cache.c:550:28: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                             l1_daccess,
                             ^~~~~~~~~~
  plugins/cache.c:551:28: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                             l1_dmisses,
                             ^~~~~~~~~~
  plugins/cache.c:553:28: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                             l1_iaccess,
                             ^~~~~~~~~~
  plugins/cache.c:554:28: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                             l1_imisses,
                             ^~~~~~~~~~
  plugins/cache.c:560:32: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                 l2_access,
                                 ^~~~~~~~~
  plugins/cache.c:561:32: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                 l2_misses,
                                 ^~~~~~~~~
  plugins/cache.c:665:52: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
          g_string_append_printf(rep, ", %ld, %s\n", insn->l1_dmisses,
                                         ~~~         ^~~~~~~~~~~~~~~~
                                         %llu
  plugins/cache.c:678:52: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
          g_string_append_printf(rep, ", %ld, %s\n", insn->l1_imisses,
                                         ~~~         ^~~~~~~~~~~~~~~~
                                         %llu
  plugins/cache.c:695:52: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
          g_string_append_printf(rep, ", %ld, %s\n", insn->l2_misses,
                                         ~~~         ^~~~~~~~~~~~~~~
                                         %llu

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230907105004.88600-2-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/cache.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index 5036213f1b8..0b636d53ae9 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -545,8 +545,8 @@ static void append_stats_line(GString *line, uint64_t l1_daccess,
     l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0;
     l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0;
 
-    g_string_append_printf(line, "%-14lu %-12lu %9.4lf%%  %-14lu %-12lu"
-                           " %9.4lf%%",
+    g_string_append_printf(line, "%-14" PRIu64 " %-12" PRIu64 " %9.4lf%%"
+                           "  %-14" PRIu64 " %-12" PRIu64 " %9.4lf%%",
                            l1_daccess,
                            l1_dmisses,
                            l1_daccess ? l1_dmiss_rate : 0.0,
@@ -556,7 +556,8 @@ static void append_stats_line(GString *line, uint64_t l1_daccess,
 
     if (use_l2) {
         l2_miss_rate =  ((double) l2_misses) / (l2_access) * 100.0;
-        g_string_append_printf(line, "  %-12lu %-11lu %10.4lf%%",
+        g_string_append_printf(line,
+                               "  %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%",
                                l2_access,
                                l2_misses,
                                l2_access ? l2_miss_rate : 0.0);
@@ -662,8 +663,8 @@ static void log_top_insns(void)
         if (insn->symbol) {
             g_string_append_printf(rep, " (%s)", insn->symbol);
         }
-        g_string_append_printf(rep, ", %ld, %s\n", insn->l1_dmisses,
-                               insn->disas_str);
+        g_string_append_printf(rep, ", %" PRId64 ", %s\n",
+                               insn->l1_dmisses, insn->disas_str);
     }
 
     miss_insns = g_list_sort(miss_insns, icmp);
@@ -675,8 +676,8 @@ static void log_top_insns(void)
         if (insn->symbol) {
             g_string_append_printf(rep, " (%s)", insn->symbol);
         }
-        g_string_append_printf(rep, ", %ld, %s\n", insn->l1_imisses,
-                               insn->disas_str);
+        g_string_append_printf(rep, ", %" PRId64 ", %s\n",
+                               insn->l1_imisses, insn->disas_str);
     }
 
     if (!use_l2) {
@@ -692,8 +693,8 @@ static void log_top_insns(void)
         if (insn->symbol) {
             g_string_append_printf(rep, " (%s)", insn->symbol);
         }
-        g_string_append_printf(rep, ", %ld, %s\n", insn->l2_misses,
-                               insn->disas_str);
+        g_string_append_printf(rep, ", %" PRId64 ", %s\n",
+                               insn->l2_misses, insn->disas_str);
     }
 
 finish:
-- 
2.41.0



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

* [PULL 16/51] contrib/plugins/drcov: Fix string format
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (14 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 15/51] contrib/plugins/cache: Fix string format Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 17/51] contrib/plugins/howvec: " Paolo Bonzini
                   ` (35 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

This fixes on Darwin:

  plugins/drcov.c:52:13: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
              start_code, end_code, entry, path);
              ^~~~~~~~~~
  plugins/drcov.c:52:25: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
              start_code, end_code, entry, path);
                          ^~~~~~~~
  plugins/drcov.c:52:35: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
              start_code, end_code, entry, path);
                                    ^~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230907105004.88600-3-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/drcov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c
index 686ae0a537d..5edc94dcaf6 100644
--- a/contrib/plugins/drcov.c
+++ b/contrib/plugins/drcov.c
@@ -48,7 +48,7 @@ static void printf_header(unsigned long count)
     uint64_t start_code = qemu_plugin_start_code();
     uint64_t end_code = qemu_plugin_end_code();
     uint64_t entry = qemu_plugin_entry_code();
-    fprintf(fp, "0, 0x%lx, 0x%lx, 0x%lx, %s\n",
+    fprintf(fp, "0, 0x%" PRIx64 ", 0x%" PRIx64 ", 0x%" PRIx64 ", %s\n",
             start_code, end_code, entry, path);
     fprintf(fp, "BB Table: %ld bbs\n", count);
 }
-- 
2.41.0



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

* [PULL 17/51] contrib/plugins/howvec: Fix string format
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (15 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 16/51] contrib/plugins/drcov: " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 18/51] contrib/plugins/lockstep: " Paolo Bonzini
                   ` (34 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

This fixes on Darwin:

  plugins/howvec.c:186:40: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                         class->count);
                                         ^~~~~~~~~~~~
  plugins/howvec.c:213:36: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                     rec->count,
                                     ^~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230907105004.88600-4-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/howvec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 0ed01ea931e..644a7856bb2 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -181,7 +181,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
         switch (class->what) {
         case COUNT_CLASS:
             if (class->count || verbose) {
-                g_string_append_printf(report, "Class: %-24s\t(%ld hits)\n",
+                g_string_append_printf(report,
+                                       "Class: %-24s\t(%" PRId64 " hits)\n",
                                        class->class,
                                        class->count);
             }
@@ -208,7 +209,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
              i++, counts = g_list_next(counts)) {
             InsnExecCount *rec = (InsnExecCount *) counts->data;
             g_string_append_printf(report,
-                                   "Instr: %-24s\t(%ld hits)\t(op=0x%08x/%s)\n",
+                                   "Instr: %-24s\t(%" PRId64 " hits)"
+                                   "\t(op=0x%08x/%s)\n",
                                    rec->insn,
                                    rec->count,
                                    rec->opcode,
-- 
2.41.0



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

* [PULL 18/51] contrib/plugins/lockstep: Fix string format
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (16 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 17/51] contrib/plugins/howvec: " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 19/51] contrib/plugins: add Darwin support Paolo Bonzini
                   ` (33 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

This fixes on Darwin:

  plugins/lockstep.c:138:25: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                          us->pc, them->pc, g_slist_length(divergence_log),
                          ^~~~~~
  plugins/lockstep.c:138:33: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                          us->pc, them->pc, g_slist_length(divergence_log),
                                  ^~~~~~~~
  plugins/lockstep.c:148:25: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                          us->pc, us->insn_count, them->pc, them->insn_count);
                          ^~~~~~
  plugins/lockstep.c:148:49: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                          us->pc, us->insn_count, them->pc, them->insn_count);
                                                  ^~~~~~~~
  plugins/lockstep.c:156:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                     prev->block->pc, prev->block->insns,
                                     ^~~~~~~~~~~~~~~
  plugins/lockstep.c:156:53: warning: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                     prev->block->pc, prev->block->insns,
                                                      ^~~~~~~~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230907105004.88600-5-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/lockstep.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
index 3614c3564c2..57748e86eb3 100644
--- a/contrib/plugins/lockstep.c
+++ b/contrib/plugins/lockstep.c
@@ -134,7 +134,9 @@ static void report_divergance(ExecState *us, ExecState *them)
 
     /* Output short log entry of going out of sync... */
     if (verbose || divrec.distance == 1 || diverged) {
-        g_string_printf(out, "@ 0x%016lx vs 0x%016lx (%d/%d since last)\n",
+        g_string_printf(out,
+                        "@ 0x%016" PRIx64 " vs 0x%016" PRIx64
+                        " (%d/%d since last)\n",
                         us->pc, them->pc, g_slist_length(divergence_log),
                         divrec.distance);
         qemu_plugin_outs(out->str);
@@ -144,7 +146,9 @@ static void report_divergance(ExecState *us, ExecState *them)
         int i;
         GSList *entry;
 
-        g_string_printf(out, "Δ insn_count @ 0x%016lx (%ld) vs 0x%016lx (%ld)\n",
+        g_string_printf(out,
+                        "Δ insn_count @ 0x%016" PRIx64
+                        " (%ld) vs 0x%016" PRIx64 " (%ld)\n",
                         us->pc, us->insn_count, them->pc, them->insn_count);
 
         for (entry = log, i = 0;
@@ -152,7 +156,8 @@ static void report_divergance(ExecState *us, ExecState *them)
              entry = g_slist_next(entry), i++) {
             ExecInfo *prev = (ExecInfo *) entry->data;
             g_string_append_printf(out,
-                                   "  previously @ 0x%016lx/%ld (%ld insns)\n",
+                                   "  previously @ 0x%016" PRIx64 "/%" PRId64
+                                   " (%ld insns)\n",
                                    prev->block->pc, prev->block->insns,
                                    prev->insn_count);
         }
-- 
2.41.0



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

* [PULL 19/51] contrib/plugins: add Darwin support
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (17 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 18/51] contrib/plugins/lockstep: " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 20/51] meson: do not unnecessarily use cmake for dependencies Paolo Bonzini
                   ` (32 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Under Darwin, using -shared makes it impossible to have undefined symbols
and -bundle has to be used instead; so detect the OS and use
different options.

Based-on: <20230907101811.469236-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index db1bd04dfa6..c26fa08441e 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -37,7 +37,11 @@ all: $(SONAMES)
 	$(CC) $(CFLAGS) -c -o $@ $<
 
 lib%.so: %.o
+ifeq ($(CONFIG_DARWIN),y)
+	$(CC) -bundle -Wl,-undefined,dynamic_lookup -o $@ $^ $(LDLIBS)
+else
 	$(CC) -shared -o $@ $^ $(LDLIBS)
+endif
 
 clean:
 	rm -f *.o *.so *.d
-- 
2.41.0



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

* [PULL 20/51] meson: do not unnecessarily use cmake for dependencies
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (18 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 19/51] contrib/plugins: add Darwin support Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 21/51] meson: update unsupported host/CPU messages Paolo Bonzini
                   ` (31 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé

Both gvnc and sysprof-capture come with pkg-config files, so specify
the method to find them.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/migration/meson.build | 2 +-
 tests/qtest/meson.build     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/migration/meson.build b/tests/migration/meson.build
index ac71f132901..a91aa61c659 100644
--- a/tests/migration/meson.build
+++ b/tests/migration/meson.build
@@ -1,4 +1,4 @@
-sysprof = dependency('sysprof-capture-4', required: false)
+sysprof = dependency('sysprof-capture-4', method: 'pkg-config', required: false)
 glib_static = dependency('glib-2.0', version: glib_req_ver, required: false,
                          method: 'pkg-config', static: true)
 
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index b071d400b37..df63909ee51 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -321,7 +321,7 @@ qtests = {
 }
 
 if vnc.found()
-  gvnc = dependency('gvnc-1.0', required: false)
+  gvnc = dependency('gvnc-1.0', method: 'pkg-config', required: false)
   if gvnc.found()
     qtests += {'vnc-display-test': [gvnc]}
     qtests_generic += [ 'vnc-display-test' ]
-- 
2.41.0



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

* [PULL 21/51] meson: update unsupported host/CPU messages
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (19 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 20/51] meson: do not unnecessarily use cmake for dependencies Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 22/51] configure: remove HOST_CC Paolo Bonzini
                   ` (30 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth

Unsupported CPU and OSes are not really going away, but the
project simply does not guarantee that they work.  Rephrase
the messages accordingly.  While at it, move the warning for
TCI performance at the end where it is more visible.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 45 ++++++++++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 19 deletions(-)

diff --git a/meson.build b/meson.build
index 98e68ef0b1e..13f21fd24de 100644
--- a/meson.build
+++ b/meson.build
@@ -678,9 +678,7 @@ endif
 tcg_arch = host_arch
 if get_option('tcg').allowed()
   if host_arch == 'unknown'
-    if get_option('tcg_interpreter')
-      warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu))
-    else
+    if not get_option('tcg_interpreter')
       error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
     endif
   elif get_option('tcg_interpreter')
@@ -4317,28 +4315,37 @@ summary_info += {'selinux':           selinux}
 summary_info += {'libdw':             libdw}
 summary(summary_info, bool_yn: true, section: 'Dependencies')
 
-if not supported_cpus.contains(cpu)
+if host_arch == 'unknown'
   message()
-  warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
+  warning('UNSUPPORTED HOST CPU')
   message()
-  message('CPU host architecture ' + cpu + ' support is not currently maintained.')
-  message('The QEMU project intends to remove support for this host CPU in')
-  message('a future release if nobody volunteers to maintain it and to')
-  message('provide a build host for our continuous integration setup.')
-  message('configure has succeeded and you can continue to build, but')
-  message('if you care about QEMU on this platform you should contact')
-  message('us upstream at qemu-devel@nongnu.org.')
+  message('Support for CPU host architecture ' + cpu + ' is not currently')
+  message('maintained. The QEMU project does not guarantee that QEMU will')
+  message('compile or work on this host CPU. You can help by volunteering')
+  message('to maintain it and providing a build host for our continuous')
+  message('integration setup.')
+  if get_option('tcg').allowed() and target_dirs.length() > 0
+    message()
+    message('configure has succeeded and you can continue to build, but')
+    message('QEMU will use a slow interpreter to emulate the target CPU.')
+  endif
 endif
 
 if not supported_oses.contains(targetos)
   message()
-  warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!')
+  warning('UNSUPPORTED HOST OS')
   message()
-  message('Host OS ' + targetos + 'support is not currently maintained.')
-  message('The QEMU project intends to remove support for this host OS in')
-  message('a future release if nobody volunteers to maintain it and to')
-  message('provide a build host for our continuous integration setup.')
+  message('Support for host OS ' + targetos + 'is not currently maintained.')
   message('configure has succeeded and you can continue to build, but')
-  message('if you care about QEMU on this platform you should contact')
-  message('us upstream at qemu-devel@nongnu.org.')
+  message('the QEMU project does not guarantee that QEMU will compile or')
+  message('work on this operating system. You can help by volunteering')
+  message('to maintain it and providing a build host for our continuous')
+  message('integration setup. This will ensure that future versions of QEMU')
+  message('will keep working on ' + targetos + '.')
+endif
+
+if host_arch == 'unknown' or not supported_oses.contains(targetos)
+  message()
+  message('If you want to help supporting QEMU on this platform, please')
+  message('contact the developers at qemu-devel@nongnu.org.')
 endif
-- 
2.41.0



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

* [PULL 22/51] configure: remove HOST_CC
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (20 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 21/51] meson: update unsupported host/CPU messages Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 23/51] configure: create native file with contents of $host_cc Paolo Bonzini
                   ` (29 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Daniel P . Berrangé

$(HOST_CC) is only used to invoke the preprocessor, and $(CC) can be
used instead now that there is a Tricore C compiler.  Remove the variable
from config-host.mak.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                                 | 1 -
 tests/tcg/tricore/Makefile.softmmu-target | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index b9af8282293..7743c18f2fe 100755
--- a/configure
+++ b/configure
@@ -1800,7 +1800,6 @@ fi
 mkdir -p tests/tcg
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
 echo "SRC_PATH=$source_path" >> $config_host_mak
-echo "HOST_CC=$host_cc" >> $config_host_mak
 
 # versioned checked in the main config_host.mak above
 if test -n "$gdb_bin"; then
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index aff7c1b5802..2ec0bd36225 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -28,7 +28,7 @@ TESTS += test_context_save_areas.c.tst
 QEMU_OPTS += -M tricore_testboard -cpu tc27x -nographic -kernel
 
 %.pS: $(ASM_TESTS_PATH)/%.S
-	$(HOST_CC) -E -o $@ $<
+	$(CC) -E -o $@ $<
 
 %.o: %.pS
 	$(AS) $(ASFLAGS) -o $@ $<
-- 
2.41.0



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

* [PULL 23/51] configure: create native file with contents of $host_cc
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (21 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 22/51] configure: remove HOST_CC Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 24/51] meson: compile bundled device trees Paolo Bonzini
                   ` (28 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Daniel P . Berrangé

The argument of --host-cc is not obeyed when cross compiling.  To avoid
this issue, place it in a configuration file and pass it to meson
with --native-file.

While at it, clarify that --host-cc is not obeyed anyway when _not_
cross compiling, because cc="$host_cc" is placed before --host-cc is
processed.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 7743c18f2fe..378a0de9fb6 100755
--- a/configure
+++ b/configure
@@ -288,7 +288,7 @@ static="no"
 #  ${cross_prefix}gcc (if cross-prefix specified)
 #  system compiler
 if test -z "${CC}${cross_prefix}"; then
-  cc="$host_cc"
+  cc="cc"
 else
   cc="${CC-${cross_prefix}gcc}"
 fi
@@ -927,8 +927,8 @@ Advanced options (experts only):
   -Dmesonoptname=val       passthrough option to meson unmodified
   --cross-prefix=PREFIX    use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
   --cc=CC                  use C compiler CC [$cc]
-  --host-cc=CC             use C compiler CC [$host_cc] for code run at
-                           build time
+  --host-cc=CC             when cross compiling, use C compiler CC for code run
+                           at build time [$host_cc]
   --cxx=CXX                use C++ compiler CXX [$cxx]
   --objcc=OBJCC            use Objective-C compiler OBJCC [$objcc]
   --extra-cflags=CFLAGS    append extra C compiler flags CFLAGS
@@ -1892,7 +1892,6 @@ if test "$skip_meson" = no; then
   echo "windres = [$(meson_quote $windres)]" >> $cross
   echo "windmc = [$(meson_quote $windmc)]" >> $cross
   if test "$cross_compile" = "yes"; then
-    cross_arg="--cross-file config-meson.cross"
     echo "[host_machine]" >> $cross
     echo "system = '$targetos'" >> $cross
     case "$cpu" in
@@ -1909,6 +1908,14 @@ if test "$skip_meson" = no; then
     else
         echo "endian = 'little'" >> $cross
     fi
+    cross_arg="--cross-file config-meson.cross"
+
+    native="config-meson.native.new"
+    echo "# Automatically generated by configure - do not modify" > $native
+    echo "[binaries]" >> $native
+    echo "c = [$(meson_quote $host_cc)]" >> $native
+    mv $native config-meson.native
+    cross_arg="$cross_arg --native-file config-meson.native"
   else
     cross_arg="--native-file config-meson.cross"
   fi
-- 
2.41.0



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

* [PULL 24/51] meson: compile bundled device trees
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (22 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 23/51] configure: create native file with contents of $host_cc Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-08 16:27   ` Philippe Mathieu-Daudé
  2023-09-07 12:59 ` [PULL 25/51] configure: remove boolean variables for targets Paolo Bonzini
                   ` (27 subsequent siblings)
  51 siblings, 1 reply; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

If dtc is available, compile the .dts files in the pc-bios directory
instead of using the precompiled binaries.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 pc-bios/Makefile    | 19 -------------------
 pc-bios/meson.build | 25 +++++++++++++++++++++----
 2 files changed, 21 insertions(+), 23 deletions(-)
 delete mode 100644 pc-bios/Makefile

diff --git a/pc-bios/Makefile b/pc-bios/Makefile
deleted file mode 100644
index 315288df84e..00000000000
--- a/pc-bios/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# NOTE: only compilable with x86 cross compile tools
-#
-include ../config-host.mak
-
-DEFINES=
-
-TARGETS=
-
-all: $(TARGETS)
-
-%.o: %.S
-	$(CC) $(DEFINES) -c -o $@ $<
-
-%.dtb: %.dts
-	dtc -I dts -O dtb -o $@ $<
-
-clean:
-	rm -f $(TARGETS) *.o *~
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index a7224ef4699..e67fa433a1b 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -57,10 +57,6 @@ blobs = [
   'efi-e1000e.rom',
   'efi-vmxnet3.rom',
   'qemu-nsis.bmp',
-  'bamboo.dtb',
-  'canyonlands.dtb',
-  'petalogix-s3adsp1800.dtb',
-  'petalogix-ml605.dtb',
   'multiboot.bin',
   'multiboot_dma.bin',
   'linuxboot.bin',
@@ -84,6 +80,27 @@ blobs = [
   'vof-nvram.bin',
 ]
 
+dtc = find_program('dtc', required: false)
+foreach f : [
+  'bamboo.dts',
+  'canyonlands.dts',
+  'petalogix-s3adsp1800.dts',
+  'petalogix-ml605.dts',
+]
+  out = fs.replace_suffix(f, '.dtb')
+  if dtc.found()
+    custom_target(f,
+        build_by_default: have_system,
+        input: files(f),
+        output: out,
+        install: get_option('install_blobs'),
+        install_dir: qemu_datadir,
+        command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ])
+  else
+    blobs += out
+  endif
+endforeach
+
 if get_option('install_blobs')
   install_data(blobs, install_dir: qemu_datadir)
 endif
-- 
2.41.0



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

* [PULL 25/51] configure: remove boolean variables for targets
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (23 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 24/51] meson: compile bundled device trees Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 26/51] configure: move --enable-debug-tcg to meson Paolo Bonzini
                   ` (26 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Just use $targetos always.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 55 +++++++++++++------------------------------------------
 1 file changed, 13 insertions(+), 42 deletions(-)

diff --git a/configure b/configure
index 378a0de9fb6..f96f7359a83 100755
--- a/configure
+++ b/configure
@@ -374,45 +374,14 @@ fi
 
 # OS specific
 
-mingw32="no"
-bsd="no"
-linux="no"
-solaris="no"
 case $targetos in
 windows)
-  mingw32="yes"
   plugins="no"
   pie="no"
 ;;
-gnu/kfreebsd)
-  bsd="yes"
-;;
-freebsd)
-  bsd="yes"
-  # needed for kinfo_getvmmap(3) in libutil.h
-;;
-dragonfly)
-  bsd="yes"
-;;
-netbsd)
-  bsd="yes"
-;;
-openbsd)
-  bsd="yes"
-;;
-darwin)
-  bsd="yes"
-  darwin="yes"
-;;
-sunos)
-  solaris="yes"
-;;
 haiku)
   pie="no"
 ;;
-linux)
-  linux="yes"
-;;
 esac
 
 if test ! -z "$cpu" ; then
@@ -627,7 +596,7 @@ do
     fi
 done
 
-if test "$mingw32" = "yes" ; then
+if test "$targetos" = "windows" ; then
   EXESUF=".exe"
   prefix="/qemu"
   bindir=""
@@ -809,7 +778,7 @@ for opt do
   ;;
   --enable-download) download="enabled"; git_submodules_action=update;
   ;;
-  --enable-plugins) if test "$mingw32" = "yes"; then
+  --enable-plugins) if test "$targetos" = "windows"; then
                         error_exit "TCG plugins not currently supported on Windows platforms"
                     else
                         plugins="yes"
@@ -1080,7 +1049,7 @@ fi
 # by default.  Only enable by default for git builds
 if test -z "$werror" ; then
     if test -e "$source_path/.git" && \
-        { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
+        { test "$targetos" = linux || test "$targetos" = "windows"; }; then
         werror="yes"
     else
         werror="no"
@@ -1718,7 +1687,7 @@ echo all: >> $config_host_mak
 if test "$debug_tcg" = "yes" ; then
   echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
 fi
-if test "$mingw32" = "yes" ; then
+if test "$targetos" = "windows"; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
   echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER-QEMU}" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO-Linux}" >> $config_host_mak
@@ -1727,24 +1696,26 @@ else
   echo "CONFIG_POSIX=y" >> $config_host_mak
 fi
 
-if test "$linux" = "yes" ; then
+if test "$targetos" = "linux" ; then
   echo "CONFIG_LINUX=y" >> $config_host_mak
 fi
 
-if test "$darwin" = "yes" ; then
+if test "$targetos" = "darwin" ; then
   echo "CONFIG_DARWIN=y" >> $config_host_mak
 fi
 
-if test "$solaris" = "yes" ; then
+if test "$targetos" = "sunos" ; then
   echo "CONFIG_SOLARIS=y" >> $config_host_mak
 fi
 echo "SRC_PATH=$source_path" >> $config_host_mak
 echo "TARGET_DIRS=$target_list" >> $config_host_mak
 
 # XXX: suppress that
-if [ "$bsd" = "yes" ] ; then
-  echo "CONFIG_BSD=y" >> $config_host_mak
-fi
+case $targetos in
+  gnu/kfreebsd | freebsd | dragonfly | netbsd | openbsd | darwin)
+    echo "CONFIG_BSD=y" >> $config_host_mak
+    ;;
+esac
 
 if test "$plugins" = "yes" ; then
     echo "CONFIG_PLUGIN=y" >> $config_host_mak
@@ -1774,7 +1745,7 @@ echo "CC=$cc" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
 
 # use included Linux headers for KVM architectures
-if test "$linux" = "yes" && test -n "$linux_arch"; then
+if test "$targetos" = "linux" && test -n "$linux_arch"; then
   symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
 fi
 
-- 
2.41.0



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

* [PULL 26/51] configure: move --enable-debug-tcg to meson
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (24 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 25/51] configure: remove boolean variables for targets Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 27/51] contrib/plugins: use an independent makefile Paolo Bonzini
                   ` (25 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Peter Maydell

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                     | 11 +----------
 meson.build                   |  3 ++-
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  3 +++
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index f96f7359a83..afd6121b616 100755
--- a/configure
+++ b/configure
@@ -248,7 +248,6 @@ done
 
 git_submodules_action="update"
 git="git"
-debug_tcg="no"
 docs="auto"
 EXESUF=""
 prefix="/usr/local"
@@ -727,13 +726,9 @@ for opt do
     # configure to be used by RPM and similar macros that set
     # lots of directory switches by default.
   ;;
-  --enable-debug-tcg) debug_tcg="yes"
-  ;;
-  --disable-debug-tcg) debug_tcg="no"
-  ;;
   --enable-debug)
       # Enable debugging options that aren't excessively noisy
-      debug_tcg="yes"
+      meson_option_parse --enable-debug-tcg ""
       meson_option_parse --enable-debug-graph-lock ""
       meson_option_parse --enable-debug-mutex ""
       meson_option_add -Doptimization=0
@@ -933,7 +928,6 @@ cat << EOF
   linux-user      all linux usermode emulation targets
   bsd-user        all BSD usermode emulation targets
   pie             Position Independent Executables
-  debug-tcg       TCG debugging (default is disabled)
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -1684,9 +1678,6 @@ echo >> $config_host_mak
 
 echo all: >> $config_host_mak
 
-if test "$debug_tcg" = "yes" ; then
-  echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
-fi
 if test "$targetos" = "windows"; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
   echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER-QEMU}" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 13f21fd24de..4c3918a34ec 100644
--- a/meson.build
+++ b/meson.build
@@ -2199,6 +2199,7 @@ config_host_data.set10('CONFIG_COROUTINE_POOL', have_coroutine_pool)
 config_host_data.set('CONFIG_DEBUG_GRAPH_LOCK', get_option('debug_graph_lock'))
 config_host_data.set('CONFIG_DEBUG_MUTEX', get_option('debug_mutex'))
 config_host_data.set('CONFIG_DEBUG_STACK_USAGE', get_option('debug_stack_usage'))
+config_host_data.set('CONFIG_DEBUG_TCG', get_option('debug_tcg'))
 config_host_data.set('CONFIG_GPROF', get_option('gprof'))
 config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
 config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
@@ -4156,7 +4157,7 @@ if config_all.has_key('CONFIG_TCG')
     summary_info += {'TCG backend':   'native (@0@)'.format(cpu)}
   endif
   summary_info += {'TCG plugins': config_host.has_key('CONFIG_PLUGIN')}
-  summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')}
+  summary_info += {'TCG debug enabled': get_option('debug_tcg')}
 endif
 summary_info += {'target list':       ' '.join(target_dirs)}
 if have_system
diff --git a/meson_options.txt b/meson_options.txt
index aaea5ddd779..5d6b889554c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -83,6 +83,8 @@ option('xen_pci_passthrough', type: 'feature', value: 'auto',
        description: 'Xen PCI passthrough support')
 option('tcg', type: 'feature', value: 'enabled',
        description: 'TCG support')
+option('debug_tcg', type: 'boolean', value: false,
+       description: 'TCG debugging')
 option('tcg_interpreter', type: 'boolean', value: false,
        description: 'TCG with bytecode interpreter (slow)')
 option('safe_stack', type: 'boolean', value: false,
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 9da3fe299b7..5567fd29985 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -29,6 +29,7 @@ meson_options_help() {
   printf "%s\n" '  --enable-debug-mutex     mutex debugging support'
   printf "%s\n" '  --enable-debug-stack-usage'
   printf "%s\n" '                           measure coroutine stack usage'
+  printf "%s\n" '  --enable-debug-tcg       TCG debugging'
   printf "%s\n" '  --enable-fdt[=CHOICE]    Whether and how to find the libfdt library'
   printf "%s\n" '                           (choices: auto/disabled/enabled/internal/system)'
   printf "%s\n" '  --enable-fuzzing         build fuzzing targets'
@@ -276,6 +277,8 @@ _meson_option_parse() {
     --disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;;
     --enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;;
     --disable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=false ;;
+    --enable-debug-tcg) printf "%s" -Ddebug_tcg=true ;;
+    --disable-debug-tcg) printf "%s" -Ddebug_tcg=false ;;
     --enable-dmg) printf "%s" -Ddmg=enabled ;;
     --disable-dmg) printf "%s" -Ddmg=disabled ;;
     --docdir=*) quote_sh "-Ddocdir=$2" ;;
-- 
2.41.0



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

* [PULL 27/51] contrib/plugins: use an independent makefile
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (25 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 26/51] configure: move --enable-debug-tcg to meson Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 28/51] configure: unify recursion into sub-Makefiles Paolo Bonzini
                   ` (24 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé

The initial reason to write this patch was to remove the last use of
CONFIG_DEBUG_TCG from the makefiles; the flags to use to build TCG
plugins are unrelated to --enable-debug-tcg, and instead they should
be the same as those used to build emulators (the plugins are not build
via meson for demonstration reasons only).

However, since contrib/plugins/Makefile is also the last case of doing
a compilation job using config-host.mak, go a step further and make it
use a completely separate configuration file, removing all references
to compilers from the toplevel config-host.mak.  Clean up references to
empty variables, and use .SECONDARY so that intermediate object files
are not deleted.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                | 15 ++++++++++++---
 contrib/plugins/Makefile | 16 ++++++++--------
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index afd6121b616..849cd3c0385 100755
--- a/configure
+++ b/configure
@@ -245,7 +245,7 @@ for opt do
   esac
 done
 
-
+default_cflags='-O2 -g'
 git_submodules_action="update"
 git="git"
 docs="auto"
@@ -732,6 +732,7 @@ for opt do
       meson_option_parse --enable-debug-graph-lock ""
       meson_option_parse --enable-debug-mutex ""
       meson_option_add -Doptimization=0
+      default_cflags='-O0 -g'
   ;;
   --disable-tcg) tcg="disabled"
                  plugins="no"
@@ -1731,8 +1732,6 @@ echo "PYTHON=$python" >> $config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "MESON=$meson" >> $config_host_mak
 echo "NINJA=$ninja" >> $config_host_mak
-echo "PKG_CONFIG=${pkg_config}" >> $config_host_mak
-echo "CC=$cc" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
 
 # use included Linux headers for KVM architectures
@@ -1757,6 +1756,16 @@ if test "$ccache_cpp2" = "yes"; then
   echo "export CCACHE_CPP2=y" >> $config_host_mak
 fi
 
+# contrib/plugins configuration
+echo "# Automatically generated by configure - do not modify" > contrib/plugins/$config_host_mak
+echo "SRC_PATH=$source_path/contrib/plugins" >> contrib/plugins/$config_host_mak
+echo "PKG_CONFIG=${pkg_config}" >> contrib/plugins/$config_host_mak
+echo "CC=$cc $CPU_CFLAGS" >> contrib/plugins/$config_host_mak
+echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config_host_mak
+if test "$targetos" = darwin; then
+  echo "CONFIG_DARWIN=y" >> contrib/plugins/$config_host_mak
+fi
+
 # tests/tcg configuration
 (config_host_mak=tests/tcg/config-host.mak
 mkdir -p tests/tcg
diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index c26fa08441e..8ba78c7a329 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -6,11 +6,11 @@
 # programs that the main configure has already done for us.
 #
 
-BUILD_DIR := $(CURDIR)/../..
+include config-host.mak
 
-include $(BUILD_DIR)/config-host.mak
+TOP_SRC_PATH = $(SRC_PATH)/../..
 
-VPATH += $(SRC_PATH)/contrib/plugins
+VPATH += $(SRC_PATH)
 
 NAMES :=
 NAMES += execlog
@@ -26,15 +26,14 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
 # The main QEMU uses Glib extensively so it's perfectly fine to use it
 # in plugins (which many example do).
-CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
-CFLAGS += -fPIC -Wall
-CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
-CFLAGS += -I$(SRC_PATH)/include/qemu
+PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
+PLUGIN_CFLAGS += -fPIC -Wall
+PLUGIN_CFLAGS += -I$(TOP_SRC_PATH)/include/qemu
 
 all: $(SONAMES)
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<
 
 lib%.so: %.o
 ifeq ($(CONFIG_DARWIN),y)
@@ -48,3 +47,4 @@ clean:
 	rm -Rf .libs
 
 .PHONY: all clean
+.SECONDARY:
-- 
2.41.0



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

* [PULL 28/51] configure: unify recursion into sub-Makefiles
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (26 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 27/51] contrib/plugins: use an independent makefile Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 29/51] configure, meson: move --enable-plugins to meson Paolo Bonzini
                   ` (23 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Treat contrib/plugins the same as the firmware.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile  | 27 ++++++++++++---------------
 configure | 13 ++++++++-----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index 5d48dfac18a..118c28e80d9 100644
--- a/Makefile
+++ b/Makefile
@@ -164,14 +164,6 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
 endif
 endif
 
-ifeq ($(CONFIG_PLUGIN),y)
-.PHONY: plugins
-plugins:
-	$(call quiet-command,\
-		$(MAKE) $(SUBDIR_MAKEFLAGS) -C contrib/plugins V="$(V)", \
-		"BUILD", "example plugins")
-endif # $(CONFIG_PLUGIN)
-
 else # config-host.mak does not exist
 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 $(error Please call configure before running make)
@@ -184,15 +176,20 @@ include $(SRC_PATH)/tests/Makefile.include
 
 all: recurse-all
 
-ROMS_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(ROMS)))
-.PHONY: $(ROMS_RULES)
-$(ROMS_RULES):
+SUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS)))
+.PHONY: $(SUBDIR_RULES)
+$(SUBDIR_RULES):
 	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
 
+ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
+.PHONY: plugins
+plugins: contrib/plugins/all
+endif
+
 .PHONY: recurse-all recurse-clean
-recurse-all: $(addsuffix /all, $(ROMS))
-recurse-clean: $(addsuffix /clean, $(ROMS))
-recurse-distclean: $(addsuffix /distclean, $(ROMS))
+recurse-all: $(addsuffix /all, $(SUBDIRS))
+recurse-clean: $(addsuffix /clean, $(SUBDIRS))
+recurse-distclean: $(addsuffix /distclean, $(SUBDIRS))
 
 ######################################################################
 
@@ -296,7 +293,7 @@ help:
 	$(call print-help,cscope,Generate cscope index)
 	$(call print-help,sparse,Run sparse on the QEMU source)
 	@echo  ''
-ifeq ($(CONFIG_PLUGIN),y)
+ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
 	@echo  'Plugin targets:'
 	$(call print-help,plugins,Build the example TCG plugins)
 	@echo  ''
diff --git a/configure b/configure
index 849cd3c0385..a0912e4b268 100755
--- a/configure
+++ b/configure
@@ -256,6 +256,7 @@ softmmu="yes"
 linux_user=""
 bsd_user=""
 plugins="$default_feature"
+subdirs=""
 ninja=""
 python=
 download="enabled"
@@ -1067,6 +1068,9 @@ if test "$static" = "yes" ; then
   fi
 fi
 test "$plugins" = "" && plugins=yes
+if test "$plugins" = "yes"; then
+  subdirs="$subdirs contrib/plugins"
+fi
 
 cat > $TMPC << EOF
 
@@ -1627,12 +1631,11 @@ done
 echo "# Automatically generated by configure - do not modify" > Makefile.prereqs
 
 # Mac OS X ships with a broken assembler
-roms=
 if have_target i386-softmmu x86_64-softmmu && \
         test "$targetos" != "darwin" && test "$targetos" != "sunos" && \
         test "$targetos" != "haiku" && \
         probe_target_compiler i386-softmmu; then
-    roms="pc-bios/optionrom"
+    subdirs="$subdirs pc-bios/optionrom"
     config_mak=pc-bios/optionrom/config.mak
     echo "# Automatically generated by configure - do not modify" > $config_mak
     echo "TOPSRC_DIR=$source_path" >> $config_mak
@@ -1641,7 +1644,7 @@ fi
 
 if have_target ppc-softmmu ppc64-softmmu && \
         probe_target_compiler ppc-softmmu; then
-    roms="$roms pc-bios/vof"
+    subdirs="$subdirs pc-bios/vof"
     config_mak=pc-bios/vof/config.mak
     echo "# Automatically generated by configure - do not modify" > $config_mak
     echo "SRC_DIR=$source_path/pc-bios/vof" >> $config_mak
@@ -1660,7 +1663,7 @@ if have_target s390x-softmmu && probe_target_compiler s390x-softmmu && \
       echo "WARNING: Your compiler does not support the z900!"
       echo "         The s390-ccw bios will only work with guest CPUs >= z10."
     fi
-    roms="$roms pc-bios/s390-ccw"
+    subdirs="$subdirs pc-bios/s390-ccw"
     config_mak=pc-bios/s390-ccw/config-host.mak
     echo "# Automatically generated by configure - do not modify" > $config_mak
     echo "SRC_PATH=$source_path/pc-bios/s390-ccw" >> $config_mak
@@ -1727,7 +1730,7 @@ if test "$container" != no; then
     echo "ENGINE=$container" >> $config_host_mak
     echo "RUNC=$runc" >> $config_host_mak
 fi
-echo "ROMS=$roms" >> $config_host_mak
+echo "SUBDIRS=$subdirs" >> $config_host_mak
 echo "PYTHON=$python" >> $config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "MESON=$meson" >> $config_host_mak
-- 
2.41.0



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

* [PULL 29/51] configure, meson: move --enable-plugins to meson
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (27 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 28/51] configure: unify recursion into sub-Makefiles Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 30/51] configure, meson: remove CONFIG_SOLARIS from config-host.mak Paolo Bonzini
                   ` (22 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

While the option still needs to be parsed in the configure script
(it's needed by tests/tcg, and also to decide about recursing
into contrib/plugins), passing it to Meson can be done with -D
instead of using config-host.mak.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 accel/tcg/meson.build         |  4 +++-
 configure                     |  5 +----
 meson.build                   |  7 ++++---
 meson_options.txt             |  2 ++
 plugins/meson.build           | 12 +++++++-----
 scripts/meson-buildoptions.sh |  3 +++
 tests/Makefile.include        |  2 +-
 tests/meson.build             |  6 ++----
 8 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 166bef173b8..8ace7837079 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -11,7 +11,9 @@ tcg_ss.add(files(
 ))
 tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c'))
 tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c'))
-tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c')])
+if get_option('plugins')
+  tcg_ss.add(files('plugin-gen.c'))
+endif
 tcg_ss.add(when: libdw, if_true: files('debuginfo.c'))
 tcg_ss.add(when: 'CONFIG_LINUX', if_true: files('perf.c'))
 specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
diff --git a/configure b/configure
index a0912e4b268..6b1019ba59c 100755
--- a/configure
+++ b/configure
@@ -1712,10 +1712,6 @@ case $targetos in
     ;;
 esac
 
-if test "$plugins" = "yes" ; then
-    echo "CONFIG_PLUGIN=y" >> $config_host_mak
-fi
-
 if test -n "$gdb_bin"; then
     gdb_version=$($gdb_bin --version | head -n 1)
     if version_ge ${gdb_version##* } 9.1; then
@@ -1909,6 +1905,7 @@ if test "$skip_meson" = no; then
   test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
   test "$docs" != auto && meson_option_add "-Ddocs=$docs"
   test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
+  test "$plugins" = yes && meson_option_add "-Dplugins=true"
   test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
   test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
   test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
diff --git a/meson.build b/meson.build
index 4c3918a34ec..a1021fe2a78 100644
--- a/meson.build
+++ b/meson.build
@@ -730,7 +730,7 @@ glib_cflags = []
 if enable_modules
   gmodule = dependency('gmodule-export-2.0', version: glib_req_ver, required: true,
                        method: 'pkg-config')
-elif config_host.has_key('CONFIG_PLUGIN')
+elif get_option('plugins')
   gmodule = dependency('gmodule-no-export-2.0', version: glib_req_ver, required: true,
                        method: 'pkg-config')
 else
@@ -2115,6 +2115,7 @@ if numa.found()
                                        dependencies: numa))
 endif
 config_host_data.set('CONFIG_OPENGL', opengl.found())
+config_host_data.set('CONFIG_PLUGIN', get_option('plugins'))
 config_host_data.set('CONFIG_RBD', rbd.found())
 config_host_data.set('CONFIG_RDMA', rdma.found())
 config_host_data.set('CONFIG_SAFESTACK', get_option('safe_stack'))
@@ -3883,7 +3884,7 @@ endforeach
 
 # Other build targets
 
-if 'CONFIG_PLUGIN' in config_host
+if get_option('plugins')
   install_headers('include/qemu/qemu-plugin.h')
 endif
 
@@ -4156,7 +4157,7 @@ if config_all.has_key('CONFIG_TCG')
   else
     summary_info += {'TCG backend':   'native (@0@)'.format(cpu)}
   endif
-  summary_info += {'TCG plugins': config_host.has_key('CONFIG_PLUGIN')}
+  summary_info += {'TCG plugins':       get_option('plugins')}
   summary_info += {'TCG debug enabled': get_option('debug_tcg')}
 endif
 summary_info += {'target list':       ' '.join(target_dirs)}
diff --git a/meson_options.txt b/meson_options.txt
index 5d6b889554c..e48086e2562 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -83,6 +83,8 @@ option('xen_pci_passthrough', type: 'feature', value: 'auto',
        description: 'Xen PCI passthrough support')
 option('tcg', type: 'feature', value: 'enabled',
        description: 'TCG support')
+option('plugins', type: 'boolean', value: false,
+       description: 'TCG plugins via shared library loading')
 option('debug_tcg', type: 'boolean', value: false,
        description: 'TCG debugging')
 option('tcg_interpreter', type: 'boolean', value: false,
diff --git a/plugins/meson.build b/plugins/meson.build
index 752377c66d3..71ed996ed31 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -13,8 +13,10 @@ if not enable_modules
   endif
 endif
 
-specific_ss.add(when: 'CONFIG_PLUGIN', if_true: [files(
-  'loader.c',
-  'core.c',
-  'api.c',
-), declare_dependency(link_args: plugin_ldflags)])
+if get_option('plugins')
+  specific_ss.add(files(
+    'loader.c',
+    'core.c',
+    'api.c',
+  ), declare_dependency(link_args: plugin_ldflags))
+endif
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 5567fd29985..6b16ad94f4b 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -40,6 +40,7 @@ meson_options_help() {
   printf "%s\n" '                           jemalloc/system/tcmalloc)'
   printf "%s\n" '  --enable-module-upgrades try to load modules from alternate paths for'
   printf "%s\n" '                           upgrades'
+  printf "%s\n" '  --enable-plugins         TCG plugins via shared library loading'
   printf "%s\n" '  --enable-rng-none        dummy RNG, avoid using /dev/(u)random and'
   printf "%s\n" '                           getrandom()'
   printf "%s\n" '  --enable-safe-stack      SafeStack Stack Smash Protection (requires'
@@ -401,6 +402,8 @@ _meson_option_parse() {
     --enable-pipewire) printf "%s" -Dpipewire=enabled ;;
     --disable-pipewire) printf "%s" -Dpipewire=disabled ;;
     --with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
+    --enable-plugins) printf "%s" -Dplugins=true ;;
+    --disable-plugins) printf "%s" -Dplugins=false ;;
     --enable-png) printf "%s" -Dpng=enabled ;;
     --disable-png) printf "%s" -Dpng=disabled ;;
     --enable-pvrdma) printf "%s" -Dpvrdma=enabled ;;
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 985cda7a945..38987426594 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -73,7 +73,7 @@ $(TCG_TESTS_TARGETS:%=distclean-tcg-tests-%): distclean-tcg-tests-%:
 build-tcg: $(BUILD_TCG_TARGET_RULES)
 
 .PHONY: check-tcg
-.ninja-goals.check-tcg = all $(if $(CONFIG_PLUGIN),test-plugins)
+.ninja-goals.check-tcg = all
 check-tcg: $(RUN_TCG_TARGET_RULES)
 
 .PHONY: clean-tcg
diff --git a/tests/meson.build b/tests/meson.build
index 083f2990bde..c2528a88f99 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -80,10 +80,8 @@ if 'CONFIG_TCG' in config_all
   subdir('fp')
 endif
 
-if get_option('tcg').allowed()
-  if 'CONFIG_PLUGIN' in config_host
-    subdir('plugin')
-  endif
+if get_option('plugins')
+  subdir('plugin')
 endif
 
 subdir('unit')
-- 
2.41.0



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

* [PULL 30/51] configure, meson: remove CONFIG_SOLARIS from config-host.mak
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (28 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 29/51] configure, meson: move --enable-plugins to meson Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 31/51] configure, meson: remove target OS symbols " Paolo Bonzini
                   ` (21 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

CONFIG_SOLARIS is only used to pick tap implementations.  But the
target OS is invariant and does not depend on the configuration, so move
away from config_host and just use unconditional rules in softmmu_ss.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure       |  3 ---
 meson.build     |  1 +
 net/meson.build | 18 ++++++++++--------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 6b1019ba59c..a76bdd78623 100755
--- a/configure
+++ b/configure
@@ -1699,9 +1699,6 @@ if test "$targetos" = "darwin" ; then
   echo "CONFIG_DARWIN=y" >> $config_host_mak
 fi
 
-if test "$targetos" = "sunos" ; then
-  echo "CONFIG_SOLARIS=y" >> $config_host_mak
-fi
 echo "SRC_PATH=$source_path" >> $config_host_mak
 echo "TARGET_DIRS=$target_list" >> $config_host_mak
 
diff --git a/meson.build b/meson.build
index a1021fe2a78..a7470b57081 100644
--- a/meson.build
+++ b/meson.build
@@ -2126,6 +2126,7 @@ if seccomp.found()
   config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc)
 endif
 config_host_data.set('CONFIG_SNAPPY', snappy.found())
+config_host_data.set('CONFIG_SOLARIS', targetos == 'sunos')
 config_host_data.set('CONFIG_TPM', have_tpm)
 config_host_data.set('CONFIG_TSAN', get_option('tsan'))
 config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
diff --git a/net/meson.build b/net/meson.build
index bdf564a57b2..d2d70634e5e 100644
--- a/net/meson.build
+++ b/net/meson.build
@@ -41,15 +41,17 @@ if have_vhost_net_user
   system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c'))
 endif
 
-system_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c'))
-system_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c'))
-system_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c'))
-tap_posix = ['tap.c']
-if not config_host.has_key('CONFIG_LINUX') and not config_host.has_key('CONFIG_BSD') and not config_host.has_key('CONFIG_SOLARIS')
-  tap_posix += 'tap-stub.c'
+if targetos == 'windows'
+  system_ss.add(files('tap-win32.c'))
+elif targetos == 'linux'
+  system_ss.add(files('tap.c', 'tap-linux.c'))
+elif targetos in bsd_oses
+  system_ss.add(files('tap.c', 'tap-bsd.c'))
+elif targetos == 'solaris'
+  system_ss.add(files('tap.c', 'tap-solaris.c'))
+else
+  system_ss.add(files('tap.c', 'tap-stub.c'))
 endif
-system_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix))
-system_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c'))
 if have_vhost_net_vdpa
   system_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-vdpa.c'), if_false: files('vhost-vdpa-stub.c'))
   system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-vdpa-stub.c'))
-- 
2.41.0



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

* [PULL 31/51] configure, meson: remove target OS symbols from config-host.mak
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (29 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 30/51] configure, meson: remove CONFIG_SOLARIS from config-host.mak Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 32/51] meson: list leftover CONFIG_* symbols Paolo Bonzini
                   ` (20 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Stop applying config-host.mak to the sourcesets, since it does not
have any more CONFIG_* symbols coming from the command line.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile                   |  2 +-
 chardev/meson.build        |  2 +-
 configure                  | 18 ----------------
 docs/devel/kconfig.rst     |  2 +-
 gdbstub/meson.build        |  4 ++--
 meson.build                | 43 ++++++++++++++++++++++++++------------
 qga/meson.build            |  4 ++--
 storage-daemon/meson.build |  2 +-
 tcg/meson.build            |  2 +-
 tests/meson.build          |  2 +-
 tests/qtest/meson.build    | 12 +++++------
 tests/unit/meson.build     |  6 +++---
 12 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/Makefile b/Makefile
index 118c28e80d9..bfc4b2c8e92 100644
--- a/Makefile
+++ b/Makefile
@@ -313,7 +313,7 @@ endif
 	@echo  'Documentation targets:'
 	$(call print-help,html man,Build documentation in specified format)
 	@echo  ''
-ifdef CONFIG_WIN32
+ifneq ($(filter msi, $(ninja-targets)),)
 	@echo  'Windows targets:'
 	$(call print-help,installer,Build NSIS-based installer for QEMU)
 	$(call print-help,msi,Build MSI-based installer for qemu-ga)
diff --git a/chardev/meson.build b/chardev/meson.build
index fb630b429eb..6d56ad32fdb 100644
--- a/chardev/meson.build
+++ b/chardev/meson.build
@@ -26,7 +26,7 @@ chardev_ss.add(when: 'CONFIG_WIN32', if_true: files(
   'char-win.c',
 ))
 
-chardev_ss = chardev_ss.apply(config_host, strict: false)
+chardev_ss = chardev_ss.apply(config_targetos, strict: false)
 
 system_ss.add(files(
     'char-hmp-cmds.c',
diff --git a/configure b/configure
index a76bdd78623..ef085376922 100755
--- a/configure
+++ b/configure
@@ -1683,32 +1683,14 @@ echo >> $config_host_mak
 echo all: >> $config_host_mak
 
 if test "$targetos" = "windows"; then
-  echo "CONFIG_WIN32=y" >> $config_host_mak
   echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER-QEMU}" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO-Linux}" >> $config_host_mak
   echo "QEMU_GA_VERSION=${QEMU_GA_VERSION-$(cat "$source_path"/VERSION)}" >> $config_host_mak
-else
-  echo "CONFIG_POSIX=y" >> $config_host_mak
-fi
-
-if test "$targetos" = "linux" ; then
-  echo "CONFIG_LINUX=y" >> $config_host_mak
-fi
-
-if test "$targetos" = "darwin" ; then
-  echo "CONFIG_DARWIN=y" >> $config_host_mak
 fi
 
 echo "SRC_PATH=$source_path" >> $config_host_mak
 echo "TARGET_DIRS=$target_list" >> $config_host_mak
 
-# XXX: suppress that
-case $targetos in
-  gnu/kfreebsd | freebsd | dragonfly | netbsd | openbsd | darwin)
-    echo "CONFIG_BSD=y" >> $config_host_mak
-    ;;
-esac
-
 if test -n "$gdb_bin"; then
     gdb_version=$($gdb_bin --version | head -n 1)
     if version_ge ${gdb_version##* } 9.1; then
diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst
index e3a544e463f..73f52de1067 100644
--- a/docs/devel/kconfig.rst
+++ b/docs/devel/kconfig.rst
@@ -316,6 +316,6 @@ variable::
 
     host_kconfig = \
       (have_tpm ? ['CONFIG_TPM=y'] : []) + \
-      ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
+      (targetos == 'linux' ? ['CONFIG_LINUX=y'] : []) + \
       (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
       ...
diff --git a/gdbstub/meson.build b/gdbstub/meson.build
index 77762e0b3e1..9500b9dc4e6 100644
--- a/gdbstub/meson.build
+++ b/gdbstub/meson.build
@@ -14,8 +14,8 @@ gdb_system_ss = ss.source_set()
 gdb_user_ss.add(files('gdbstub.c', 'user.c'))
 gdb_system_ss.add(files('gdbstub.c', 'softmmu.c'))
 
-gdb_user_ss = gdb_user_ss.apply(config_host, strict: false)
-gdb_system_ss = gdb_system_ss.apply(config_host, strict: false)
+gdb_user_ss = gdb_user_ss.apply(config_targetos, strict: false)
+gdb_system_ss = gdb_system_ss.apply(config_targetos, strict: false)
 
 libgdb_user = static_library('gdb_user',
                              gdb_user_ss.sources() + genh,
diff --git a/meson.build b/meson.build
index a7470b57081..16f0475955d 100644
--- a/meson.build
+++ b/meson.build
@@ -2069,10 +2069,15 @@ config_host_data.set('CONFIG_MODULE_UPGRADES', get_option('module_upgrades'))
 config_host_data.set('CONFIG_ATTR', libattr.found())
 config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools'))
 config_host_data.set('CONFIG_BRLAPI', brlapi.found())
+config_host_data.set('CONFIG_BSD', targetos in bsd_oses)
 config_host_data.set('CONFIG_COCOA', cocoa.found())
+config_host_data.set('CONFIG_DARWIN', targetos == 'darwin')
 config_host_data.set('CONFIG_FUZZ', get_option('fuzzing'))
 config_host_data.set('CONFIG_GCOV', get_option('b_coverage'))
 config_host_data.set('CONFIG_LIBUDEV', libudev.found())
+config_host_data.set('CONFIG_LINUX', targetos == 'linux')
+config_host_data.set('CONFIG_POSIX', targetos != 'windows')
+config_host_data.set('CONFIG_WIN32', targetos == 'windows')
 config_host_data.set('CONFIG_LZO', lzo.found())
 config_host_data.set('CONFIG_MPATH', mpathpersist.found())
 config_host_data.set('CONFIG_BLKIO', blkio.found())
@@ -2799,6 +2804,18 @@ endif
 ########################
 
 minikconf = find_program('scripts/minikconf.py')
+config_targetos = {
+  (targetos == 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y'
+}
+if targetos == 'darwin'
+  config_targetos += {'CONFIG_DARWIN': 'y'}
+elif targetos == 'linux'
+  config_targetos += {'CONFIG_LINUX': 'y'}
+endif
+if targetos in bsd_oses
+  config_targetos += {'CONFIG_BSD': 'y'}
+endif
+
 config_all = {}
 config_all_devices = {}
 config_all_disas = {}
@@ -2842,7 +2859,7 @@ host_kconfig = \
   (have_vhost_vdpa ? ['CONFIG_VHOST_VDPA=y'] : []) + \
   (have_vhost_kernel ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
   (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
-  ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
+  (targetos == 'linux' ? ['CONFIG_LINUX=y'] : []) + \
   (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
   (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \
   (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])
@@ -2863,7 +2880,7 @@ foreach target : target_dirs
     endif
     config_target += { 'CONFIG_LINUX_USER': 'y' }
   elif target.endswith('bsd-user')
-    if 'CONFIG_BSD' not in config_host
+    if targetos not in bsd_oses
       if default_targets
         continue
       endif
@@ -2994,7 +3011,7 @@ target_dirs = actual_target_dirs
 # pseudo symbol replaces it.
 
 config_all += config_all_devices
-config_all += config_host
+config_all += config_targetos
 config_all += config_all_disas
 config_all += {
   'CONFIG_XEN': xen.found(),
@@ -3341,7 +3358,7 @@ if enable_modules
   modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO')
 endif
 
-qom_ss = qom_ss.apply(config_host, strict: false)
+qom_ss = qom_ss.apply(config_targetos, strict: false)
 libqom = static_library('qom', qom_ss.sources() + genh,
                         dependencies: [qom_ss.dependencies()],
                         name_suffix: 'fa')
@@ -3515,7 +3532,7 @@ foreach d, list : target_modules
       foreach target : target_dirs
         if target.endswith('-softmmu')
           config_target = config_target_mak[target]
-          config_target += config_host
+          config_target += config_targetos
           target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
           c_args = ['-DNEED_CPU_H',
                     '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
@@ -3576,7 +3593,7 @@ qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
                              capture: true,
                              command: [undefsym, nm, '@INPUT@'])
 
-authz_ss = authz_ss.apply(config_host, strict: false)
+authz_ss = authz_ss.apply(config_targetos, strict: false)
 libauthz = static_library('authz', authz_ss.sources() + genh,
                           dependencies: [authz_ss.dependencies()],
                           name_suffix: 'fa',
@@ -3585,7 +3602,7 @@ libauthz = static_library('authz', authz_ss.sources() + genh,
 authz = declare_dependency(link_whole: libauthz,
                            dependencies: qom)
 
-crypto_ss = crypto_ss.apply(config_host, strict: false)
+crypto_ss = crypto_ss.apply(config_targetos, strict: false)
 libcrypto = static_library('crypto', crypto_ss.sources() + genh,
                            dependencies: [crypto_ss.dependencies()],
                            name_suffix: 'fa',
@@ -3594,7 +3611,7 @@ libcrypto = static_library('crypto', crypto_ss.sources() + genh,
 crypto = declare_dependency(link_whole: libcrypto,
                             dependencies: [authz, qom])
 
-io_ss = io_ss.apply(config_host, strict: false)
+io_ss = io_ss.apply(config_targetos, strict: false)
 libio = static_library('io', io_ss.sources() + genh,
                        dependencies: [io_ss.dependencies()],
                        link_with: libqemuutil,
@@ -3610,7 +3627,7 @@ migration = declare_dependency(link_with: libmigration,
                                dependencies: [zlib, qom, io])
 system_ss.add(migration)
 
-block_ss = block_ss.apply(config_host, strict: false)
+block_ss = block_ss.apply(config_targetos, strict: false)
 libblock = static_library('block', block_ss.sources() + genh,
                           dependencies: block_ss.dependencies(),
                           link_depends: block_syms,
@@ -3621,7 +3638,7 @@ block = declare_dependency(link_whole: [libblock],
                            link_args: '@block.syms',
                            dependencies: [crypto, io])
 
-blockdev_ss = blockdev_ss.apply(config_host, strict: false)
+blockdev_ss = blockdev_ss.apply(config_targetos, strict: false)
 libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
                              dependencies: blockdev_ss.dependencies(),
                              name_suffix: 'fa',
@@ -3630,7 +3647,7 @@ libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
 blockdev = declare_dependency(link_whole: [libblockdev],
                               dependencies: [block, event_loop_base])
 
-qmp_ss = qmp_ss.apply(config_host, strict: false)
+qmp_ss = qmp_ss.apply(config_targetos, strict: false)
 libqmp = static_library('qmp', qmp_ss.sources() + genh,
                         dependencies: qmp_ss.dependencies(),
                         name_suffix: 'fa',
@@ -3645,7 +3662,7 @@ libchardev = static_library('chardev', chardev_ss.sources() + genh,
 
 chardev = declare_dependency(link_whole: libchardev)
 
-hwcore_ss = hwcore_ss.apply(config_host, strict: false)
+hwcore_ss = hwcore_ss.apply(config_targetos, strict: false)
 libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
                            name_suffix: 'fa',
                            build_by_default: false)
@@ -3702,7 +3719,7 @@ foreach target : target_dirs
             '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
   link_args = emulator_link_args
 
-  config_target += config_host
+  config_target += config_targetos
   target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
   if targetos == 'linux'
     target_inc += include_directories('linux-headers', is_system: true)
diff --git a/qga/meson.build b/qga/meson.build
index dd18092f561..59cae0cc6ee 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -85,7 +85,7 @@ qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
   'vss-win32.c'
 ))
 
-qga_ss = qga_ss.apply(config_host, strict: false)
+qga_ss = qga_ss.apply(config_targetos, strict: false)
 
 gen_tlb = []
 qga_libs = []
@@ -180,7 +180,7 @@ test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
 # the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
 # this when an alternative is implemented or when the underlying glib
 # issue is identified/fix
-#if 'CONFIG_POSIX' in config_host
+#if targetos != 'windows'
 if false
   srcs = [files('commands-posix-ssh.c')]
   i = 0
diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build
index 49c9d2eac91..5e90cd32b40 100644
--- a/storage-daemon/meson.build
+++ b/storage-daemon/meson.build
@@ -5,7 +5,7 @@ qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil, gnutls)
 subdir('qapi')
 
 if have_tools
-  qsd_ss = qsd_ss.apply(config_host, strict: false)
+  qsd_ss = qsd_ss.apply(config_targetos, strict: false)
   qsd = executable('qemu-storage-daemon',
                    qsd_ss.sources(),
                    dependencies: qsd_ss.dependencies(),
diff --git a/tcg/meson.build b/tcg/meson.build
index c0252c41988..0014dca7d4f 100644
--- a/tcg/meson.build
+++ b/tcg/meson.build
@@ -22,7 +22,7 @@ if get_option('tcg_interpreter')
   tcg_ss.add(files('tci.c'))
 endif
 
-tcg_ss = tcg_ss.apply(config_host, strict: false)
+tcg_ss = tcg_ss.apply(config_targetos, strict: false)
 
 libtcg_user = static_library('tcg_user',
                              tcg_ss.sources() + genh,
diff --git a/tests/meson.build b/tests/meson.build
index c2528a88f99..debaa4505eb 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -68,7 +68,7 @@ test_deps = {
   'test-qht-par': qht_bench,
 }
 
-if have_tools and have_vhost_user and 'CONFIG_LINUX' in config_host
+if have_tools and have_vhost_user and targetos == 'linux'
   executable('vhost-user-bridge',
              sources: files('vhost-user-bridge.c'),
              dependencies: [qemuutil, vhost_user])
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index df63909ee51..383bdfeda96 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -38,8 +38,8 @@ qtests_cxl = \
 #        for the availability of the default NICs in the tests
 qtests_filter = \
   (get_option('default_devices') and slirp.found() ? ['test-netfilter'] : []) + \
-  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
-  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
+  (get_option('default_devices') and targetos != 'windows' ? ['test-filter-mirror'] : []) + \
+  (get_option('default_devices') and targetos != 'windows' ? ['test-filter-redirector'] : [])
 
 qtests_i386 = \
   (slirp.found() ? ['pxe-test'] : []) + \
@@ -48,7 +48,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +           \
   (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) +                  \
   (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) +            \
-  (config_host.has_key('CONFIG_LINUX') and                                                  \
+  (targetos == 'linux' and                                                                  \
    config_all_devices.has_key('CONFIG_ISA_IPMI_BT') and
    config_all_devices.has_key('CONFIG_IPMI_EXTERN') ? ['ipmi-bt-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) +              \
@@ -74,7 +74,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) +                   \
   (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) +                 \
-  (config_host.has_key('CONFIG_POSIX') and                                                  \
+  (targetos != 'windows' and                                                                \
    config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) +                   \
   (config_all_devices.has_key('CONFIG_PCIE_PORT') and                                       \
    config_all_devices.has_key('CONFIG_VIRTIO_NET') and                                      \
@@ -275,7 +275,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_SERIAL')
   qos_test_ss.add(files('virtio-serial-test.c'))
 endif
 
-if config_host.has_key('CONFIG_POSIX')
+if targetos != 'windows'
   qos_test_ss.add(files('e1000e-test.c'))
 endif
 if have_virtfs
@@ -308,7 +308,7 @@ qtests = {
   'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
   'migration-test': migration_files,
   'pxe-test': files('boot-sector.c'),
-  'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
+  'qos-test': [chardev, io, qos_test_ss.apply(config_targetos, strict: false).sources()],
   'tpm-crb-swtpm-test': [io, tpmemu_files],
   'tpm-crb-test': [io, tpmemu_files],
   'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 93977cc32d2..0299ef6906c 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -98,7 +98,7 @@ if have_block
   }
   if gnutls.found() and \
      tasn1.found() and \
-     'CONFIG_POSIX' in config_host
+     targetos != 'windows'
     tests += {
       'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
                                    tasn1, crypto, gnutls],
@@ -113,7 +113,7 @@ if have_block
   if xts == 'private'
     tests += {'test-crypto-xts': [crypto, io]}
   endif
-  if 'CONFIG_POSIX' in config_host
+  if targetos != 'windows'
     tests += {
       'test-image-locking': [testblock],
       'test-nested-aio-poll': [testblock],
@@ -148,7 +148,7 @@ if have_system
   # are not runnable under TSan due to a known issue.
   # https://github.com/google/sanitizers/issues/1116
   if not get_option('tsan')
-    if 'CONFIG_POSIX' in config_host
+    if targetos != 'windows'
         tests += {
           'test-char': ['socket-helpers.c', qom, io, chardev]
         }
-- 
2.41.0



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

* [PULL 32/51] meson: list leftover CONFIG_* symbols
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (30 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 31/51] configure, meson: remove target OS symbols " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 33/51] configure: remove dead code Paolo Bonzini
                   ` (19 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

There are no config-host.mak symbols anymore that are needed in
config-host.h; the only symbols that are included in config_host_data via
the foreach loop are:

- CONFIG_DEFAULT_TARGETS, which is not used by C code.

- CONFIG_TCG and CONFIG_TCG_INTERPRETER, which are not part of config-host.mak

So, list these two symbols explicitly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/build-system.rst |  8 ++------
 meson.build                 | 12 ++++--------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst
index 64efa26b905..0f990bb3e90 100644
--- a/docs/devel/build-system.rst
+++ b/docs/devel/build-system.rst
@@ -460,17 +460,13 @@ Built by configure:
 
 ``config-host.mak``
   When configure has determined the characteristics of the build host it
-  will write them to this file for use in ``Makefile`` and to a smaller
-  extent ``meson.build``. These include the paths to various tools and a
-  variety of ``CONFIG_*`` variables related to optionally enabled features.
+  will write the paths to various tools to this file, for use in ``Makefile``
+  and to a smaller extent ``meson.build``.
 
   ``config-host.mak`` is also used as a dependency checking mechanism. If make
   sees that the modification timestamp on configure is newer than that on
   ``config-host.mak``, then configure will be re-run.
 
-  The variables defined here apply to all QEMU
-  build outputs.
-
 ``config-meson.cross``
 
   A Meson "cross file" (or native file) used to communicate the paths to
diff --git a/meson.build b/meson.build
index 16f0475955d..c24ea69f774 100644
--- a/meson.build
+++ b/meson.build
@@ -691,7 +691,6 @@ if get_option('tcg').allowed()
   endif
   if get_option('tcg_interpreter')
     tcg_arch = 'tci'
-    config_host += { 'CONFIG_TCG_INTERPRETER': 'y' }
   elif host_arch == 'x86_64'
     tcg_arch = 'i386'
   elif host_arch == 'ppc64'
@@ -701,7 +700,6 @@ if get_option('tcg').allowed()
                         language: all_languages)
 
   accelerators += 'CONFIG_TCG'
-  config_host += { 'CONFIG_TCG': 'y' }
 endif
 
 if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
@@ -2132,6 +2130,10 @@ if seccomp.found()
 endif
 config_host_data.set('CONFIG_SNAPPY', snappy.found())
 config_host_data.set('CONFIG_SOLARIS', targetos == 'sunos')
+if get_option('tcg').allowed()
+  config_host_data.set('CONFIG_TCG', 1)
+  config_host_data.set('CONFIG_TCG_INTERPRETER', tcg_arch == 'tci')
+endif
 config_host_data.set('CONFIG_TPM', have_tpm)
 config_host_data.set('CONFIG_TSAN', get_option('tsan'))
 config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
@@ -2760,12 +2762,6 @@ if targetos == 'windows' and 'cpp' in all_languages
 endif
 config_host_data.set('HAVE_VSS_SDK', have_vss_sdk)
 
-foreach k, v: config_host
-  if k.startswith('CONFIG_')
-    config_host_data.set(k, v == 'y' ? 1 : v)
-  endif
-endforeach
-
 # Older versions of MinGW do not import _lock_file and _unlock_file properly.
 # This was fixed for v6.0.0 with commit b48e3ac8969d.
 if targetos == 'windows'
-- 
2.41.0



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

* [PULL 33/51] configure: remove dead code
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (31 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 32/51] meson: list leftover CONFIG_* symbols Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 34/51] Python: Drop support for Python 3.7 Paolo Bonzini
                   ` (18 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/configure b/configure
index ef085376922..48ae0fc05ab 100755
--- a/configure
+++ b/configure
@@ -1126,14 +1126,6 @@ else
     done
 fi
 
-# see if system emulation was really requested
-case " $target_list " in
-  *"-softmmu "*) softmmu=yes
-  ;;
-  *) softmmu=no
-  ;;
-esac
-
 if test "$tcg" = "auto"; then
   if test -z "$target_list"; then
     tcg="disabled"
-- 
2.41.0



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

* [PULL 34/51] Python: Drop support for Python 3.7
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (32 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 33/51] configure: remove dead code Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 35/51] mkvenv: assume presence of importlib.metadata Paolo Bonzini
                   ` (17 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Debian 10 is not anymore a supported distro, since Debian 12 was
released on June 10, 2023.  Our supported build platforms as of today
all support at least 3.8 (and all of them except for Ubuntu 20.04
support 3.9):

openSUSE Leap 15.5: 3.6.15 (3.11.2)
CentOS Stream 8:    3.6.8  (3.8.13, 3.9.16, 3.11.4)
CentOS Stream 9:    3.9.17 (3.11.4)
Fedora 37:          3.11.4
Fedora 38:          3.11.4
Debian 11:          3.9.2
Debian 12:          3.11.2
Alpine 3.14, 3.15:  3.9.16
Alpine 3.16, 3.17:  3.10.10
Ubuntu 20.04 LTS:   3.8.10
Ubuntu 22.04 LTS:   3.10.12
NetBSD 9.3:         3.9.13*
FreeBSD 12.4:       3.9.16
FreeBSD 13.1:       3.9.18
OpenBSD 7.2:        3.9.17

Note: NetBSD does not appear to have a default meta-package, but offers
several options, the lowest of which is 3.7.15. However, "python39"
appears to be a pre-requisite to one of the other packages we request
in tests/vm/netbsd.

Since it is safe under our supported platform policy, bump our
minimum supported version of Python to 3.8.  The two most interesting
features to have by default include:

- the importlib.metadata module, whose lack is responsible for over 100
  lines of code in mkvenv.py

- improvements to asyncio, for example asyncio.CancelledError
  inherits from BaseException rather than Exception

In addition, code can now use the assignment operator ':='

Because mypy now learns about importlib.metadata, a small change to
mkvenv.py is needed to pass type checking.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                | 8 ++++----
 python/Makefile          | 8 ++++----
 python/scripts/mkvenv.py | 5 ++++-
 python/setup.cfg         | 7 +++----
 python/tests/minreqs.txt | 2 +-
 scripts/qapi/mypy.ini    | 2 +-
 6 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 48ae0fc05ab..e08127045d0 100755
--- a/configure
+++ b/configure
@@ -552,16 +552,16 @@ if test -n "$linux_arch" && ! test -d "$source_path/linux-headers/asm-$linux_arc
 fi
 
 check_py_version() {
-    # We require python >= 3.7.
+    # We require python >= 3.8.
     # NB: a True python conditional creates a non-zero return code (Failure)
-    "$1" -c 'import sys; sys.exit(sys.version_info < (3,7))'
+    "$1" -c 'import sys; sys.exit(sys.version_info < (3,8))'
 }
 
 first_python=
 if test -z "${PYTHON}"; then
     # A bare 'python' is traditionally python 2.x, but some distros
     # have it as python 3.x, so check in both places.
-    for binary in python3 python python3.11 python3.10 python3.9 python3.8 python3.7; do
+    for binary in python3 python python3.11 python3.10 python3.9 python3.8; do
         if has "$binary"; then
             python=$(command -v "$binary")
             if check_py_version "$python"; then
@@ -952,7 +952,7 @@ then
 fi
 
 if ! check_py_version "$python"; then
-  error_exit "Cannot use '$python', Python >= 3.7 is required." \
+  error_exit "Cannot use '$python', Python >= 3.8 is required." \
              "Use --python=/path/to/python to specify a supported Python." \
              "Maybe try:" \
              "  openSUSE Leap 15.3+: zypper install python39" \
diff --git a/python/Makefile b/python/Makefile
index 7c70dcc8d14..1fa4ba2498e 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -9,13 +9,13 @@ help:
 	@echo "make check-minreqs:"
 	@echo "    Run tests in the minreqs virtual environment."
 	@echo "    These tests use the oldest dependencies."
-	@echo "    Requires: Python 3.7"
-	@echo "    Hint (Fedora): 'sudo dnf install python3.7'"
+	@echo "    Requires: Python 3.8"
+	@echo "    Hint (Fedora): 'sudo dnf install python3.8'"
 	@echo ""
 	@echo "make check-tox:"
 	@echo "    Run tests against multiple python versions."
 	@echo "    These tests use the newest dependencies."
-	@echo "    Requires: Python 3.7 - 3.11, and tox."
+	@echo "    Requires: Python 3.8 - 3.11, and tox."
 	@echo "    Hint (Fedora): 'sudo dnf install python3-tox python3.11'"
 	@echo "    The variable QEMU_TOX_EXTRA_ARGS can be use to pass extra"
 	@echo "    arguments to tox".
@@ -59,7 +59,7 @@ PIP_INSTALL = pip install --disable-pip-version-check
 min-venv: $(QEMU_MINVENV_DIR) $(QEMU_MINVENV_DIR)/bin/activate
 $(QEMU_MINVENV_DIR) $(QEMU_MINVENV_DIR)/bin/activate: setup.cfg tests/minreqs.txt
 	@echo "VENV $(QEMU_MINVENV_DIR)"
-	@python3.7 -m venv $(QEMU_MINVENV_DIR)
+	@python3.8 -m venv $(QEMU_MINVENV_DIR)
 	@(								\
 		echo "ACTIVATE $(QEMU_MINVENV_DIR)";			\
 		. $(QEMU_MINVENV_DIR)/bin/activate;			\
diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
index 4f2349fbb65..57a24948031 100644
--- a/python/scripts/mkvenv.py
+++ b/python/scripts/mkvenv.py
@@ -435,6 +435,7 @@ def _gen_importlib(packages: Sequence[str]) -> Iterator[str]:
     try:
         # First preference: Python 3.8+ stdlib
         from importlib.metadata import (  # type: ignore
+            EntryPoint,
             PackageNotFoundError,
             distribution,
         )
@@ -442,6 +443,7 @@ def _gen_importlib(packages: Sequence[str]) -> Iterator[str]:
         logger.debug("%s", str(exc))
         # Second preference: Commonly available PyPI backport
         from importlib_metadata import (  # type: ignore
+            EntryPoint,
             PackageNotFoundError,
             distribution,
         )
@@ -449,7 +451,8 @@ def _gen_importlib(packages: Sequence[str]) -> Iterator[str]:
     def _generator() -> Iterator[str]:
         for package in packages:
             try:
-                entry_points = distribution(package).entry_points
+                entry_points: Iterator[EntryPoint] = \
+                    iter(distribution(package).entry_points)
             except PackageNotFoundError:
                 continue
 
diff --git a/python/setup.cfg b/python/setup.cfg
index e74b58a8c24..f6d2d8a1362 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -14,7 +14,6 @@ classifiers =
     Natural Language :: English
     Operating System :: OS Independent
     Programming Language :: Python :: 3 :: Only
-    Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
@@ -22,7 +21,7 @@ classifiers =
     Typing :: Typed
 
 [options]
-python_requires = >= 3.7
+python_requires = >= 3.8
 packages =
     qemu.qmp
     qemu.machine
@@ -76,7 +75,7 @@ exclude = __pycache__,
 
 [mypy]
 strict = True
-python_version = 3.7
+python_version = 3.8
 warn_unused_configs = True
 namespace_packages = True
 warn_unused_ignores = False
@@ -192,7 +191,7 @@ multi_line_output=3
 # of python available on your system to run this test.
 
 [tox:tox]
-envlist = py37, py38, py39, py310, py311
+envlist = py38, py39, py310, py311
 skip_missing_interpreters = true
 
 [testenv]
diff --git a/python/tests/minreqs.txt b/python/tests/minreqs.txt
index 979461be6bb..a3f423efd84 100644
--- a/python/tests/minreqs.txt
+++ b/python/tests/minreqs.txt
@@ -1,5 +1,5 @@
 # This file lists the ***oldest possible dependencies*** needed to run
-# "make check" successfully under ***Python 3.7***. It is used primarily
+# "make check" successfully under ***Python 3.8***. It is used primarily
 # by GitLab CI to ensure that our stated minimum versions in setup.cfg
 # are truthful and regularly validated.
 #
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
index 3463307ddc7..56e0dfb1327 100644
--- a/scripts/qapi/mypy.ini
+++ b/scripts/qapi/mypy.ini
@@ -1,7 +1,7 @@
 [mypy]
 strict = True
 disallow_untyped_calls = False
-python_version = 3.7
+python_version = 3.8
 
 [mypy-qapi.schema]
 disallow_untyped_defs = False
-- 
2.41.0



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

* [PULL 35/51] mkvenv: assume presence of importlib.metadata
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (33 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 34/51] Python: Drop support for Python 3.7 Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 36/51] Revert "mkvenv: work around broken pip installations on Debian 10" Paolo Bonzini
                   ` (16 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

importlib.metadata is included in Python 3.8, so there is no
need to fallback to either importlib-metadata or pkgresources
when generating console script shims.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 python/scripts/mkvenv.py | 197 ++++++---------------------------------
 python/setup.cfg         |   9 --
 2 files changed, 28 insertions(+), 178 deletions(-)

diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
index 57a24948031..6797e12e349 100644
--- a/python/scripts/mkvenv.py
+++ b/python/scripts/mkvenv.py
@@ -61,7 +61,6 @@
 
 """
 
-# The duplication between importlib and pkg_resources does not help
 # pylint: disable=too-many-lines
 
 # Copyright (C) 2022-2023 Red Hat, Inc.
@@ -74,6 +73,13 @@
 # later. See the COPYING file in the top-level directory.
 
 import argparse
+from importlib.metadata import (
+    Distribution,
+    EntryPoint,
+    PackageNotFoundError,
+    distribution,
+    version,
+)
 from importlib.util import find_spec
 import logging
 import os
@@ -428,25 +434,7 @@ def _stringify(data: Union[str, bytes]) -> str:
     print(builder.get_value("env_exe"))
 
 
-def _gen_importlib(packages: Sequence[str]) -> Iterator[str]:
-    # pylint: disable=import-outside-toplevel
-    # pylint: disable=no-name-in-module
-    # pylint: disable=import-error
-    try:
-        # First preference: Python 3.8+ stdlib
-        from importlib.metadata import (  # type: ignore
-            EntryPoint,
-            PackageNotFoundError,
-            distribution,
-        )
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-        # Second preference: Commonly available PyPI backport
-        from importlib_metadata import (  # type: ignore
-            EntryPoint,
-            PackageNotFoundError,
-            distribution,
-        )
+def _get_entry_points(packages: Sequence[str]) -> Iterator[str]:
 
     def _generator() -> Iterator[str]:
         for package in packages:
@@ -468,24 +456,6 @@ def _generator() -> Iterator[str]:
     return _generator()
 
 
-def _gen_pkg_resources(packages: Sequence[str]) -> Iterator[str]:
-    # pylint: disable=import-outside-toplevel
-    # Bundled with setuptools; has a good chance of being available.
-    import pkg_resources
-
-    def _generator() -> Iterator[str]:
-        for package in packages:
-            try:
-                eps = pkg_resources.get_entry_map(package, "console_scripts")
-            except pkg_resources.DistributionNotFound:
-                continue
-
-            for entry_point in eps.values():
-                yield str(entry_point)
-
-    return _generator()
-
-
 def generate_console_scripts(
     packages: Sequence[str],
     python_path: Optional[str] = None,
@@ -510,30 +480,11 @@ def generate_console_scripts(
     if not packages:
         return
 
-    def _get_entry_points() -> Iterator[str]:
-        """Python 3.7 compatibility shim for iterating entry points."""
-        # Python 3.8+, or Python 3.7 with importlib_metadata installed.
-        try:
-            return _gen_importlib(packages)
-        except ImportError as exc:
-            logger.debug("%s", str(exc))
-
-        # Python 3.7 with setuptools installed.
-        try:
-            return _gen_pkg_resources(packages)
-        except ImportError as exc:
-            logger.debug("%s", str(exc))
-            raise Ouch(
-                "Neither importlib.metadata nor pkg_resources found, "
-                "can't generate console script shims.\n"
-                "Use Python 3.8+, or install importlib-metadata or setuptools."
-            ) from exc
-
     maker = distlib.scripts.ScriptMaker(None, bin_path)
     maker.variants = {""}
     maker.clobber = False
 
-    for entry_point in _get_entry_points():
+    for entry_point in _get_entry_points(packages):
         for filename in maker.make(entry_point):
             logger.debug("wrote console_script '%s'", filename)
 
@@ -587,57 +538,6 @@ def pkgname_from_depspec(dep_spec: str) -> str:
     return match.group(0)
 
 
-def _get_path_importlib(package: str) -> Optional[str]:
-    # pylint: disable=import-outside-toplevel
-    # pylint: disable=no-name-in-module
-    # pylint: disable=import-error
-    try:
-        # First preference: Python 3.8+ stdlib
-        from importlib.metadata import (  # type: ignore
-            PackageNotFoundError,
-            distribution,
-        )
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-        # Second preference: Commonly available PyPI backport
-        from importlib_metadata import (  # type: ignore
-            PackageNotFoundError,
-            distribution,
-        )
-
-    try:
-        return str(distribution(package).locate_file("."))
-    except PackageNotFoundError:
-        return None
-
-
-def _get_path_pkg_resources(package: str) -> Optional[str]:
-    # pylint: disable=import-outside-toplevel
-    # Bundled with setuptools; has a good chance of being available.
-    import pkg_resources
-
-    try:
-        return str(pkg_resources.get_distribution(package).location)
-    except pkg_resources.DistributionNotFound:
-        return None
-
-
-def _get_path(package: str) -> Optional[str]:
-    try:
-        return _get_path_importlib(package)
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-
-    try:
-        return _get_path_pkg_resources(package)
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-        raise Ouch(
-            "Neither importlib.metadata nor pkg_resources found. "
-            "Use Python 3.8+, or install importlib-metadata or setuptools."
-        ) from exc
-
-
 def _path_is_prefix(prefix: Optional[str], path: str) -> bool:
     try:
         return (
@@ -647,65 +547,14 @@ def _path_is_prefix(prefix: Optional[str], path: str) -> bool:
         return False
 
 
-def _is_system_package(package: str) -> bool:
-    path = _get_path(package)
-    return path is not None and not (
+def _is_system_package(dist: Distribution) -> bool:
+    path = str(dist.locate_file("."))
+    return not (
         _path_is_prefix(sysconfig.get_path("purelib"), path)
         or _path_is_prefix(sysconfig.get_path("platlib"), path)
     )
 
 
-def _get_version_importlib(package: str) -> Optional[str]:
-    # pylint: disable=import-outside-toplevel
-    # pylint: disable=no-name-in-module
-    # pylint: disable=import-error
-    try:
-        # First preference: Python 3.8+ stdlib
-        from importlib.metadata import (  # type: ignore
-            PackageNotFoundError,
-            distribution,
-        )
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-        # Second preference: Commonly available PyPI backport
-        from importlib_metadata import (  # type: ignore
-            PackageNotFoundError,
-            distribution,
-        )
-
-    try:
-        return str(distribution(package).version)
-    except PackageNotFoundError:
-        return None
-
-
-def _get_version_pkg_resources(package: str) -> Optional[str]:
-    # pylint: disable=import-outside-toplevel
-    # Bundled with setuptools; has a good chance of being available.
-    import pkg_resources
-
-    try:
-        return str(pkg_resources.get_distribution(package).version)
-    except pkg_resources.DistributionNotFound:
-        return None
-
-
-def _get_version(package: str) -> Optional[str]:
-    try:
-        return _get_version_importlib(package)
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-
-    try:
-        return _get_version_pkg_resources(package)
-    except ImportError as exc:
-        logger.debug("%s", str(exc))
-        raise Ouch(
-            "Neither importlib.metadata nor pkg_resources found. "
-            "Use Python 3.8+, or install importlib-metadata or setuptools."
-        ) from exc
-
-
 def diagnose(
     dep_spec: str,
     online: bool,
@@ -731,7 +580,11 @@ def diagnose(
     bad = False
 
     pkg_name = pkgname_from_depspec(dep_spec)
-    pkg_version = _get_version(pkg_name)
+    pkg_version: Optional[str] = None
+    try:
+        pkg_version = version(pkg_name)
+    except PackageNotFoundError:
+        pass
 
     lines = []
 
@@ -868,19 +721,25 @@ def _do_ensure(
         constraint = _make_version_constraint(info, False)
         matcher = distlib.version.LegacyMatcher(name + constraint)
         print(f"mkvenv: checking for {matcher}", file=sys.stderr)
-        ver = _get_version(name)
+
+        dist: Optional[Distribution] = None
+        try:
+            dist = distribution(matcher.name)
+        except PackageNotFoundError:
+            pass
+
         if (
-            ver is None
+            dist is None
             # Always pass installed package to pip, so that they can be
             # updated if the requested version changes
-            or not _is_system_package(name)
-            or not matcher.match(distlib.version.LegacyVersion(ver))
+            or not _is_system_package(dist)
+            or not matcher.match(distlib.version.LegacyVersion(dist.version))
         ):
             absent.append(name + _make_version_constraint(info, True))
             if len(absent) == 1:
                 canary = info.get("canary", None)
         else:
-            logger.info("found %s %s", name, ver)
+            logger.info("found %s %s", name, dist.version)
             present.append(name)
 
     if present:
diff --git a/python/setup.cfg b/python/setup.cfg
index f6d2d8a1362..8c67dce4579 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -108,15 +108,6 @@ ignore_missing_imports = True
 [mypy-pygments]
 ignore_missing_imports = True
 
-[mypy-importlib.metadata]
-ignore_missing_imports = True
-
-[mypy-importlib_metadata]
-ignore_missing_imports = True
-
-[mypy-pkg_resources]
-ignore_missing_imports = True
-
 [mypy-distlib]
 ignore_missing_imports = True
 
-- 
2.41.0



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

* [PULL 36/51] Revert "mkvenv: work around broken pip installations on Debian 10"
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (34 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 35/51] mkvenv: assume presence of importlib.metadata Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 37/51] hw/i386/pc: Include missing 'sysemu/tcg.h' header Paolo Bonzini
                   ` (15 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

Debian 10 has Python 3.7, so it is not possible to use it anymore
now that Python 3.8 is required.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 python/scripts/mkvenv.py | 74 +++++++++-------------------------------
 1 file changed, 16 insertions(+), 58 deletions(-)

diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
index 6797e12e349..d0b9c215ca2 100644
--- a/python/scripts/mkvenv.py
+++ b/python/scripts/mkvenv.py
@@ -61,8 +61,6 @@
 
 """
 
-# pylint: disable=too-many-lines
-
 # Copyright (C) 2022-2023 Red Hat, Inc.
 #
 # Authors:
@@ -195,7 +193,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
             ):
                 kwargs["with_pip"] = False
             else:
-                check_ensurepip(suggest_remedy=True)
+                check_ensurepip()
 
         super().__init__(*args, **kwargs)
 
@@ -300,7 +298,7 @@ def need_ensurepip() -> bool:
     return True
 
 
-def check_ensurepip(prefix: str = "", suggest_remedy: bool = False) -> None:
+def check_ensurepip() -> None:
     """
     Check that we have ensurepip.
 
@@ -311,15 +309,12 @@ def check_ensurepip(prefix: str = "", suggest_remedy: bool = False) -> None:
             "Python's ensurepip module is not found.\n"
             "It's normally part of the Python standard library, "
             "maybe your distribution packages it separately?\n"
-            "(Debian puts ensurepip in its python3-venv package.)\n"
+            "Either install ensurepip, or alleviate the need for it in the "
+            "first place by installing pip and setuptools for "
+            f"'{sys.executable}'.\n"
+            "(Hint: Debian puts ensurepip in its python3-venv package.)"
         )
-        if suggest_remedy:
-            msg += (
-                "Either install ensurepip, or alleviate the need for it in the"
-                " first place by installing pip and setuptools for "
-                f"'{sys.executable}'.\n"
-            )
-        raise Ouch(prefix + msg)
+        raise Ouch(msg)
 
     # ensurepip uses pyexpat, which can also go missing on us:
     if not find_spec("pyexpat"):
@@ -327,15 +322,12 @@ def check_ensurepip(prefix: str = "", suggest_remedy: bool = False) -> None:
             "Python's pyexpat module is not found.\n"
             "It's normally part of the Python standard library, "
             "maybe your distribution packages it separately?\n"
-            "(NetBSD's pkgsrc debundles this to e.g. 'py310-expat'.)\n"
+            "Either install pyexpat, or alleviate the need for it in the "
+            "first place by installing pip and setuptools for "
+            f"'{sys.executable}'.\n\n"
+            "(Hint: NetBSD's pkgsrc debundles this to e.g. 'py310-expat'.)"
         )
-        if suggest_remedy:
-            msg += (
-                "Either install pyexpat, or alleviate the need for it in the "
-                "first place by installing pip and setuptools for "
-                f"'{sys.executable}'.\n"
-            )
-        raise Ouch(prefix + msg)
+        raise Ouch(msg)
 
 
 def make_venv(  # pylint: disable=too-many-arguments
@@ -489,38 +481,6 @@ def generate_console_scripts(
             logger.debug("wrote console_script '%s'", filename)
 
 
-def checkpip() -> bool:
-    """
-    Debian10 has a pip that's broken when used inside of a virtual environment.
-
-    We try to detect and correct that case here.
-    """
-    try:
-        # pylint: disable=import-outside-toplevel,unused-import,import-error
-        # pylint: disable=redefined-outer-name
-        import pip._internal  # type: ignore  # noqa: F401
-
-        logger.debug("pip appears to be working correctly.")
-        return False
-    except ModuleNotFoundError as exc:
-        if exc.name == "pip._internal":
-            # Uh, fair enough. They did say "internal".
-            # Let's just assume it's fine.
-            return False
-        logger.warning("pip appears to be malfunctioning: %s", str(exc))
-
-    check_ensurepip("pip appears to be non-functional, and ")
-
-    logger.debug("Attempting to repair pip ...")
-    subprocess.run(
-        (sys.executable, "-m", "ensurepip"),
-        stdout=subprocess.DEVNULL,
-        check=True,
-    )
-    logger.debug("Pip is now (hopefully) repaired!")
-    return True
-
-
 def pkgname_from_depspec(dep_spec: str) -> str:
     """
     Parse package name out of a PEP-508 depspec.
@@ -877,12 +837,10 @@ def post_venv_setup() -> None:
     This is intended to be run *inside the venv* after it is created.
     """
     logger.debug("post_venv_setup()")
-    # Test for a broken pip (Debian 10 or derivative?) and fix it if needed
-    if not checkpip():
-        # Finally, generate a 'pip' script so the venv is usable in a normal
-        # way from the CLI. This only happens when we inherited pip from a
-        # parent/system-site and haven't run ensurepip in some way.
-        generate_console_scripts(["pip"])
+    # Generate a 'pip' script so the venv is usable in a normal
+    # way from the CLI. This only happens when we inherited pip from a
+    # parent/system-site and haven't run ensurepip in some way.
+    generate_console_scripts(["pip"])
 
 
 def _add_create_subcommand(subparsers: Any) -> None:
-- 
2.41.0



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

* [PULL 37/51] hw/i386/pc: Include missing 'sysemu/tcg.h' header
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (35 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 36/51] Revert "mkvenv: work around broken pip installations on Debian 10" Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header Paolo Bonzini
                   ` (14 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Since commit 6f529b7534 ("target/i386: move FERR handling
to target/i386") pc_q35_init() calls tcg_enabled() which
is declared in "sysemu/tcg.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-2-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/pc_q35.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 37c4814bedf..43413dd1ac4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -34,6 +34,7 @@
 #include "hw/loader.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/rtc/mc146818rtc.h"
+#include "sysemu/tcg.h"
 #include "sysemu/kvm.h"
 #include "hw/kvm/clock.h"
 #include "hw/pci-host/q35.h"
-- 
2.41.0



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

* [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (36 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 37/51] hw/i386/pc: Include missing 'sysemu/tcg.h' header Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 39/51] hw/i386/fw_cfg: " Paolo Bonzini
                   ` (13 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Both pc_piix.c and pc_q35.c files use CPU_VERSION_LEGACY
which is defined in "target/i386/cpu.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-3-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/pc_piix.c | 1 +
 hw/i386/pc_q35.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ce1ac952749..f0df12f6fa8 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -69,6 +69,7 @@
 #include "hw/mem/nvdimm.h"
 #include "hw/i386/acpi-build.h"
 #include "kvm/kvm-cpu.h"
+#include "target/i386/cpu.h"
 
 #define MAX_IDE_BUS 2
 #define XEN_IOAPIC_NUM_PIRQS 128ULL
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 43413dd1ac4..8ecc78c822b 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -58,6 +58,7 @@
 #include "hw/hyperv/vmbus-bridge.h"
 #include "hw/mem/nvdimm.h"
 #include "hw/i386/acpi-build.h"
+#include "target/i386/cpu.h"
 
 /* ICH9 AHCI has 6 ports */
 #define MAX_SATA_PORTS     6
-- 
2.41.0



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

* [PULL 39/51] hw/i386/fw_cfg: Include missing 'cpu.h' header
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (37 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 40/51] target/i386/helper: Restrict KVM declarations to system emulation Paolo Bonzini
                   ` (12 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

fw_cfg_build_feature_control() uses CPUID_EXT_VMX which is
defined in "target/i386/cpu.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-4-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/fw_cfg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index 72a42f3c66d..7362daa45a6 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -24,6 +24,7 @@
 #include "kvm/kvm_i386.h"
 #include "qapi/error.h"
 #include CONFIG_DEVICES
+#include "target/i386/cpu.h"
 
 struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
 
-- 
2.41.0



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

* [PULL 40/51] target/i386/helper: Restrict KVM declarations to system emulation
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (38 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 39/51] hw/i386/fw_cfg: " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 41/51] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel() Paolo Bonzini
                   ` (11 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

User emulation doesn't need any KVM declarations.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-5-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/helper.c b/target/i386/helper.c
index 89aa696c6d5..2070dd0dda1 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -22,10 +22,10 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "sysemu/runstate.h"
-#include "kvm/kvm_i386.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/hw_accel.h"
 #include "monitor/monitor.h"
+#include "kvm/kvm_i386.h"
 #endif
 #include "qemu/log.h"
 #ifdef CONFIG_TCG
-- 
2.41.0



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

* [PULL 41/51] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (39 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 40/51] target/i386/helper: Restrict KVM declarations to system emulation Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 42/51] target/i386: Remove unused KVM stubs Paolo Bonzini
                   ` (10 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

In order to have cpu-sysemu.c become accelerator-agnostic,
inline kvm_apic_in_kernel() -- which is a simple wrapper
to kvm_irqchip_in_kernel() -- and use the generic "sysemu/kvm.h"
header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-6-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu-sysemu.c   | 4 ++--
 target/i386/kvm/kvm_i386.h | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c
index 28115edf44f..2375e48178f 100644
--- a/target/i386/cpu-sysemu.c
+++ b/target/i386/cpu-sysemu.c
@@ -19,9 +19,9 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "sysemu/kvm.h"
 #include "sysemu/xen.h"
 #include "sysemu/whpx.h"
-#include "kvm/kvm_i386.h"
 #include "qapi/error.h"
 #include "qapi/qapi-visit-run-state.h"
 #include "qapi/qmp/qdict.h"
@@ -253,7 +253,7 @@ APICCommonClass *apic_get_class(Error **errp)
 
     /* TODO: in-kernel irqchip for hvf */
     if (kvm_enabled()) {
-        if (!kvm_apic_in_kernel()) {
+        if (!kvm_irqchip_in_kernel()) {
             error_setg(errp, "KVM does not support userspace APIC");
             return NULL;
         }
diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index e24753abfe6..470627b7504 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -13,8 +13,6 @@
 
 #include "sysemu/kvm.h"
 
-#define kvm_apic_in_kernel() (kvm_irqchip_in_kernel())
-
 #ifdef CONFIG_KVM
 
 #define kvm_pit_in_kernel() \
-- 
2.41.0



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

* [PULL 42/51] target/i386: Remove unused KVM stubs
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (40 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 41/51] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 43/51] target/i386: Allow elision of kvm_enable_x2apic() Paolo Bonzini
                   ` (9 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Daniel Henrique Barboza

From: Philippe Mathieu-Daudé <philmd@linaro.org>

All these functions:

 - kvm_arch_get_supported_cpuid()
 - kvm_has_smm(()
 - kvm_hyperv_expand_features()
 - kvm_set_max_apic_id()

are called after checking for kvm_enabled(), which is
false when KVM is not built. Since the compiler elides
these functions, their stubs are not used and can be
removed.

Inspired-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-7-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/kvm/kvm-stub.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c
index e052f1c7b0e..f985d9a1d39 100644
--- a/target/i386/kvm/kvm-stub.c
+++ b/target/i386/kvm/kvm-stub.c
@@ -10,42 +10,16 @@
  *
  */
 #include "qemu/osdep.h"
-#include "cpu.h"
 #include "kvm_i386.h"
 
 #ifndef __OPTIMIZE__
-bool kvm_has_smm(void)
-{
-    return 1;
-}
-
 bool kvm_enable_x2apic(void)
 {
     return false;
 }
-
-/* This function is only called inside conditionals which we
- * rely on the compiler to optimize out when CONFIG_KVM is not
- * defined.
- */
-uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
-                                      uint32_t index, int reg)
-{
-    abort();
-}
 #endif
 
 bool kvm_hv_vpindex_settable(void)
 {
     return false;
 }
-
-bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
-{
-    abort();
-}
-
-void kvm_set_max_apic_id(uint32_t max_apic_id)
-{
-    return;
-}
-- 
2.41.0



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

* [PULL 43/51] target/i386: Allow elision of kvm_enable_x2apic()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (41 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 42/51] target/i386: Remove unused KVM stubs Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable() Paolo Bonzini
                   ` (8 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Daniel Henrique Barboza

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Call kvm_enabled() before kvm_enable_x2apic() to let the compiler elide
its call.  Cleanup the code by simplifying "!xen_enabled() &&
kvm_enabled()" to just "kvm_enabled()".

Suggested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-8-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/intel_iommu.c      | 2 +-
 hw/i386/x86.c              | 9 +++------
 target/i386/kvm/kvm-stub.c | 7 -------
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 3ca71df3693..c9961ef752c 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -4053,7 +4053,7 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
             error_setg(errp, "eim=on requires accel=kvm,kernel-irqchip=split");
             return false;
         }
-        if (!kvm_enable_x2apic()) {
+        if (kvm_enabled() && !kvm_enable_x2apic()) {
             error_setg(errp, "eim=on requires support on the KVM side"
                              "(X2APIC_API, first shipped in v4.7)");
             return false;
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index a88a126123b..3e86cf3060f 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -129,13 +129,10 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
                                                       ms->smp.max_cpus - 1) + 1;
 
     /*
-     * Can we support APIC ID 255 or higher?
-     *
-     * Under Xen: yes.
-     * With userspace emulated lapic: no
-     * With KVM's in-kernel lapic: only if X2APIC API is enabled.
+     * Can we support APIC ID 255 or higher?  With KVM, that requires
+     * both in-kernel lapic and X2APIC userspace API.
      */
-    if (x86ms->apic_id_limit > 255 && !xen_enabled() &&
+    if (x86ms->apic_id_limit > 255 && kvm_enabled() &&
         (!kvm_irqchip_in_kernel() || !kvm_enable_x2apic())) {
         error_report("current -smp configuration requires kernel "
                      "irqchip and X2APIC API support.");
diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c
index f985d9a1d39..62cccebee4f 100644
--- a/target/i386/kvm/kvm-stub.c
+++ b/target/i386/kvm/kvm-stub.c
@@ -12,13 +12,6 @@
 #include "qemu/osdep.h"
 #include "kvm_i386.h"
 
-#ifndef __OPTIMIZE__
-bool kvm_enable_x2apic(void)
-{
-    return false;
-}
-#endif
-
 bool kvm_hv_vpindex_settable(void)
 {
     return false;
-- 
2.41.0



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

* [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable()
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (42 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 43/51] target/i386: Allow elision of kvm_enable_x2apic() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM Paolo Bonzini
                   ` (7 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Daniel Henrique Barboza

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Call kvm_enabled() before kvm_hv_vpindex_settable()
to let the compiler elide its call.

kvm-stub.c is now empty, remove it.

Suggested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-9-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/x86.c               |  2 +-
 target/i386/kvm/kvm-stub.c  | 18 ------------------
 target/i386/kvm/meson.build |  2 --
 3 files changed, 1 insertion(+), 21 deletions(-)
 delete mode 100644 target/i386/kvm/kvm-stub.c

diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 3e86cf3060f..f034df8bf62 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -421,7 +421,7 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
     cpu->thread_id = topo_ids.smt_id;
 
     if (hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX) &&
-        !kvm_hv_vpindex_settable()) {
+        kvm_enabled() && !kvm_hv_vpindex_settable()) {
         error_setg(errp, "kernel doesn't allow setting HyperV VP_INDEX");
         return;
     }
diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c
deleted file mode 100644
index 62cccebee4f..00000000000
--- a/target/i386/kvm/kvm-stub.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * QEMU KVM x86 specific function stubs
- *
- * Copyright Linaro Limited 2012
- *
- * Author: Peter Maydell <peter.maydell@linaro.org>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-#include "qemu/osdep.h"
-#include "kvm_i386.h"
-
-bool kvm_hv_vpindex_settable(void)
-{
-    return false;
-}
diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.build
index 40fbde96cac..5d9174bbb5d 100644
--- a/target/i386/kvm/meson.build
+++ b/target/i386/kvm/meson.build
@@ -1,5 +1,3 @@
-i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
-
 i386_softmmu_kvm_ss = ss.source_set()
 
 i386_softmmu_kvm_ss.add(files(
-- 
2.41.0



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

* [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (43 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable() Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 46/51] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets Paolo Bonzini
                   ` (6 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Keep the function accessed by target/i386/ and hw/i386/
exposed, restrict the ones accessed by target/i386/kvm/.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-10-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/kvm/kvm_i386.h | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index 470627b7504..ff309bad25f 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -31,30 +31,35 @@
 #endif  /* CONFIG_KVM */
 
 bool kvm_has_smm(void);
-bool kvm_has_adjust_clock(void);
-bool kvm_has_adjust_clock_stable(void);
-bool kvm_has_exception_payload(void);
-void kvm_synchronize_all_tsc(void);
+bool kvm_enable_x2apic(void);
+bool kvm_hv_vpindex_settable(void);
+
+bool kvm_enable_sgx_provisioning(KVMState *s);
+bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp);
+
 void kvm_arch_reset_vcpu(X86CPU *cs);
 void kvm_arch_after_reset_vcpu(X86CPU *cpu);
 void kvm_arch_do_init_vcpu(X86CPU *cs);
 
+void kvm_set_max_apic_id(uint32_t max_apic_id);
+void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask);
+
+#ifdef CONFIG_KVM
+
+bool kvm_has_adjust_clock(void);
+bool kvm_has_adjust_clock_stable(void);
+bool kvm_has_exception_payload(void);
+void kvm_synchronize_all_tsc(void);
+
 void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
 
-bool kvm_enable_x2apic(void);
 bool kvm_has_x2apic_api(void);
 bool kvm_has_waitpkg(void);
 
-bool kvm_hv_vpindex_settable(void);
-bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp);
-
 uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address);
 void kvm_update_msi_routes_all(void *private, bool global,
                                uint32_t index, uint32_t mask);
 
-bool kvm_enable_sgx_provisioning(KVMState *s);
-void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask);
-
 typedef bool QEMURDMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t *val);
 typedef bool QEMUWRMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t val);
 typedef struct kvm_msr_handlers {
@@ -66,6 +71,6 @@ typedef struct kvm_msr_handlers {
 bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr,
                     QEMUWRMSRHandler *wrmsr);
 
-void kvm_set_max_apic_id(uint32_t max_apic_id);
+#endif /* CONFIG_KVM */
 
 #endif
-- 
2.41.0



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

* [PULL 46/51] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (44 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 47/51] sysemu/kvm: Restrict kvm_get_apic_state() " Paolo Bonzini
                   ` (5 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

kvm_arch_get_supported_cpuid() / kvm_arch_get_supported_msr_feature()
are only defined for x86 targets (in target/i386/kvm/kvm.c). Their
declarations are pointless on other targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-11-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/kvm.h       | 5 -----
 target/i386/kvm/kvm_i386.h | 3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index ebdca410527..a578961a5e4 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -464,11 +464,6 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension);
         kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap);                   \
     })
 
-uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
-                                      uint32_t index, int reg);
-uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index);
-
-
 void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len);
 
 int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr,
diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index ff309bad25f..b78e2feb498 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -40,6 +40,9 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp);
 void kvm_arch_reset_vcpu(X86CPU *cs);
 void kvm_arch_after_reset_vcpu(X86CPU *cpu);
 void kvm_arch_do_init_vcpu(X86CPU *cs);
+uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
+                                      uint32_t index, int reg);
+uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index);
 
 void kvm_set_max_apic_id(uint32_t max_apic_id);
 void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask);
-- 
2.41.0



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

* [PULL 47/51] sysemu/kvm: Restrict kvm_get_apic_state() to x86 targets
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (45 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 46/51] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 48/51] sysemu/kvm: Restrict kvm_has_pit_state2() " Paolo Bonzini
                   ` (4 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

kvm_get_apic_state() is only defined for x86 targets (in
hw/i386/kvm/apic.c). Its declaration is pointless on all
other targets.

Since we include "linux-headers/asm-x86/kvm.h", no need
to forward-declare 'struct kvm_lapic_state'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-12-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/kvm.h       | 3 ---
 target/i386/kvm/kvm_i386.h | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index a578961a5e4..4326b53f90f 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -188,7 +188,6 @@ extern bool kvm_msi_use_devid;
 #endif  /* CONFIG_KVM_IS_POSSIBLE */
 
 struct kvm_run;
-struct kvm_lapic_state;
 struct kvm_irq_routing_entry;
 
 typedef struct KVMCapabilityInfo {
@@ -407,8 +406,6 @@ void kvm_irqchip_add_change_notifier(Notifier *n);
 void kvm_irqchip_remove_change_notifier(Notifier *n);
 void kvm_irqchip_change_notify(void);
 
-void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic);
-
 struct kvm_guest_debug;
 struct kvm_debug_exit_arch;
 
diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index b78e2feb498..d4a1239c68e 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -54,6 +54,7 @@ bool kvm_has_adjust_clock_stable(void);
 bool kvm_has_exception_payload(void);
 void kvm_synchronize_all_tsc(void);
 
+void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic);
 void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
 
 bool kvm_has_x2apic_api(void);
-- 
2.41.0



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

* [PULL 48/51] sysemu/kvm: Restrict kvm_has_pit_state2() to x86 targets
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (46 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 47/51] sysemu/kvm: Restrict kvm_get_apic_state() " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 49/51] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() " Paolo Bonzini
                   ` (3 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

kvm_has_pit_state2() is only defined for x86 targets (in
target/i386/kvm/kvm.c). Its declaration is pointless on
all other targets. Have it return a boolean.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-13-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/kvm/i8254.c        | 1 +
 include/sysemu/kvm.h       | 1 -
 target/i386/kvm/kvm.c      | 4 ++--
 target/i386/kvm/kvm_i386.h | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c
index 6a7383d8774..a649b2b7caf 100644
--- a/hw/i386/kvm/i8254.c
+++ b/hw/i386/kvm/i8254.c
@@ -34,6 +34,7 @@
 #include "hw/timer/i8254_internal.h"
 #include "hw/qdev-properties-system.h"
 #include "sysemu/kvm.h"
+#include "target/i386/kvm/kvm_i386.h"
 #include "qom/object.h"
 
 #define KVM_PIT_REINJECT_BIT 0
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 4326b53f90f..147967422f4 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -221,7 +221,6 @@ int kvm_has_vcpu_events(void);
 int kvm_has_robust_singlestep(void);
 int kvm_has_debugregs(void);
 int kvm_max_nested_state_length(void);
-int kvm_has_pit_state2(void);
 int kvm_has_many_ioeventfds(void);
 int kvm_has_gsi_routing(void);
 int kvm_has_intx_set_mask(void);
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 639a242ad8c..e5cd7cc8061 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -154,9 +154,9 @@ static KVMMSRHandlers msr_handlers[KVM_MSR_FILTER_MAX_RANGES];
 static RateLimit bus_lock_ratelimit_ctrl;
 static int kvm_get_one_msr(X86CPU *cpu, int index, uint64_t *value);
 
-int kvm_has_pit_state2(void)
+bool kvm_has_pit_state2(void)
 {
-    return has_pit_state2;
+    return !!has_pit_state2;
 }
 
 bool kvm_has_smm(void)
diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index d4a1239c68e..76e8f952e5f 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -33,6 +33,7 @@
 bool kvm_has_smm(void);
 bool kvm_enable_x2apic(void);
 bool kvm_hv_vpindex_settable(void);
+bool kvm_has_pit_state2(void);
 
 bool kvm_enable_sgx_provisioning(KVMState *s);
 bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp);
-- 
2.41.0



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

* [PULL 49/51] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() to x86 targets
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (47 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 48/51] sysemu/kvm: Restrict kvm_has_pit_state2() " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-09-07 12:59 ` [PULL 50/51] subprojects: add wrap file for libblkio Paolo Bonzini
                   ` (2 subsequent siblings)
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

kvm_pc_setup_irq_routing() is only defined for x86 targets (in
hw/i386/kvm/apic.c). Its declaration is pointless on all
other targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-14-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/kvm/ioapic.c       | 1 +
 include/sysemu/kvm.h       | 1 -
 target/i386/kvm/kvm_i386.h | 2 ++
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index cd5ea5d60b1..409d0c8c766 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -16,6 +16,7 @@
 #include "hw/intc/ioapic_internal.h"
 #include "hw/intc/kvm_irqcount.h"
 #include "sysemu/kvm.h"
+#include "kvm/kvm_i386.h"
 
 /* PC Utility function */
 void kvm_pc_setup_irq_routing(bool pci_enabled)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 147967422f4..ee9025f8e9e 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -514,7 +514,6 @@ int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
 int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n,
                                       qemu_irq irq);
 void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi);
-void kvm_pc_setup_irq_routing(bool pci_enabled);
 void kvm_init_irq_routing(KVMState *s);
 
 bool kvm_kernel_irqchip_allowed(void);
diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index 76e8f952e5f..55d4e68c342 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -78,4 +78,6 @@ bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr,
 
 #endif /* CONFIG_KVM */
 
+void kvm_pc_setup_irq_routing(bool pci_enabled);
+
 #endif
-- 
2.41.0



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

* [PULL 50/51] subprojects: add wrap file for libblkio
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (48 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 49/51] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() " Paolo Bonzini
@ 2023-09-07 12:59 ` Paolo Bonzini
  2023-10-11  5:35   ` Philippe Mathieu-Daudé
  2023-09-07 13:00 ` [PULL 51/51] docs/system/replay: do not show removed command line option Paolo Bonzini
  2023-09-07 15:44 ` [PULL 00/51] Build system, i386 changes for 2023-09-07 Stefan Hajnoczi
  51 siblings, 1 reply; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 12:59 UTC (permalink / raw)
  To: qemu-devel

This allows building libblkio at the same time as QEMU, if QEMU is
configured with --enable-blkio --enable-download.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 subprojects/libblkio.wrap | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 subprojects/libblkio.wrap

diff --git a/subprojects/libblkio.wrap b/subprojects/libblkio.wrap
new file mode 100644
index 00000000000..f77af72210c
--- /dev/null
+++ b/subprojects/libblkio.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://gitlab.com/libblkio/libblkio
+revision = f84cc963a444e4cb34813b2dcfc5bf8526947dc0
+
+[provide]
+blkio = libblkio_dep
-- 
2.41.0



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

* [PULL 51/51] docs/system/replay: do not show removed command line option
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (49 preceding siblings ...)
  2023-09-07 12:59 ` [PULL 50/51] subprojects: add wrap file for libblkio Paolo Bonzini
@ 2023-09-07 13:00 ` Paolo Bonzini
  2023-09-07 15:44 ` [PULL 00/51] Build system, i386 changes for 2023-09-07 Stefan Hajnoczi
  51 siblings, 0 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-07 13:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Philippe Mathieu-Daudé, Thomas Huth

Cc: qemu-trivial@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/system/replay.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/system/replay.rst b/docs/system/replay.rst
index 3105327423c..ca7c17c63da 100644
--- a/docs/system/replay.rst
+++ b/docs/system/replay.rst
@@ -181,7 +181,7 @@ Audio data is recorded and replay automatically. The command line for recording
 and replaying must contain identical specifications of audio hardware, e.g.:
 
 .. parsed-literal::
-    -soundhw ac97
+    -audio pa,model=ac97
 
 Serial ports
 ------------
-- 
2.41.0



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
                   ` (50 preceding siblings ...)
  2023-09-07 13:00 ` [PULL 51/51] docs/system/replay: do not show removed command line option Paolo Bonzini
@ 2023-09-07 15:44 ` Stefan Hajnoczi
  2023-09-08 15:01   ` Kevin Wolf
  51 siblings, 1 reply; 81+ messages in thread
From: Stefan Hajnoczi @ 2023-09-07 15:44 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Applied, thanks.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-07 15:44 ` [PULL 00/51] Build system, i386 changes for 2023-09-07 Stefan Hajnoczi
@ 2023-09-08 15:01   ` Kevin Wolf
  2023-09-08 15:47     ` Stefan Hajnoczi
  2023-09-08 16:11     ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 81+ messages in thread
From: Kevin Wolf @ 2023-09-08 15:01 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Paolo Bonzini, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]

Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> Applied, thanks.
> 
> Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.

Something in this has broken the build for me, it seems to be the
linux-user binary that doesn't link any more:

  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
  /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
  /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
  /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
  clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

In case it makes a difference, I'm using clang on F37.

Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 15:01   ` Kevin Wolf
@ 2023-09-08 15:47     ` Stefan Hajnoczi
  2023-09-11 10:10       ` Philippe Mathieu-Daudé
  2023-09-08 16:11     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 81+ messages in thread
From: Stefan Hajnoczi @ 2023-09-08 15:47 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel

I wonder how it passed CI?
https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/

Stefan

On Fri, 8 Sept 2023 at 11:02, Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> > Applied, thanks.
> >
> > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
>
> Something in this has broken the build for me, it seems to be the
> linux-user binary that doesn't link any more:
>
>   /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
>   /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
>   /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
>   /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
>   /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
>   /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
>   /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
>   /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
>   clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
>
> In case it makes a difference, I'm using clang on F37.
>
> Kevin


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 15:01   ` Kevin Wolf
  2023-09-08 15:47     ` Stefan Hajnoczi
@ 2023-09-08 16:11     ` Philippe Mathieu-Daudé
  2023-09-08 17:16       ` Kevin Wolf
  1 sibling, 1 reply; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-08 16:11 UTC (permalink / raw)
  To: Kevin Wolf, Stefan Hajnoczi; +Cc: Paolo Bonzini, qemu-devel

Hi Kevin,

On 8/9/23 17:01, Kevin Wolf wrote:
> Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
>> Applied, thanks.
>>
>> Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
> 
> Something in this has broken the build for me, it seems to be the
> linux-user binary that doesn't link any more:
> 
>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'

My patches. I can not reproduce so far,
What are your ./configure command options?

>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
>    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> In case it makes a difference, I'm using clang on F37.
> 
> Kevin



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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-07 12:59 ` [PULL 24/51] meson: compile bundled device trees Paolo Bonzini
@ 2023-09-08 16:27   ` Philippe Mathieu-Daudé
  2023-09-08 17:20     ` Michael Tokarev
  0 siblings, 1 reply; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-08 16:27 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: Richard Henderson, qemu-ppc, BALATON Zoltan

On 7/9/23 14:59, Paolo Bonzini wrote:
> If dtc is available, compile the .dts files in the pc-bios directory
> instead of using the precompiled binaries.
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   pc-bios/Makefile    | 19 -------------------
>   pc-bios/meson.build | 25 +++++++++++++++++++++----
>   2 files changed, 21 insertions(+), 23 deletions(-)
>   delete mode 100644 pc-bios/Makefile

FWIW I'm getting:

[50/1419] Generating pc-bios/bamboo.dts with a custom command
../../pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): 
/memory: node has a reg or ranges property, but no unit name
../../pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): 
/plb/opb: node has a reg or ranges property, but no unit name
../../pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): 
/chosen:linux,stdout-path: Use 'stdout-path' instead
../../pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): 
/plb/opb: Missing interrupt-parent
../../pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): 
/plb/opb/ebc: Missing interrupt-parent
[51/1419] Generating pc-bios/canyonlands.dts with a custom command
../../pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): 
/memory: node has a reg or ranges property, but no unit name
../../pc-bios/canyonlands.dts:210.13-429.5: Warning 
(unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but 
no unit name
../../pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): 
/plb/pciex@d00000000: node name is not "pci" or "pcie"
../../pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): 
/plb/pciex@d20000000: node name is not "pci" or "pcie"
pc-bios/canyonlands.dtb: Warning (unit_address_format): Failed 
prerequisite 'pci_bridge'
pc-bios/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 
'pci_bridge'
pc-bios/canyonlands.dtb: Warning (pci_device_bus_num): Failed 
prerequisite 'pci_bridge'
../../pc-bios/canyonlands.dts:268.14-289.7: Warning 
(avoid_unnecessary_addr_size): /plb/opb/ebc/ndfc@3,0: unnecessary 
#address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" 
property



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 16:11     ` Philippe Mathieu-Daudé
@ 2023-09-08 17:16       ` Kevin Wolf
  2023-09-08 17:22         ` Daniel P. Berrangé
                           ` (2 more replies)
  0 siblings, 3 replies; 81+ messages in thread
From: Kevin Wolf @ 2023-09-08 17:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel

Am 08.09.2023 um 18:11 hat Philippe Mathieu-Daudé geschrieben:
> Hi Kevin,
> 
> On 8/9/23 17:01, Kevin Wolf wrote:
> > Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> > > Applied, thanks.
> > > 
> > > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
> > 
> > Something in this has broken the build for me, it seems to be the
> > linux-user binary that doesn't link any more:
> > 
> >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
> >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
> 
> My patches. I can not reproduce so far,

Hm, ok. I can try to bisect it further then.

> What are your ./configure command options?

'/home/kwolf/source/qemu/configure' '--cc=clang' '--target-list=x86_64-linux-user,x86_64-softmmu,arm-softmmu,aarch64-softmmu' '--enable-debug' '--cxx=clang++' '--disable-blkio' 

Kevin

> >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
> >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
> >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
> >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
> >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
> >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
> >    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> > 
> > In case it makes a difference, I'm using clang on F37.
> > 
> > Kevin
> 



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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 16:27   ` Philippe Mathieu-Daudé
@ 2023-09-08 17:20     ` Michael Tokarev
  2023-09-08 19:21       ` BALATON Zoltan
  0 siblings, 1 reply; 81+ messages in thread
From: Michael Tokarev @ 2023-09-08 17:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel
  Cc: Richard Henderson, qemu-ppc, BALATON Zoltan

08.09.2023 19:27, Philippe Mathieu-Daudé:
> On 7/9/23 14:59, Paolo Bonzini wrote:
>> If dtc is available, compile the .dts files in the pc-bios directory
>> instead of using the precompiled binaries.
>>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   pc-bios/Makefile    | 19 -------------------
>>   pc-bios/meson.build | 25 +++++++++++++++++++++----
>>   2 files changed, 21 insertions(+), 23 deletions(-)
>>   delete mode 100644 pc-bios/Makefile
> 
> FWIW I'm getting:
> 
> [50/1419] Generating pc-bios/bamboo.dts with a custom command
> ../../pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
> ../../pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name
> ../../pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): /chosen:linux,stdout-path: Use 'stdout-path' instead
> ../../pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): /plb/opb: Missing interrupt-parent
> ../../pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): /plb/opb/ebc: Missing interrupt-parent
> [51/1419] Generating pc-bios/canyonlands.dts with a custom command
> ../../pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
> ../../pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name
> ../../pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie"
> ../../pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie"
> pc-bios/canyonlands.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge'
> pc-bios/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge'
> pc-bios/canyonlands.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge'
> ../../pc-bios/canyonlands.dts:268.14-289.7: Warning (avoid_unnecessary_addr_size): /plb/opb/ebc/ndfc@3,0: unnecessary #address-cells/#size-cells 
> without "ranges", "dma-ranges" or child "reg" property

This smells like something which has been here forever and no one noticed
because the compile only happens when updating these files, ie, almost
never.

So, "don't blame the messenger" :)

/mjt


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 17:16       ` Kevin Wolf
@ 2023-09-08 17:22         ` Daniel P. Berrangé
  2023-09-08 17:28         ` Michael Tokarev
  2023-09-08 17:28         ` Kevin Wolf
  2 siblings, 0 replies; 81+ messages in thread
From: Daniel P. Berrangé @ 2023-09-08 17:22 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: Philippe Mathieu-Daudé, Stefan Hajnoczi, Paolo Bonzini, qemu-devel

On Fri, Sep 08, 2023 at 07:16:16PM +0200, Kevin Wolf wrote:
> Am 08.09.2023 um 18:11 hat Philippe Mathieu-Daudé geschrieben:
> > Hi Kevin,
> > 
> > On 8/9/23 17:01, Kevin Wolf wrote:
> > > Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> > > > Applied, thanks.
> > > > 
> > > > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
> > > 
> > > Something in this has broken the build for me, it seems to be the
> > > linux-user binary that doesn't link any more:
> > > 
> > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
> > >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
> > 
> > My patches. I can not reproduce so far,

Given the missing function name, I'm assuming the problem is this commit:

[quote]
Subject: [PULL 42/51] target/i386: Remove unused KVM stubs

From: Philippe Mathieu-Daudé <philmd@linaro.org>

All these functions:

 - kvm_arch_get_supported_cpuid()
 - kvm_has_smm(()
 - kvm_hyperv_expand_features()
 - kvm_set_max_apic_id()

are called after checking for kvm_enabled(), which is
false when KVM is not built. Since the compiler elides
these functions, their stubs are not used and can be
removed.
[/quote]

> Hm, ok. I can try to bisect it further then.
> 
> > What are your ./configure command options?
> 
> '/home/kwolf/source/qemu/configure' '--cc=clang' '--target-list=x86_64-linux-user,x86_64-softmmu,arm-softmmu,aarch64-softmmu' '--enable-debug' '--cxx=clang++' '--disable-blkio' 

--enable-debug results in "-O0" being used for optimization.

I bet this stops the compiler from eliding the functions
as claimed by the commit above. IOW, we do in fact still
need these stubs.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 17:16       ` Kevin Wolf
  2023-09-08 17:22         ` Daniel P. Berrangé
@ 2023-09-08 17:28         ` Michael Tokarev
  2023-09-08 17:28         ` Kevin Wolf
  2 siblings, 0 replies; 81+ messages in thread
From: Michael Tokarev @ 2023-09-08 17:28 UTC (permalink / raw)
  To: Kevin Wolf, Philippe Mathieu-Daudé
  Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel

08.09.2023 20:16, Kevin Wolf:
> Am 08.09.2023 um 18:11 hat Philippe Mathieu-Daudé geschrieben:
>> Hi Kevin,
>>
>> On 8/9/23 17:01, Kevin Wolf wrote:
>>> Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
>>>> Applied, thanks.
>>>>
>>>> Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
>>>
>>> Something in this has broken the build for me, it seems to be the
>>> linux-user binary that doesn't link any more:
>>>
>>>     /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
>>>     /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
>>
>> My patches. I can not reproduce so far,
> 
> Hm, ok. I can try to bisect it further then.

     case 7:
         /* Structured Extended Feature Flags Enumeration Leaf */
         if (count == 0) {
...
             if ((*ebx & CPUID_7_0_EBX_SGX) &&
                 (!kvm_enabled() ||
                  !(kvm_arch_get_supported_cpuid(cs->kvm_state, 0x7, 0, R_EBX) &
                     CPUID_7_0_EBX_SGX))) {
                 *ebx &= ~CPUID_7_0_EBX_SGX;
             }

             if ((*ecx & CPUID_7_0_ECX_SGX_LC) &&
                 (!(*ebx & CPUID_7_0_EBX_SGX) || !kvm_enabled() ||
                  !(kvm_arch_get_supported_cpuid(cs->kvm_state, 0x7, 0, R_ECX) &
                     CPUID_7_0_ECX_SGX_LC))) {
                 *ecx &= ~CPUID_7_0_ECX_SGX_LC;
             }

It is most likely patch "target/i386: Remove unused KVM stubs" which removed
kvm_arch_get_supported_cpuid().  Apparently clang isn't smart enough to eliminate
call to this function?

/mjt


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 17:16       ` Kevin Wolf
  2023-09-08 17:22         ` Daniel P. Berrangé
  2023-09-08 17:28         ` Michael Tokarev
@ 2023-09-08 17:28         ` Kevin Wolf
  2023-09-08 19:21           ` Paolo Bonzini
  2 siblings, 1 reply; 81+ messages in thread
From: Kevin Wolf @ 2023-09-08 17:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel

Am 08.09.2023 um 19:16 hat Kevin Wolf geschrieben:
> Am 08.09.2023 um 18:11 hat Philippe Mathieu-Daudé geschrieben:
> > Hi Kevin,
> > 
> > On 8/9/23 17:01, Kevin Wolf wrote:
> > > Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> > > > Applied, thanks.
> > > > 
> > > > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
> > > 
> > > Something in this has broken the build for me, it seems to be the
> > > linux-user binary that doesn't link any more:
> > > 
> > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
> > >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
> > 
> > My patches. I can not reproduce so far,
> 
> Hm, ok. I can try to bisect it further then.

Right, the commit message is obviously related, so you probably knew
this already... :-)

commit 3adce820cf9c454b49cabf52b829001ecb98500e
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date:   Mon Sep 4 14:43:17 2023 +0200

    target/i386: Remove unused KVM stubs
    
    All these functions:
    
     - kvm_arch_get_supported_cpuid()
     - kvm_has_smm(()
     - kvm_hyperv_expand_features()
     - kvm_set_max_apic_id()
    
    are called after checking for kvm_enabled(), which is
    false when KVM is not built. Since the compiler elides
    these functions, their stubs are not used and can be
    removed.
    
    Inspired-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-ID: <20230904124325.79040-7-philmd@linaro.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

 target/i386/kvm/kvm-stub.c | 26 --------------------------
 1 file changed, 26 deletions(-)

Maybe the calls aren't eliminated because --enable-debug implies -O0?

Kevin

> > What are your ./configure command options?
> 
> '/home/kwolf/source/qemu/configure' '--cc=clang' '--target-list=x86_64-linux-user,x86_64-softmmu,arm-softmmu,aarch64-softmmu' '--enable-debug' '--cxx=clang++' '--disable-blkio' 
> 
> Kevin
> 
> > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
> > >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
> > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
> > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
> > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
> > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
> > >    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> > > 
> > > In case it makes a difference, I'm using clang on F37.
> > > 
> > > Kevin
> > 



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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 17:20     ` Michael Tokarev
@ 2023-09-08 19:21       ` BALATON Zoltan
  2023-09-08 19:40         ` Michael Tokarev
  0 siblings, 1 reply; 81+ messages in thread
From: BALATON Zoltan @ 2023-09-08 19:21 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, Guenter Roeck,
	qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 3502 bytes --]

On Fri, 8 Sep 2023, Michael Tokarev wrote:
> 08.09.2023 19:27, Philippe Mathieu-Daudé:
>> On 7/9/23 14:59, Paolo Bonzini wrote:
>>> If dtc is available, compile the .dts files in the pc-bios directory
>>> instead of using the precompiled binaries.
>>> 
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> ---
>>>   pc-bios/Makefile    | 19 -------------------
>>>   pc-bios/meson.build | 25 +++++++++++++++++++++----
>>>   2 files changed, 21 insertions(+), 23 deletions(-)
>>>   delete mode 100644 pc-bios/Makefile
>> 
>> FWIW I'm getting:
>> 
>> [50/1419] Generating pc-bios/bamboo.dts with a custom command
>> ../../pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: 
>> node has a reg or ranges property, but no unit name
>> ../../pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): 
>> /plb/opb: node has a reg or ranges property, but no unit name
>> ../../pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): 
>> /chosen:linux,stdout-path: Use 'stdout-path' instead
>> ../../pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): 
>> /plb/opb: Missing interrupt-parent
>> ../../pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): 
>> /plb/opb/ebc: Missing interrupt-parent
>> [51/1419] Generating pc-bios/canyonlands.dts with a custom command
>> ../../pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): 
>> /memory: node has a reg or ranges property, but no unit name
>> ../../pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): 
>> /plb/opb: node has a reg or ranges property, but no unit name
>> ../../pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): 
>> /plb/pciex@d00000000: node name is not "pci" or "pcie"
>> ../../pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): 
>> /plb/pciex@d20000000: node name is not "pci" or "pcie"
>> pc-bios/canyonlands.dtb: Warning (unit_address_format): Failed prerequisite 
>> 'pci_bridge'
>> pc-bios/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 
>> 'pci_bridge'
>> pc-bios/canyonlands.dtb: Warning (pci_device_bus_num): Failed prerequisite 
>> 'pci_bridge'
>> ../../pc-bios/canyonlands.dts:268.14-289.7: Warning 
>> (avoid_unnecessary_addr_size): /plb/opb/ebc/ndfc@3,0: unnecessary 
>> #address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" 
>> property
>
> This smells like something which has been here forever and no one noticed
> because the compile only happens when updating these files, ie, almost
> never.
>
> So, "don't blame the messenger" :)

I was about to ask, since when but probably nobody knows then. AFAIR I had 
no such errors for the canyonlands one when I've added it but that was 
quite some years ago and things in dtc for example could have changed so 
it now gives these warnings.

The dts files come from Linux so maybe it's fixed there but not sure if 
updating these would generate different dtb that the guests might not like 
as both these machines and guests running on them are quite old. So maybe 
it's safer to ignore the warnings? On the other hand, maybe this dtb is 
only used when booting Linux with -kernel, otherwise the u-boot firmware 
will generate it so updating it may not affect most guests anyway. I think 
Guenter Roeck (cc'd) used this for testing Linux kernels so maybe he has 
some more info or insight. This may not help much but that's all I can add 
to this.

Regards,
BALATON Zoltan

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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 17:28         ` Kevin Wolf
@ 2023-09-08 19:21           ` Paolo Bonzini
  2023-09-11 10:11             ` Philippe Mathieu-Daudé
  2023-09-11 10:41             ` Michael Tokarev
  0 siblings, 2 replies; 81+ messages in thread
From: Paolo Bonzini @ 2023-09-08 19:21 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Philippe Mathieu-Daudé, Stefan Hajnoczi, qemu-devel

On Fri, Sep 8, 2023 at 7:28 PM Kevin Wolf <kwolf@redhat.com> wrote:
> Maybe the calls aren't eliminated because --enable-debug implies -O0?

My experience is that it will still fold simple dead code like "0 &&
foo()" or even "if (0) { ... }", but maybe it's a GCC vs. clang
difference. Philippe, I take it that you are looking at it?

Paolo

> Kevin
>
> > > What are your ./configure command options?
> >
> > '/home/kwolf/source/qemu/configure' '--cc=clang' '--target-list=x86_64-linux-user,x86_64-softmmu,arm-softmmu,aarch64-softmmu' '--enable-debug' '--cxx=clang++' '--disable-blkio'
> >
> > Kevin
> >
> > > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
> > > >    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
> > > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
> > > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
> > > >    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
> > > >    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
> > > >    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> > > >
> > > > In case it makes a difference, I'm using clang on F37.
> > > >
> > > > Kevin
> > >
>



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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 19:21       ` BALATON Zoltan
@ 2023-09-08 19:40         ` Michael Tokarev
  2023-09-08 20:07           ` BALATON Zoltan
  0 siblings, 1 reply; 81+ messages in thread
From: Michael Tokarev @ 2023-09-08 19:40 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, Guenter Roeck,
	qemu-ppc

08.09.2023 22:21, BALATON Zoltan:
..
> I was about to ask, since when but probably nobody knows then. AFAIR I had no such errors for the canyonlands one when I've added it but that was 
> quite some years ago and things in dtc for example could have changed so it now gives these warnings.

I think it can be said based on debian build logs. Lemme see..

https://buildd.debian.org/status/logs.php?pkg=qemu&arch=all

The first log entry there is from 2018-12-12, for qemu 3.1, dtc 1.4.7.
It has:

dtc -o b/qemu/pc-bios/bamboo.dtb pc-bios/bamboo.dts
b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name
b/qemu/pc-bios/bamboo.dtb: Warning (chosen_node_stdout_path): /chosen:linux,stdout-path: Use 'stdout-path' instead
b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb: Missing interrupt-parent
b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb/ebc: Missing interrupt-parent

next it was moved to one of the subpackages, and moved back to
arch-independent package in 6.2 (2022-01-09, dtc 1.6.0), which has:

dtc -o b/misc/bamboo.dtb pc-bios/bamboo.dts
pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name
pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): /chosen:linux,stdout-path: Use 'stdout-path' instead
pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): /plb/opb: Missing interrupt-parent
pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): /plb/opb/ebc: Missing interrupt-parent
dtc -o b/misc/canyonlands.dtb pc-bios/canyonlands.dts
pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): /plb/opb: node has a reg or ranges property, but no unit name
pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie"
pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie"
b/misc/canyonlands.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge'
b/misc/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge'
b/misc/canyonlands.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge'
pc-bios/canyonlands.dts:268.14-289.7: Warning (avoid_unnecessary_addr_size): /plb/opb/ebc/ndfc@3,0: unnecessary #address-cells/#size-cells without 
"ranges" or child "reg" property

FWIW.

/mjt


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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 19:40         ` Michael Tokarev
@ 2023-09-08 20:07           ` BALATON Zoltan
  2023-09-11 14:48             ` Philippe Mathieu-Daudé
  2023-09-11 15:16             ` Peter Maydell
  0 siblings, 2 replies; 81+ messages in thread
From: BALATON Zoltan @ 2023-09-08 20:07 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, Guenter Roeck,
	qemu-ppc

On Fri, 8 Sep 2023, Michael Tokarev wrote:
> 08.09.2023 22:21, BALATON Zoltan:
>> I was about to ask, since when but probably nobody knows then. AFAIR I had 
>> no such errors for the canyonlands one when I've added it but that was 
>> quite some years ago and things in dtc for example could have changed so it 
>> now gives these warnings.
>
> I think it can be said based on debian build logs. Lemme see..
>
> https://buildd.debian.org/status/logs.php?pkg=qemu&arch=all
>
> The first log entry there is from 2018-12-12, for qemu 3.1, dtc 1.4.7.
> It has:
>
> dtc -o b/qemu/pc-bios/bamboo.dtb pc-bios/bamboo.dts
> b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /memory: node has a 
> reg or ranges property, but no unit name
> b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /plb/opb: node has 
> a reg or ranges property, but no unit name
> b/qemu/pc-bios/bamboo.dtb: Warning (chosen_node_stdout_path): 
> /chosen:linux,stdout-path: Use 'stdout-path' instead
> b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb: Missing 
> interrupt-parent
> b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb/ebc: 
> Missing interrupt-parent


OK so bamboo was likely always like that. Sam460ex (aka canyonlands which 
is the devel board it is based on) was added in February 2018 so that was 
OK back then but later dtc versions may have become pickier somewhere 
between 1.4.7 and 1.6.0.

> next it was moved to one of the subpackages, and moved back to
> arch-independent package in 6.2 (2022-01-09, dtc 1.6.0), which has:
>
> dtc -o b/misc/bamboo.dtb pc-bios/bamboo.dts
> pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: node 
> has a reg or ranges property, but no unit name
> pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): /plb/opb: node 
> has a reg or ranges property, but no unit name
> pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): 
> /chosen:linux,stdout-path: Use 'stdout-path' instead
> pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): /plb/opb: 
> Missing interrupt-parent
> pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): /plb/opb/ebc: 
> Missing interrupt-parent
> dtc -o b/misc/canyonlands.dtb pc-bios/canyonlands.dts
> pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): /memory: 
> node has a reg or ranges property, but no unit name
> pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): 
> /plb/opb: node has a reg or ranges property, but no unit name
> pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): 
> /plb/pciex@d00000000: node name is not "pci" or "pcie"
> pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): 
> /plb/pciex@d20000000: node name is not "pci" or "pcie"

Linux has this in arch/powerpc/boot/dts/canyonlands.dts and at least had a 
change of the pciex names to pcie that should fix some of these but if the 
u-boot still uses older names then could updating this result in different 
results between using -kernel and without that? I don't know how guests 
use the dtb so can't tell what to do but keeping it consistent with the 
older u-boot this board has seems like a safer option.

Regards,
BALATON Zoltan

> b/misc/canyonlands.dtb: Warning (unit_address_format): Failed prerequisite 
> 'pci_bridge'
> b/misc/canyonlands.dtb: Warning (pci_device_reg): Failed prerequisite 
> 'pci_bridge'
> b/misc/canyonlands.dtb: Warning (pci_device_bus_num): Failed prerequisite 
> 'pci_bridge'
> pc-bios/canyonlands.dts:268.14-289.7: Warning (avoid_unnecessary_addr_size): 
> /plb/opb/ebc/ndfc@3,0: unnecessary #address-cells/#size-cells without 
> "ranges" or child "reg" property
>
> FWIW.
>
> /mjt
>
>


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 15:47     ` Stefan Hajnoczi
@ 2023-09-11 10:10       ` Philippe Mathieu-Daudé
  2023-09-11 10:22         ` Philippe Mathieu-Daudé
  2023-09-11 11:06         ` Stefan Hajnoczi
  0 siblings, 2 replies; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-11 10:10 UTC (permalink / raw)
  To: Stefan Hajnoczi, Kevin Wolf
  Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel, Thomas Huth,
	Daniel P. Berrangé

On 8/9/23 17:47, Stefan Hajnoczi wrote:
> I wonder how it passed CI?
> https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/

The conditions are:
- x86 host
- both system / user emulation enabled
- KVM disabled
- debug enabled

We have jobs with 3 of the 4, but none with
all the 4.

Is it worth test it?

> 
> Stefan
> 
> On Fri, 8 Sept 2023 at 11:02, Kevin Wolf <kwolf@redhat.com> wrote:
>>
>> Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
>>> Applied, thanks.
>>>
>>> Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
>>
>> Something in this has broken the build for me, it seems to be the
>> linux-user binary that doesn't link any more:
>>
>>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
>>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
>>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
>>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
>>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
>>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
>>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
>>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
>>    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
>>
>> In case it makes a difference, I'm using clang on F37.
>>
>> Kevin
> 



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 19:21           ` Paolo Bonzini
@ 2023-09-11 10:11             ` Philippe Mathieu-Daudé
  2023-09-11 14:18               ` Philippe Mathieu-Daudé
  2023-09-11 10:41             ` Michael Tokarev
  1 sibling, 1 reply; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-11 10:11 UTC (permalink / raw)
  To: Paolo Bonzini, Kevin Wolf; +Cc: Stefan Hajnoczi, qemu-devel

On 8/9/23 21:21, Paolo Bonzini wrote:
> On Fri, Sep 8, 2023 at 7:28 PM Kevin Wolf <kwolf@redhat.com> wrote:
>> Maybe the calls aren't eliminated because --enable-debug implies -O0?
> 
> My experience is that it will still fold simple dead code like "0 &&
> foo()" or even "if (0) { ... }", but maybe it's a GCC vs. clang
> difference. Philippe, I take it that you are looking at it?

Yes, I'll send a patch soon. Sorry I didn't catch that case.



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 10:10       ` Philippe Mathieu-Daudé
@ 2023-09-11 10:22         ` Philippe Mathieu-Daudé
  2023-09-11 12:12           ` Kevin Wolf
  2023-09-11 11:06         ` Stefan Hajnoczi
  1 sibling, 1 reply; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-11 10:22 UTC (permalink / raw)
  To: Stefan Hajnoczi, Kevin Wolf
  Cc: Stefan Hajnoczi, Paolo Bonzini, qemu-devel, Thomas Huth,
	Daniel P. Berrangé

On 11/9/23 12:10, Philippe Mathieu-Daudé wrote:
> On 8/9/23 17:47, Stefan Hajnoczi wrote:
>> I wonder how it passed CI?
>> https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/
> 
> The conditions are:
> - x86 host
> - both system / user emulation enabled
> - KVM disabled
> - debug enabled

Oh, I forgot:

- clang compiler

(because this isn't an issue with GCC).

> We have jobs with 3 of the 4, but none with
> all the 4.
> 
> Is it worth test it?



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-08 19:21           ` Paolo Bonzini
  2023-09-11 10:11             ` Philippe Mathieu-Daudé
@ 2023-09-11 10:41             ` Michael Tokarev
  2023-09-11 10:44               ` Michael Tokarev
  1 sibling, 1 reply; 81+ messages in thread
From: Michael Tokarev @ 2023-09-11 10:41 UTC (permalink / raw)
  To: Paolo Bonzini, Kevin Wolf
  Cc: Philippe Mathieu-Daudé, Stefan Hajnoczi, qemu-devel

08.09.2023 22:21, Paolo Bonzini wrote:
> On Fri, Sep 8, 2023 at 7:28 PM Kevin Wolf <kwolf@redhat.com> wrote:
>> Maybe the calls aren't eliminated because --enable-debug implies -O0?
> 
> My experience is that it will still fold simple dead code like "0 &&
> foo()" or even "if (0) { ... }", but maybe it's a GCC vs. clang
> difference. [..]

In my view it's too fragile to rely on this.  And yes, it's the clang
builds which triggers this issue.

We've a bugreport, https://gitlab.com/qemu-project/qemu/-/issues/1848 ,
where obviously-unreachable code hasn't been detected by gcc when
optimizing for certain CPU type.  This smells like a GCC bug but still
it's something which we shouldn't rely on.

What can be done though is, instead of making kvm_arch_get_supported_cpuid
et all a stubs, to replace them in .h file with an empty macro when some
condition(s) are met.  In other words, fold kvm_enabled() "inside" of
kvm_arch_get_supported_cpuid() and use some assert_not_reached() there.

/mjt


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 10:41             ` Michael Tokarev
@ 2023-09-11 10:44               ` Michael Tokarev
  0 siblings, 0 replies; 81+ messages in thread
From: Michael Tokarev @ 2023-09-11 10:44 UTC (permalink / raw)
  To: Paolo Bonzini, Kevin Wolf
  Cc: Philippe Mathieu-Daudé, Stefan Hajnoczi, qemu-devel

11.09.2023 13:41, Michael Tokarev:

> What can be done though is, instead of making kvm_arch_get_supported_cpuid
> et all a stubs, to replace them in .h file with an empty macro when some
> condition(s) are met.  In other words, fold kvm_enabled() "inside" of
> kvm_arch_get_supported_cpuid() and use some assert_not_reached() there.

Which is exactly what Philippe did in
"Re-introduce few KVM stubs for Clang debug builds".

/mjt



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 10:10       ` Philippe Mathieu-Daudé
  2023-09-11 10:22         ` Philippe Mathieu-Daudé
@ 2023-09-11 11:06         ` Stefan Hajnoczi
  2023-09-11 12:40           ` Thomas Huth
  1 sibling, 1 reply; 81+ messages in thread
From: Stefan Hajnoczi @ 2023-09-11 11:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Kevin Wolf, Stefan Hajnoczi, Paolo Bonzini, qemu-devel,
	Thomas Huth, Daniel P. Berrangé

On Mon, 11 Sept 2023 at 06:10, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 8/9/23 17:47, Stefan Hajnoczi wrote:
> > I wonder how it passed CI?
> > https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/
>
> The conditions are:
> - x86 host
> - both system / user emulation enabled
> - KVM disabled
> - debug enabled
>
> We have jobs with 3 of the 4, but none with
> all the 4.
>
> Is it worth test it?

I think so.

Kevin: Can you confirm your configuration matches what Philippe described?

Stefan

>
> >
> > Stefan
> >
> > On Fri, 8 Sept 2023 at 11:02, Kevin Wolf <kwolf@redhat.com> wrote:
> >>
> >> Am 07.09.2023 um 17:44 hat Stefan Hajnoczi geschrieben:
> >>> Applied, thanks.
> >>>
> >>> Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
> >>
> >> Something in this has broken the build for me, it seems to be the
> >> linux-user binary that doesn't link any more:
> >>
> >>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `cpu_x86_cpuid':
> >>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:6180: undefined reference to `kvm_arch_get_supported_cpuid'
> >>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o: in function `x86_cpu_filter_features':
> >>    /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7158: undefined reference to `kvm_arch_get_supported_cpuid'
> >>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7159: undefined reference to `kvm_arch_get_supported_cpuid'
> >>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7160: undefined reference to `kvm_arch_get_supported_cpuid'
> >>    /usr/bin/ld: /home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7161: undefined reference to `kvm_arch_get_supported_cpuid'
> >>    /usr/bin/ld: libqemu-x86_64-linux-user.fa.p/target_i386_cpu.c.o:/home/kwolf/source/qemu/build-clang/../target/i386/cpu.c:7162: more undefined references to `kvm_arch_get_supported_cpuid' follow
> >>    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> >>
> >> In case it makes a difference, I'm using clang on F37.
> >>
> >> Kevin
> >
>


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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 10:22         ` Philippe Mathieu-Daudé
@ 2023-09-11 12:12           ` Kevin Wolf
  0 siblings, 0 replies; 81+ messages in thread
From: Kevin Wolf @ 2023-09-11 12:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Stefan Hajnoczi, Stefan Hajnoczi, Paolo Bonzini, qemu-devel,
	Thomas Huth, Daniel P. Berrangé

Am 11.09.2023 um 12:22 hat Philippe Mathieu-Daudé geschrieben:
> On 11/9/23 12:10, Philippe Mathieu-Daudé wrote:
> > On 8/9/23 17:47, Stefan Hajnoczi wrote:
> > > I wonder how it passed CI?
> > > https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/
> > 
> > The conditions are:
> > - x86 host

I didn't actually try other hosts, but why do you think it depends on
the host? Is it not x86 target?

> > - both system / user emulation enabled

I did try this one while bisection because I didn't want to build the
system emulator in each step. User emulation only is enough, you don't
need to build the system emulator to get the build failure.

> > - KVM disabled

I didn't explicitly disable KVM, but I suppose it's automatically
disabled for linux-user.

> > - debug enabled
> 
> Oh, I forgot:
> 
> - clang compiler
> 
> (because this isn't an issue with GCC).
> 
> > We have jobs with 3 of the 4, but none with
> > all the 4.
> > 
> > Is it worth test it?

So it's x86, user emulation is built, debug enabled, on clang. This
doesn't feel very exotic, though of course --enable-debug will be more
common for developers while it's not the primary test case for CI.

I don't see any existing test to which it could be added without losing
another important configuration. Not sure if it's worth an additional
test when we're already hitting the CI limits too often.

On the other hand, now that I'm looking at the CI configuration, is it
correct that we have no build for clang + --enable-debug at all? Even if
you ignore the other conditions? Maybe that's basic enough that we
should have it.

Kevin



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 11:06         ` Stefan Hajnoczi
@ 2023-09-11 12:40           ` Thomas Huth
  0 siblings, 0 replies; 81+ messages in thread
From: Thomas Huth @ 2023-09-11 12:40 UTC (permalink / raw)
  To: Stefan Hajnoczi, Philippe Mathieu-Daudé
  Cc: Kevin Wolf, Stefan Hajnoczi, Paolo Bonzini, qemu-devel,
	Daniel P. Berrangé

On Mon, 2023-09-11 at 07:06 -0400, Stefan Hajnoczi wrote:
> On Mon, 11 Sept 2023 at 06:10, Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
> > 
> > On 8/9/23 17:47, Stefan Hajnoczi wrote:
> > > I wonder how it passed CI?
> > > https://gitlab.com/qemu-project/qemu/-/pipelines/996175923/
> > 
> > The conditions are:
> > - x86 host
> > - both system / user emulation enabled
> > - KVM disabled
> > - debug enabled
> > 
> > We have jobs with 3 of the 4, but none with
> > all the 4.
> > 
> > Is it worth test it?
> 
> I think so.

Would it be feasible to modify one of the existing jobs instead of
introducing more load to the CI by adding yet another new job?

 Thomas



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

* Re: [PULL 00/51] Build system, i386 changes for 2023-09-07
  2023-09-11 10:11             ` Philippe Mathieu-Daudé
@ 2023-09-11 14:18               ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-11 14:18 UTC (permalink / raw)
  To: Paolo Bonzini, Kevin Wolf
  Cc: Stefan Hajnoczi, qemu-devel, Michael Tokarev, Daniel P. Berrangé

On 11/9/23 12:11, Philippe Mathieu-Daudé wrote:
> On 8/9/23 21:21, Paolo Bonzini wrote:
>> On Fri, Sep 8, 2023 at 7:28 PM Kevin Wolf <kwolf@redhat.com> wrote:
>>> Maybe the calls aren't eliminated because --enable-debug implies -O0?
>>
>> My experience is that it will still fold simple dead code like "0 &&
>> foo()" or even "if (0) { ... }", but maybe it's a GCC vs. clang
>> difference. Philippe, I take it that you are looking at it?

FTR preprocessed code is indeed:

# 5682 "../../target/i386/cpu.c"
uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
                                             _Bool migratable_only)
{
     FeatureWordInfo *wi = &feature_word_info[w];
     uint64_t r = 0;

     if ((0)) {
         switch (wi->type) {
         case CPUID_FEATURE_WORD:
             r = kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid.eax,
                                                         wi->cpuid.ecx,
                                                         wi->cpuid.reg);
             break;
         case MSR_FEATURE_WORD:
             r = kvm_arch_get_supported_msr_feature(kvm_state,
                         wi->msr.index);
             break;
         }
     } else if (0) {
         if (wi->type != CPUID_FEATURE_WORD) {
             return 0;
         }
         r = 0;


     } else if ((tcg_allowed)) {
         r = wi->tcg_features;
     } else {
         return ~0;
     }
# 5725 "../../target/i386/cpu.c"
     if (migratable_only) {
         r &= x86_cpu_get_migratable_flags(w);
     }
     return r;
}

static void x86_cpu_get_supported_cpuid(uint32_t func, uint32_t index,
                                         uint32_t *eax, uint32_t *ebx,
                                         uint32_t *ecx, uint32_t *edx)
{
     if ((0)) {
         *eax = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EAX);
         *ebx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EBX);
         *ecx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_ECX);
         *edx = kvm_arch_get_supported_cpuid(kvm_state, func, index, R_EDX);
     } else if (0) {
         *eax = 0;
         *ebx = 0;
         *ecx = 0;
         *edx = 0;
     } else {
         *eax = 0;
         *ebx = 0;
         *ecx = 0;
         *edx = 0;
     }
}

Which made me wonder about this sysemu code use from useremu,
in particular because the link failure comes from
libqemu-x86_64-linux-user.fa.p. This pair of #ifdef'ry to
restrict system-specific code seems sufficient to link:

-- >8 --
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 24ee67b42d..83914d5d1b 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6163,6 +6163,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t 
index, uint32_t count,
              }
              *edx = env->features[FEAT_7_0_EDX]; /* Feature flags */

+#ifndef CONFIG_USER_ONLY
              /*
               * SGX cannot be emulated in software.  If hardware does not
               * support enabling SGX and/or SGX flexible launch control,
@@ -6181,6 +6182,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t 
index, uint32_t count,
                      CPUID_7_0_ECX_SGX_LC))) {
                  *ecx &= ~CPUID_7_0_ECX_SGX_LC;
              }
+#endif
          } else if (count == 1) {
              *eax = env->features[FEAT_7_1_EAX];
              *edx = env->features[FEAT_7_1_EDX];
@@ -7152,6 +7154,7 @@ static void x86_cpu_filter_features(X86CPU *cpu, 
bool verbose)
          mark_unavailable_features(cpu, w, unavailable_features, prefix);
      }

+#ifndef CONFIG_USER_ONLY
      if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT) &&
          kvm_enabled()) {
          KVMState *s = CPU(cpu)->kvm_state;
@@ -7179,6 +7182,7 @@ static void x86_cpu_filter_features(X86CPU *cpu, 
bool verbose)
              mark_unavailable_features(cpu, FEAT_7_0_EBX, 
CPUID_7_0_EBX_INTEL_PT, prefix);
          }
      }
+#endif
  }
---

So I'll send a v3.



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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 20:07           ` BALATON Zoltan
@ 2023-09-11 14:48             ` Philippe Mathieu-Daudé
  2023-09-11 15:16             ` Peter Maydell
  1 sibling, 0 replies; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-11 14:48 UTC (permalink / raw)
  To: BALATON Zoltan, Michael Tokarev
  Cc: Paolo Bonzini, qemu-devel, Richard Henderson, Guenter Roeck, qemu-ppc

On 8/9/23 22:07, BALATON Zoltan wrote:
> On Fri, 8 Sep 2023, Michael Tokarev wrote:
>> 08.09.2023 22:21, BALATON Zoltan:
>>> I was about to ask, since when but probably nobody knows then. AFAIR 
>>> I had no such errors for the canyonlands one when I've added it but 
>>> that was quite some years ago and things in dtc for example could 
>>> have changed so it now gives these warnings.
>>
>> I think it can be said based on debian build logs. Lemme see..
>>
>> https://buildd.debian.org/status/logs.php?pkg=qemu&arch=all
>>
>> The first log entry there is from 2018-12-12, for qemu 3.1, dtc 1.4.7.
>> It has:
>>
>> dtc -o b/qemu/pc-bios/bamboo.dtb pc-bios/bamboo.dts
>> b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /memory: 
>> node has a reg or ranges property, but no unit name
>> b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /plb/opb: 
>> node has a reg or ranges property, but no unit name
>> b/qemu/pc-bios/bamboo.dtb: Warning (chosen_node_stdout_path): 
>> /chosen:linux,stdout-path: Use 'stdout-path' instead
>> b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb: 
>> Missing interrupt-parent
>> b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): 
>> /plb/opb/ebc: Missing interrupt-parent
> 
> 
> OK so bamboo was likely always like that. Sam460ex (aka canyonlands 
> which is the devel board it is based on) was added in February 2018 so 
> that was OK back then but later dtc versions may have become pickier 
> somewhere between 1.4.7 and 1.6.0.
> 
>> next it was moved to one of the subpackages, and moved back to
>> arch-independent package in 6.2 (2022-01-09, dtc 1.6.0), which has:
>>
>> dtc -o b/misc/bamboo.dtb pc-bios/bamboo.dts
>> pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: 
>> node has a reg or ranges property, but no unit name
>> pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): 
>> /plb/opb: node has a reg or ranges property, but no unit name
>> pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path): 
>> /chosen:linux,stdout-path: Use 'stdout-path' instead
>> pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): 
>> /plb/opb: Missing interrupt-parent
>> pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): 
>> /plb/opb/ebc: Missing interrupt-parent
>> dtc -o b/misc/canyonlands.dtb pc-bios/canyonlands.dts
>> pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): 
>> /memory: node has a reg or ranges property, but no unit name
>> pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg): 
>> /plb/opb: node has a reg or ranges property, but no unit name
>> pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge): 
>> /plb/pciex@d00000000: node name is not "pci" or "pcie"
>> pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge): 
>> /plb/pciex@d20000000: node name is not "pci" or "pcie"
> 
> Linux has this in arch/powerpc/boot/dts/canyonlands.dts and at least had 
> a change of the pciex names to pcie that should fix some of these but if 
> the u-boot still uses older names then could updating this result in 
> different results between using -kernel and without that? I don't know 
> how guests use the dtb so can't tell what to do but keeping it 
> consistent with the older u-boot this board has seems like a safer option.

Maybe we can use '-W no-pci_bridge' for this particular one.


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

* Re: [PULL 24/51] meson: compile bundled device trees
  2023-09-08 20:07           ` BALATON Zoltan
  2023-09-11 14:48             ` Philippe Mathieu-Daudé
@ 2023-09-11 15:16             ` Peter Maydell
  1 sibling, 0 replies; 81+ messages in thread
From: Peter Maydell @ 2023-09-11 15:16 UTC (permalink / raw)
  To: BALATON Zoltan
  Cc: Michael Tokarev, Philippe Mathieu-Daudé,
	Paolo Bonzini, qemu-devel, Richard Henderson, Guenter Roeck,
	qemu-ppc

On Fri, 8 Sept 2023 at 21:08, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> On Fri, 8 Sep 2023, Michael Tokarev wrote:
> > 08.09.2023 22:21, BALATON Zoltan:
> >> I was about to ask, since when but probably nobody knows then. AFAIR I had
> >> no such errors for the canyonlands one when I've added it but that was
> >> quite some years ago and things in dtc for example could have changed so it
> >> now gives these warnings.
> >
> > I think it can be said based on debian build logs. Lemme see..
> >
> > https://buildd.debian.org/status/logs.php?pkg=qemu&arch=all
> >
> > The first log entry there is from 2018-12-12, for qemu 3.1, dtc 1.4.7.
> > It has:
> >
> > dtc -o b/qemu/pc-bios/bamboo.dtb pc-bios/bamboo.dts
> > b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /memory: node has a
> > reg or ranges property, but no unit name
> > b/qemu/pc-bios/bamboo.dtb: Warning (unit_address_vs_reg): /plb/opb: node has
> > a reg or ranges property, but no unit name
> > b/qemu/pc-bios/bamboo.dtb: Warning (chosen_node_stdout_path):
> > /chosen:linux,stdout-path: Use 'stdout-path' instead
> > b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb: Missing
> > interrupt-parent
> > b/qemu/pc-bios/bamboo.dtb: Warning (interrupts_property): /plb/opb/ebc:
> > Missing interrupt-parent
>
>
> OK so bamboo was likely always like that. Sam460ex (aka canyonlands which
> is the devel board it is based on) was added in February 2018 so that was
> OK back then but later dtc versions may have become pickier somewhere
> between 1.4.7 and 1.6.0.

Yeah, at some point dtc started warning about a lot of these
things, I think in the hope that people writing dt files would
fix them before the dt got into wide circulation.

> > next it was moved to one of the subpackages, and moved back to
> > arch-independent package in 6.2 (2022-01-09, dtc 1.6.0), which has:
> >
> > dtc -o b/misc/bamboo.dtb pc-bios/bamboo.dts
> > pc-bios/bamboo.dts:45.9-48.4: Warning (unit_address_vs_reg): /memory: node
> > has a reg or ranges property, but no unit name
> > pc-bios/bamboo.dts:87.13-154.5: Warning (unit_address_vs_reg): /plb/opb: node
> > has a reg or ranges property, but no unit name
> > pc-bios/bamboo.dts:198.3-50: Warning (chosen_node_stdout_path):
> > /chosen:linux,stdout-path: Use 'stdout-path' instead
> > pc-bios/bamboo.dts:87.13-154.5: Warning (interrupts_property): /plb/opb:
> > Missing interrupt-parent
> > pc-bios/bamboo.dts:100.14-108.6: Warning (interrupts_property): /plb/opb/ebc:
> > Missing interrupt-parent
> > dtc -o b/misc/canyonlands.dtb pc-bios/canyonlands.dts
> > pc-bios/canyonlands.dts:47.9-50.4: Warning (unit_address_vs_reg): /memory:
> > node has a reg or ranges property, but no unit name
> > pc-bios/canyonlands.dts:210.13-429.5: Warning (unit_address_vs_reg):
> > /plb/opb: node has a reg or ranges property, but no unit name
> > pc-bios/canyonlands.dts:464.26-504.5: Warning (pci_bridge):
> > /plb/pciex@d00000000: node name is not "pci" or "pcie"
> > pc-bios/canyonlands.dts:506.26-546.5: Warning (pci_bridge):
> > /plb/pciex@d20000000: node name is not "pci" or "pcie"
>
> Linux has this in arch/powerpc/boot/dts/canyonlands.dts and at least had a
> change of the pciex names to pcie that should fix some of these but if the
> u-boot still uses older names then could updating this result in different
> results between using -kernel and without that? I don't know how guests
> use the dtb so can't tell what to do but keeping it consistent with the
> older u-boot this board has seems like a safer option.

At least in theory, guest code looking at a device tree blob
should be searching it by 'compatible' property name, not
by the name of the node itself. So changing node names is
a fairly safe change, though as you say the absolute safest
thing would be to not change at all.

Did we get these dts file from some other "upstream" source?
If so then the best thing is probably either to just update
from that upstream source again, or else say "these aren't
files the QEMU project is writing, so there's no point in
having the compile process warning about them, turn all the
dtc warnings off using the '-q' option".

-- PMM


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

* Re: [PULL 50/51] subprojects: add wrap file for libblkio
  2023-09-07 12:59 ` [PULL 50/51] subprojects: add wrap file for libblkio Paolo Bonzini
@ 2023-10-11  5:35   ` Philippe Mathieu-Daudé
  2023-10-11  8:47     ` Daniel P. Berrangé
  0 siblings, 1 reply; 81+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-11  5:35 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Stefan Hajnoczi, qemu-devel, Tyler Fanelli, Daniel P. Berrangé

Hi Paolo,

On 7/9/23 14:59, Paolo Bonzini wrote:
> This allows building libblkio at the same time as QEMU, if QEMU is
> configured with --enable-blkio --enable-download.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   subprojects/libblkio.wrap | 6 ++++++
>   1 file changed, 6 insertions(+)
>   create mode 100644 subprojects/libblkio.wrap
> 
> diff --git a/subprojects/libblkio.wrap b/subprojects/libblkio.wrap
> new file mode 100644
> index 00000000000..f77af72210c
> --- /dev/null
> +++ b/subprojects/libblkio.wrap
> @@ -0,0 +1,6 @@
> +[wrap-git]
> +url = https://gitlab.com/libblkio/libblkio

Tyler noticed this project isn't mirrored on QEMU gitlab namespace.

> +revision = f84cc963a444e4cb34813b2dcfc5bf8526947dc0
> +
> +[provide]
> +blkio = libblkio_dep



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

* Re: [PULL 50/51] subprojects: add wrap file for libblkio
  2023-10-11  5:35   ` Philippe Mathieu-Daudé
@ 2023-10-11  8:47     ` Daniel P. Berrangé
  2023-10-11 20:58       ` Stefan Hajnoczi
  0 siblings, 1 reply; 81+ messages in thread
From: Daniel P. Berrangé @ 2023-10-11  8:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Paolo Bonzini, Stefan Hajnoczi, qemu-devel, Tyler Fanelli

On Wed, Oct 11, 2023 at 07:35:24AM +0200, Philippe Mathieu-Daudé wrote:
> Hi Paolo,
> 
> On 7/9/23 14:59, Paolo Bonzini wrote:
> > This allows building libblkio at the same time as QEMU, if QEMU is
> > configured with --enable-blkio --enable-download.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >   subprojects/libblkio.wrap | 6 ++++++
> >   1 file changed, 6 insertions(+)
> >   create mode 100644 subprojects/libblkio.wrap
> > 
> > diff --git a/subprojects/libblkio.wrap b/subprojects/libblkio.wrap
> > new file mode 100644
> > index 00000000000..f77af72210c
> > --- /dev/null
> > +++ b/subprojects/libblkio.wrap
> > @@ -0,0 +1,6 @@
> > +[wrap-git]
> > +url = https://gitlab.com/libblkio/libblkio
> 
> Tyler noticed this project isn't mirrored on QEMU gitlab namespace.

Many other wraps aren't mirrored either, and I'm not convinced we
need to, unless the project is on an obscure self hosted git service
which is thought unreliable.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PULL 50/51] subprojects: add wrap file for libblkio
  2023-10-11  8:47     ` Daniel P. Berrangé
@ 2023-10-11 20:58       ` Stefan Hajnoczi
  2023-10-12  7:14         ` Daniel P. Berrangé
  0 siblings, 1 reply; 81+ messages in thread
From: Stefan Hajnoczi @ 2023-10-11 20:58 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Philippe Mathieu-Daudé,
	Paolo Bonzini, Stefan Hajnoczi, qemu-devel, Tyler Fanelli

On Wed, 11 Oct 2023 at 04:48, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Oct 11, 2023 at 07:35:24AM +0200, Philippe Mathieu-Daudé wrote:
> > Hi Paolo,
> >
> > On 7/9/23 14:59, Paolo Bonzini wrote:
> > > This allows building libblkio at the same time as QEMU, if QEMU is
> > > configured with --enable-blkio --enable-download.
> > >
> > > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > > ---
> > >   subprojects/libblkio.wrap | 6 ++++++
> > >   1 file changed, 6 insertions(+)
> > >   create mode 100644 subprojects/libblkio.wrap
> > >
> > > diff --git a/subprojects/libblkio.wrap b/subprojects/libblkio.wrap
> > > new file mode 100644
> > > index 00000000000..f77af72210c
> > > --- /dev/null
> > > +++ b/subprojects/libblkio.wrap
> > > @@ -0,0 +1,6 @@
> > > +[wrap-git]
> > > +url = https://gitlab.com/libblkio/libblkio
> >
> > Tyler noticed this project isn't mirrored on QEMU gitlab namespace.
>
> Many other wraps aren't mirrored either, and I'm not convinced we
> need to, unless the project is on an obscure self hosted git service
> which is thought unreliable.

What if upstream deletes the repository or sets visibility to
"private"? Do GitHub and GitLab guarantee availability of previously
public repositories?

Stefan


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

* Re: [PULL 50/51] subprojects: add wrap file for libblkio
  2023-10-11 20:58       ` Stefan Hajnoczi
@ 2023-10-12  7:14         ` Daniel P. Berrangé
  0 siblings, 0 replies; 81+ messages in thread
From: Daniel P. Berrangé @ 2023-10-12  7:14 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Philippe Mathieu-Daudé,
	Paolo Bonzini, Stefan Hajnoczi, qemu-devel, Tyler Fanelli

On Wed, Oct 11, 2023 at 04:58:01PM -0400, Stefan Hajnoczi wrote:
> On Wed, 11 Oct 2023 at 04:48, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Oct 11, 2023 at 07:35:24AM +0200, Philippe Mathieu-Daudé wrote:
> > > Hi Paolo,
> > >
> > > On 7/9/23 14:59, Paolo Bonzini wrote:
> > > > This allows building libblkio at the same time as QEMU, if QEMU is
> > > > configured with --enable-blkio --enable-download.
> > > >
> > > > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > > > ---
> > > >   subprojects/libblkio.wrap | 6 ++++++
> > > >   1 file changed, 6 insertions(+)
> > > >   create mode 100644 subprojects/libblkio.wrap
> > > >
> > > > diff --git a/subprojects/libblkio.wrap b/subprojects/libblkio.wrap
> > > > new file mode 100644
> > > > index 00000000000..f77af72210c
> > > > --- /dev/null
> > > > +++ b/subprojects/libblkio.wrap
> > > > @@ -0,0 +1,6 @@
> > > > +[wrap-git]
> > > > +url = https://gitlab.com/libblkio/libblkio
> > >
> > > Tyler noticed this project isn't mirrored on QEMU gitlab namespace.
> >
> > Many other wraps aren't mirrored either, and I'm not convinced we
> > need to, unless the project is on an obscure self hosted git service
> > which is thought unreliable.
> 
> What if upstream deletes the repository or sets visibility to
> "private"? Do GitHub and GitLab guarantee availability of previously
> public repositories?

No, there's no such guarantee. If it was a repo under a personal user
namespace mirroring is justified for this reason, but for a project
level namespace I feel we're protecting ourselves from a scenario
that's just never going to happen.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

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

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07 12:59 [PULL 00/51] Build system, i386 changes for 2023-09-07 Paolo Bonzini
2023-09-07 12:59 ` [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
2023-09-07 12:59 ` [PULL 02/51] target/i386: raise FERR interrupt with iothread locked Paolo Bonzini
2023-09-07 12:59 ` [PULL 03/51] target/i386: generalize operand size "ph" for use in CVTPS2PD Paolo Bonzini
2023-09-07 12:59 ` [PULL 04/51] target/i386: fix memory operand size for CVTPS2PD Paolo Bonzini
2023-09-07 12:59 ` [PULL 05/51] target/i386: Add support for AMX-COMPLEX in CPUID enumeration Paolo Bonzini
2023-09-07 12:59 ` [PULL 06/51] include/sysemu/os-posix.h: move *daemonize* declarations together Paolo Bonzini
2023-09-07 12:59 ` [PULL 07/51] os-posix.c: create and export os_set_runas() Paolo Bonzini
2023-09-07 12:59 ` [PULL 08/51] os-posix.c: create and export os_set_chroot() Paolo Bonzini
2023-09-07 12:59 ` [PULL 09/51] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init() Paolo Bonzini
2023-09-07 12:59 ` [PULL 10/51] os-posix.c: move code around Paolo Bonzini
2023-09-07 12:59 ` [PULL 11/51] os-posix.c: remove unneeded #includes Paolo Bonzini
2023-09-07 12:59 ` [PULL 12/51] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c Paolo Bonzini
2023-09-07 12:59 ` [PULL 13/51] util/async-teardown.c: move to softmmu/, only build it when system build is requested Paolo Bonzini
2023-09-07 12:59 ` [PULL 14/51] contrib/plugins: remove -soname argument Paolo Bonzini
2023-09-07 12:59 ` [PULL 15/51] contrib/plugins/cache: Fix string format Paolo Bonzini
2023-09-07 12:59 ` [PULL 16/51] contrib/plugins/drcov: " Paolo Bonzini
2023-09-07 12:59 ` [PULL 17/51] contrib/plugins/howvec: " Paolo Bonzini
2023-09-07 12:59 ` [PULL 18/51] contrib/plugins/lockstep: " Paolo Bonzini
2023-09-07 12:59 ` [PULL 19/51] contrib/plugins: add Darwin support Paolo Bonzini
2023-09-07 12:59 ` [PULL 20/51] meson: do not unnecessarily use cmake for dependencies Paolo Bonzini
2023-09-07 12:59 ` [PULL 21/51] meson: update unsupported host/CPU messages Paolo Bonzini
2023-09-07 12:59 ` [PULL 22/51] configure: remove HOST_CC Paolo Bonzini
2023-09-07 12:59 ` [PULL 23/51] configure: create native file with contents of $host_cc Paolo Bonzini
2023-09-07 12:59 ` [PULL 24/51] meson: compile bundled device trees Paolo Bonzini
2023-09-08 16:27   ` Philippe Mathieu-Daudé
2023-09-08 17:20     ` Michael Tokarev
2023-09-08 19:21       ` BALATON Zoltan
2023-09-08 19:40         ` Michael Tokarev
2023-09-08 20:07           ` BALATON Zoltan
2023-09-11 14:48             ` Philippe Mathieu-Daudé
2023-09-11 15:16             ` Peter Maydell
2023-09-07 12:59 ` [PULL 25/51] configure: remove boolean variables for targets Paolo Bonzini
2023-09-07 12:59 ` [PULL 26/51] configure: move --enable-debug-tcg to meson Paolo Bonzini
2023-09-07 12:59 ` [PULL 27/51] contrib/plugins: use an independent makefile Paolo Bonzini
2023-09-07 12:59 ` [PULL 28/51] configure: unify recursion into sub-Makefiles Paolo Bonzini
2023-09-07 12:59 ` [PULL 29/51] configure, meson: move --enable-plugins to meson Paolo Bonzini
2023-09-07 12:59 ` [PULL 30/51] configure, meson: remove CONFIG_SOLARIS from config-host.mak Paolo Bonzini
2023-09-07 12:59 ` [PULL 31/51] configure, meson: remove target OS symbols " Paolo Bonzini
2023-09-07 12:59 ` [PULL 32/51] meson: list leftover CONFIG_* symbols Paolo Bonzini
2023-09-07 12:59 ` [PULL 33/51] configure: remove dead code Paolo Bonzini
2023-09-07 12:59 ` [PULL 34/51] Python: Drop support for Python 3.7 Paolo Bonzini
2023-09-07 12:59 ` [PULL 35/51] mkvenv: assume presence of importlib.metadata Paolo Bonzini
2023-09-07 12:59 ` [PULL 36/51] Revert "mkvenv: work around broken pip installations on Debian 10" Paolo Bonzini
2023-09-07 12:59 ` [PULL 37/51] hw/i386/pc: Include missing 'sysemu/tcg.h' header Paolo Bonzini
2023-09-07 12:59 ` [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header Paolo Bonzini
2023-09-07 12:59 ` [PULL 39/51] hw/i386/fw_cfg: " Paolo Bonzini
2023-09-07 12:59 ` [PULL 40/51] target/i386/helper: Restrict KVM declarations to system emulation Paolo Bonzini
2023-09-07 12:59 ` [PULL 41/51] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel() Paolo Bonzini
2023-09-07 12:59 ` [PULL 42/51] target/i386: Remove unused KVM stubs Paolo Bonzini
2023-09-07 12:59 ` [PULL 43/51] target/i386: Allow elision of kvm_enable_x2apic() Paolo Bonzini
2023-09-07 12:59 ` [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable() Paolo Bonzini
2023-09-07 12:59 ` [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM Paolo Bonzini
2023-09-07 12:59 ` [PULL 46/51] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets Paolo Bonzini
2023-09-07 12:59 ` [PULL 47/51] sysemu/kvm: Restrict kvm_get_apic_state() " Paolo Bonzini
2023-09-07 12:59 ` [PULL 48/51] sysemu/kvm: Restrict kvm_has_pit_state2() " Paolo Bonzini
2023-09-07 12:59 ` [PULL 49/51] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() " Paolo Bonzini
2023-09-07 12:59 ` [PULL 50/51] subprojects: add wrap file for libblkio Paolo Bonzini
2023-10-11  5:35   ` Philippe Mathieu-Daudé
2023-10-11  8:47     ` Daniel P. Berrangé
2023-10-11 20:58       ` Stefan Hajnoczi
2023-10-12  7:14         ` Daniel P. Berrangé
2023-09-07 13:00 ` [PULL 51/51] docs/system/replay: do not show removed command line option Paolo Bonzini
2023-09-07 15:44 ` [PULL 00/51] Build system, i386 changes for 2023-09-07 Stefan Hajnoczi
2023-09-08 15:01   ` Kevin Wolf
2023-09-08 15:47     ` Stefan Hajnoczi
2023-09-11 10:10       ` Philippe Mathieu-Daudé
2023-09-11 10:22         ` Philippe Mathieu-Daudé
2023-09-11 12:12           ` Kevin Wolf
2023-09-11 11:06         ` Stefan Hajnoczi
2023-09-11 12:40           ` Thomas Huth
2023-09-08 16:11     ` Philippe Mathieu-Daudé
2023-09-08 17:16       ` Kevin Wolf
2023-09-08 17:22         ` Daniel P. Berrangé
2023-09-08 17:28         ` Michael Tokarev
2023-09-08 17:28         ` Kevin Wolf
2023-09-08 19:21           ` Paolo Bonzini
2023-09-11 10:11             ` Philippe Mathieu-Daudé
2023-09-11 14:18               ` Philippe Mathieu-Daudé
2023-09-11 10:41             ` Michael Tokarev
2023-09-11 10:44               ` Michael Tokarev

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).