Skip to contentSkip to conversation

Mostly build system and other cleanups patches for 2024-05-06

GIT PULL Applied Paolo Bonzini 2 participants 48 messages May 6, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 4977ce198d2390bff8c71ad5cb1a5f6aa24b56fb:

Merge tag 'pull-tcg-20240501' of https://gitlab.com/rth7680/qemu into staging (2024-05-01 15:15:33 -0700)

are available in the Git repository at:

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

for you to fetch changes up to deb686ef0e609ceaec0daa5dc88eb5b3dd9701b0:

qga/commands-posix: fix typo in qmp_guest_set_user_password (2024-05-03 19:36:51 +0200)

----------------------------------------------------------------
* target/i386: Introduce SapphireRapids-v3 to add missing features
* switch boards to "default y"
* allow building emulators without any board
* configs: list "implied" device groups in the default configs
* remove unnecessary declarations from typedefs.h
* target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

----------------------------------------------------------------
Lei Wang (1):
target/i386: Introduce SapphireRapids-v3 to add missing features

Paolo Bonzini (44):
Kconfig: kvm: allow building without any board tests/qtest: skip m48t59-test if the machine is absent
gitlab-ci: adjust msys2-64bit to be able to run qtest
kvm: ppc: disable sPAPR code if CONFIG_PSERIES is disabled
configs: list "implied" device groups in the default configs
alpha: switch boards to "default y"
arm: switch boards to "default y"
avr: switch boards to "default y"
cris: switch boards to "default y"
hppa: switch boards to "default y"
i386: switch boards to "default y"
loongarch: switch boards to "default y"
m68k: switch boards to "default y"
microblaze: switch boards to "default y"
meson: make target endianneess available to Kconfig
mips: switch boards to "default y"
openrisc: switch boards to "default y"
ppc: switch boards to "default y"
riscv: switch boards to "default y"
rx: switch boards to "default y"
s390x: switch boards to "default y"
sh4: switch boards to "default y"
sparc: switch boards to "default y"
tricore: switch boards to "default y"
xtensa: switch boards to "default y"
docs: document new convention for Kconfig board symbols
bitmap: Use g_try_new0/g_new0/g_renew
build: do not build virtio-vga-gl if virgl/opengl not available
fw_cfg: remove useless declarations from typedefs.h
qdev-core: remove DeviceListener from typedefs.h
numa: remove types from typedefs.h
net: remove AnnounceTimer from typedefs.h
qemu-option: remove QemuOpt from typedefs.h
intc: remove PICCommonState from typedefs.h
lockable: remove QemuLockable from typedefs.h
migration: remove PostcopyDiscardState from typedefs.h
monitor: remove MonitorDef from typedefs.h qapi/machine: remove types from typedefs.h
display: remove GraphicHwOps from typedefs.h
tcg: remove CPU* types from typedefs.h
pci: remove some types from typedefs.h
kvm: move target-dependent interrupt routing out of kvm-all.c
migration: do not include coroutine_int.h qga/commands-posix: fix typo in qmp_guest_set_user_password

Ruihan Li (1):
target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

 docs/devel/kconfig.rst                          | 14 +++++-
 configs/devices/alpha-softmmu/default.mak       |  5 +-
 configs/devices/arm-softmmu/default.mak         |  5 +-
 configs/devices/avr-softmmu/default.mak         |  5 +-
 configs/devices/cris-softmmu/default.mak        |  5 +-
 configs/devices/hppa-softmmu/default.mak        |  5 +-
 configs/devices/i386-softmmu/default.mak        | 11 ++---
 configs/devices/loongarch64-softmmu/default.mak |  6 ++-
 configs/devices/m68k-softmmu/default.mak        | 13 +++---
 configs/devices/microblaze-softmmu/default.mak  |  9 ++--
 configs/devices/mips-softmmu/common.mak         |  5 +-
 configs/devices/mips64-softmmu/default.mak      |  4 +-
 configs/devices/mips64el-softmmu/default.mak    | 10 ++--
 configs/devices/or1k-softmmu/default.mak        |  9 ++--
 configs/devices/ppc-softmmu/default.mak         | 30 +++++++-----
 configs/devices/ppc64-softmmu/default.mak       |  8 ++--
 configs/devices/riscv32-softmmu/default.mak     | 17 ++++---
 configs/devices/riscv64-softmmu/default.mak     | 19 ++++----
 configs/devices/rx-softmmu/default.mak          |  3 +-
 configs/devices/s390x-softmmu/default.mak       |  5 +-
 configs/devices/sh4-softmmu/default.mak         |  7 ++-
 configs/devices/sparc-softmmu/default.mak       |  7 ++-
 configs/devices/sparc64-softmmu/default.mak     |  7 ++-
 configs/devices/tricore-softmmu/default.mak     |  7 ++-
 configs/devices/xtensa-softmmu/default.mak      | 11 +++--
 meson.build                                     | 12 +++--
 accel/tcg/tb-jmp-cache.h                        |  4 +-
 hw/display/vga_int.h                            |  1 +
 include/hw/core/cpu.h                           | 11 ++++-
 include/hw/intc/i8259.h                         |  2 +
 include/hw/nvram/fw_cfg.h                       |  2 +
 include/hw/pci/pcie.h                           |  3 ++
 include/hw/pci/pcie_aer.h                       | 38 +++++++--------
 include/hw/pci/pcie_sriov.h                     |  8 ++--
 include/hw/qdev-core.h                          |  1 +
 include/hw/s390x/adapter.h                      |  4 +-
 include/monitor/hmp-target.h                    | 11 +++--
 include/net/announce.h                          |  4 +-
 include/qemu/bitmap.h                           | 19 ++++----
 include/qemu/coroutine.h                        |  4 +-
 include/qemu/lockable.h                         |  4 +-
 include/qemu/option.h                           |  2 +
 include/qemu/typedefs.h                         | 24 ----------
 include/sysemu/kvm.h                            |  5 +-
 include/sysemu/numa.h                           |  8 ++--
 migration/migration.h                           |  2 +-
 accel/kvm/kvm-all.c                             | 62 ++-----------------------
 hw/hyperv/hyperv.c                              | 25 ++++++++++
 hw/intc/s390_flic_kvm.c                         | 28 +++++++++++
 migration/postcopy-ram.c                        |  4 +-
 qga/commands-posix.c                            |  2 +-
 stubs/target-monitor-defs.c                     |  3 +-
 system/physmem.c                                |  4 +-
 target/i386/cpu.c                               | 11 +++++
 target/i386/tcg/translate.c                     | 14 ++++--
 target/ppc/kvm.c                                | 17 +++++--
 tests/qtest/m48t59-test.c                       | 11 +++--
 .gitlab-ci.d/buildtest.yml                      |  9 +++-
 .gitlab-ci.d/windows.yml                        |  5 +-
 hw/alpha/Kconfig                                |  2 +
 hw/arm/Kconfig                                  |  2 +
 hw/avr/Kconfig                                  |  3 ++
 hw/cris/Kconfig                                 |  2 +
 hw/display/meson.build                          | 14 +++---
 hw/hppa/Kconfig                                 |  2 +
 hw/i386/Kconfig                                 | 10 +++-
 hw/loongarch/Kconfig                            |  2 +
 hw/m68k/Kconfig                                 | 10 ++++
 hw/microblaze/Kconfig                           |  6 +++
 hw/mips/Kconfig                                 | 12 +++++
 hw/openrisc/Kconfig                             |  4 ++
 hw/ppc/Kconfig                                  | 26 +++++++++++
 hw/riscv/Kconfig                                | 14 ++++++
 hw/rx/Kconfig                                   |  2 +
 hw/s390x/Kconfig                                |  2 +
 hw/sh4/Kconfig                                  |  4 ++
 hw/sparc/Kconfig                                |  4 ++
 hw/sparc64/Kconfig                              |  4 ++
 hw/tricore/Kconfig                              |  4 ++
 hw/xtensa/Kconfig                               |  6 +++
 target/Kconfig                                  |  3 ++
 target/arm/Kconfig                              |  2 +
 target/i386/Kconfig                             |  3 ++
 target/ppc/Kconfig                              |  1 +
 84 files changed, 455 insertions(+), 280 deletions(-)
Signature · 1 line
2.44.0
#1 lore raw

[PULL 05/46] kvm: ppc: disable sPAPR code if CONFIG_PSERIES is disabled

target/ppc/kvm.c calls out to code in hw/ppc/spapr*.c; that code is not present and fails to link if CONFIG_PSERIES is not enabled. Adjust kvm.c to depend on CONFIG_PSERIES instead of TARGET_PPC64, and compile out anything that requires cap_papr, because only the pseries machine will call kvmppc_set_papr().

---
 target/ppc/kvm.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
target/ppc/kvm.c +13 -4
index 63930d4a77d..46fccff7865 100644
@@ -49,6 +49,8 @@
 #include "elf.h"
 #include "sysemu/kvm_int.h"
 
+#include CONFIG_DEVICES
+
 #define PROC_DEVTREE_CPU      "/proc/device-tree/cpus/"
 
 #define DEBUG_RETURN_GUEST 0
@@ -71,7 +73,6 @@ static int cap_hior;
 static int cap_one_reg;
 static int cap_epr;
 static int cap_ppc_watchdog;
-static int cap_papr;
 static int cap_htab_fd;
 static int cap_fixup_hcalls;
 static int cap_htm;             /* Hardware transactional memory support */
@@ -90,6 +91,12 @@ static int cap_fwnmi;
 static int cap_rpt_invalidate;
 static int cap_ail_mode_3;
 
+#ifdef CONFIG_PSERIES
+static int cap_papr;
+#else
+#define cap_papr (0)
+#endif
+
 static uint32_t debug_inst_opcode;
 
 /*
@@ -1668,7 +1675,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
         trace_kvm_handle_halt();
         ret = kvmppc_handle_halt(cpu);
         break;
-#if defined(TARGET_PPC64)
+#if defined(CONFIG_PSERIES)
     case KVM_EXIT_PAPR_HCALL:
         trace_kvm_handle_papr_hcall(run->papr_hcall.nr);
         run->papr_hcall.ret = spapr_hypercall(cpu,
@@ -1698,7 +1705,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
         ret = 0;
         break;
 
-#if defined(TARGET_PPC64)
+#if defined(CONFIG_PSERIES)
     case KVM_EXIT_NMI:
         trace_kvm_handle_nmi_exception();
         ret = kvm_handle_nmi(cpu, run);
@@ -2054,6 +2061,7 @@ void kvmppc_enable_h_rpt_invalidate(void)
     kvmppc_enable_hcall(kvm_state, H_RPT_INVALIDATE);
 }
 
+#ifdef CONFIG_PSERIES
 void kvmppc_set_papr(PowerPCCPU *cpu)
 {
     CPUState *cs = CPU(cpu);
@@ -2075,6 +2083,7 @@ void kvmppc_set_papr(PowerPCCPU *cpu)
      */
     cap_papr = 1;
 }
+#endif
 
 int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr)
 {
@@ -2837,7 +2846,7 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
     return data & 0xffff;
 }
 
-#if defined(TARGET_PPC64)
+#if defined(CONFIG_PSERIES)
 int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run)
 {
     uint16_t flags = run->flags & KVM_RUN_PPC_NMI_DISP_MASK;
Signature · 1 line
2.44.0
#2 lore raw

[PULL 14/46] m68k: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with m68k.

No changes to generated config-devices.mak file.

---
 configs/devices/m68k-softmmu/default.mak | 13 ++++++-------
 .gitlab-ci.d/buildtest.yml               |  2 +-
 hw/m68k/Kconfig                          | 10 ++++++++++
 3 files changed, 17 insertions(+), 8 deletions(-)
configs/devices/m68k-softmmu/default.mak +6 -7
index 8dcaa28ed38..3ceda6b041b 100644
@@ -1,9 +1,8 @@
 # Default configuration for m68k-softmmu
 
-# Boards:
-#
-CONFIG_AN5206=y
-CONFIG_MCF5208=y
-CONFIG_NEXTCUBE=y
-CONFIG_Q800=y
-CONFIG_M68K_VIRT=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_AN5206=n
+# CONFIG_MCF5208=n
+# CONFIG_NEXTCUBE=n
+# CONFIG_Q800=n
+# CONFIG_M68K_VIRT=n
.gitlab-ci.d/buildtest.yml +1 -1
index a82848ba55b..a91e8d359d5 100644
@@ -663,7 +663,7 @@ build-without-defaults:
       --disable-pie
       --disable-qom-cast-debug
       --disable-strip
-    TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu
+    TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
       s390x-softmmu sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
hw/m68k/Kconfig +10 -0
index d88741ec9d1..0092cda4e9c 100644
@@ -1,20 +1,28 @@
 config AN5206
     bool
+    default y
+    depends on M68K
     select COLDFIRE
     select PTIMER
 
 config MCF5208
     bool
+    default y
+    depends on M68K
     select COLDFIRE
     select PTIMER
 
 config NEXTCUBE
     bool
+    default y
+    depends on M68K
     select FRAMEBUFFER
     select ESCC
 
 config Q800
     bool
+    default y
+    depends on M68K
     select MAC_VIA
     select NUBUS
     select MACFB
@@ -29,6 +37,8 @@ config Q800
 
 config M68K_VIRT
     bool
+    default y
+    depends on M68K
     select M68K_IRQC
     select VIRT_CTRL
     select GOLDFISH_PIC
Signature · 1 line
2.44.0
#3 lore raw

[PULL 01/46] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

In reply to Paolo Bonzini

From: Ruihan Li <[email protected]>

When emulated with QEMU, interrupts will never come in the following loop. However, if the NOP instruction is uncommented, interrupts will fire as normal.

	loop:
		cli
    		call do_sti
		jmp loop

	do_sti:
		sti
		# nop
		ret

This behavior is different from that of a real processor. For example, if KVM is enabled, interrupts will always fire regardless of whether the NOP instruction is commented or not. Also, the Intel Software Developer Manual states that after the STI instruction is executed, the interrupt inhibit should end as soon as the next instruction (e.g., the RET instruction if the NOP instruction is commented) is executed.

This problem is caused because the previous code may choose not to end the TB even if the HF_INHIBIT_IRQ_MASK has just been reset (e.g., in the case where the STI instruction is immediately followed by the RET instruction), so that IRQs may not have a change to trigger. This commit fixes the problem by always terminating the current TB to give IRQs a chance to trigger when HF_INHIBIT_IRQ_MASK is reset.

Message-ID: <[email protected]>

---
 target/i386/tcg/translate.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
target/i386/tcg/translate.c +10 -4
index c05d9e52259..051ffb5e1fd 100644
@@ -2798,13 +2798,17 @@ static void gen_bnd_jmp(DisasContext *s)
 static void
 do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr)
 {
+    bool inhibit_reset;
+
     gen_update_cc_op(s);
 
     /* If several instructions disable interrupts, only the first does it.  */
-    if (inhibit && !(s->flags & HF_INHIBIT_IRQ_MASK)) {
-        gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
-    } else {
+    inhibit_reset = false;
+    if (s->flags & HF_INHIBIT_IRQ_MASK) {
         gen_reset_hflag(s, HF_INHIBIT_IRQ_MASK);
+        inhibit_reset = true;
+    } else if (inhibit) {
+        gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
     }
 
     if (s->base.tb->flags & HF_RF_MASK) {
@@ -2815,7 +2819,9 @@ do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr)
         tcg_gen_exit_tb(NULL, 0);
     } else if (s->flags & HF_TF_MASK) {
         gen_helper_single_step(tcg_env);
-    } else if (jr) {
+    } else if (jr &&
+               /* give irqs a chance to happen */
+               !inhibit_reset) {
         tcg_gen_lookup_and_goto_ptr();
     } else {
         tcg_gen_exit_tb(NULL, 0);
Signature · 1 line
2.44.0
#4 lore raw

[PULL 04/46] gitlab-ci: adjust msys2-64bit to be able to run qtest

In reply to Paolo Bonzini

sparc-softmmu is able to run a subset of qtests when compiled --without-default-devices, so use it instead of x86_64-softmmu for the msys2 run.

---
 .gitlab-ci.d/windows.yml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
.gitlab-ci.d/windows.yml +1 -4
index 94834269ec7..d26dbdd0c0d 100644
@@ -24,10 +24,7 @@ msys2-64bit:
     # changed to compile QEMU with the --without-default-devices switch
     # for this job, because otherwise the build could not complete within
     # the project timeout.
-    CONFIGURE_ARGS:  --target-list=x86_64-softmmu --without-default-devices -Ddebug=false -Doptimization=0
-    # qTests don't run successfully with "--without-default-devices",
-    # so let's exclude the qtests from CI for now.
-    TEST_ARGS: --no-suite qtest
+    CONFIGURE_ARGS:  --target-list=sparc-softmmu --without-default-devices -Ddebug=false -Doptimization=0
     # The Windows git is a bit older so override the default
     GIT_FETCH_EXTRA_FLAGS: --no-tags --prune --quiet
   artifacts:
Signature · 1 line
2.44.0
#5 lore raw

[PULL 12/46] i386: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with i386.

No changes to generated config-devices.mak files, other than adding CONFIG_I386 to the x86_64-softmmu target.

---
 configs/devices/i386-softmmu/default.mak | 11 +++++------
 .gitlab-ci.d/buildtest.yml               |  3 ++-
 hw/i386/Kconfig                          | 10 +++++++++-
 target/i386/Kconfig                      |  1 +
 4 files changed, 17 insertions(+), 8 deletions(-)
configs/devices/i386-softmmu/default.mak +5 -6
index 598c6646dfc..448e3e3b1ba 100644
@@ -24,9 +24,8 @@
 #CONFIG_VTD=n
 #CONFIG_SGX=n
 
-# Boards:
-#
-CONFIG_ISAPC=y
-CONFIG_I440FX=y
-CONFIG_Q35=y
-CONFIG_MICROVM=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_ISAPC=n
+# CONFIG_I440FX=n
+# CONFIG_Q35=n
+# CONFIG_MICROVM=n
.gitlab-ci.d/buildtest.yml +2 -1
index 6531758d968..75222c4450b 100644
@@ -648,7 +648,8 @@ build-tci:
     - make check-tcg
 
 # Check our reduced build configurations
-# requires libfdt: aarch64, arm
+# requires libfdt: aarch64, arm, i386, x86_64
+# does not build without boards: i386, x86_64
 build-without-defaults:
   extends: .native_build_job_template
   needs:
hw/i386/Kconfig +9 -1
index a6ee052f9a1..4362164962c 100644
@@ -66,6 +66,8 @@ config PC_ACPI
 
 config I440FX
     bool
+    default y
+    depends on I386
     imply E1000_PCI
     imply VMPORT
     imply VMMOUSE
@@ -81,6 +83,8 @@ config I440FX
 
 config ISAPC
     bool
+    default y
+    depends on I386
     imply VGA_ISA
     select ISA_BUS
     select PC
@@ -91,6 +95,8 @@ config ISAPC
 
 config Q35
     bool
+    default y
+    depends on I386
     imply VTD
     imply AMD_IOMMU
     imply E1000E_PCI_EXPRESS
@@ -108,6 +114,8 @@ config Q35
 
 config MICROVM
     bool
+    default y
+    depends on I386
     select SERIAL_ISA # for serial_hds_isa_init()
     select ISA_BUS
     select APIC
@@ -142,4 +150,4 @@ config VMMOUSE
 config XEN_EMU
     bool
     default y
-    depends on KVM && (I386 || X86_64)
+    depends on KVM && I386
target/i386/Kconfig +1 -0
index 46898946394..ad9291d3b8f 100644
@@ -5,3 +5,4 @@ config I386
 
 config X86_64
     bool
+    select I386
Signature · 1 line
2.44.0
#6 lore raw

[PULL 19/46] ppc: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with PowerPC/POWER.

No changes to generated config-devices.mak files, other than adding CONFIG_PPC to the ppc64-softmmu target.

---
 configs/devices/ppc-softmmu/default.mak   | 26 ++++++++++++-----------
 configs/devices/ppc64-softmmu/default.mak |  8 +++----
 .gitlab-ci.d/buildtest.yml                |  2 +-
 hw/ppc/Kconfig                            | 26 +++++++++++++++++++++++
 target/ppc/Kconfig                        |  1 +
 5 files changed, 45 insertions(+), 18 deletions(-)
configs/devices/ppc-softmmu/default.mak +14 -12
index 3061b26749a..460d15e676b 100644
@@ -4,22 +4,24 @@
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
-# For embedded PPCs:
-CONFIG_E500PLAT=y
-CONFIG_MPC8544DS=y
-CONFIG_PPC405=y
-CONFIG_PPC440=y
-CONFIG_VIRTEX=y
+# Boards are selected by default, uncomment to keep out of the build.
+
+# Embedded PPCs:
+# CONFIG_E500PLAT=n
+# CONFIG_MPC8544DS=n
+# CONFIG_PPC405=n
+# CONFIG_PPC440=n
+# CONFIG_VIRTEX=n
 
 # For Sam460ex
-CONFIG_SAM460EX=y
+# CONFIG_SAM460EX=n
 
 # For Macs
-CONFIG_MAC_OLDWORLD=y
-CONFIG_MAC_NEWWORLD=y
+# CONFIG_MAC_OLDWORLD=n
+# CONFIG_MAC_NEWWORLD=n
 
-CONFIG_AMIGAONE=y
-CONFIG_PEGASOS2=y
+# CONFIG_AMIGAONE=n
+# CONFIG_PEGASOS2=n
 
 # For PReP
-CONFIG_PREP=y
+# CONFIG_PREP=n
configs/devices/ppc64-softmmu/default.mak +3 -5
index b90e5bf4558..e8ad2603133 100644
@@ -3,8 +3,6 @@
 # Include all 32-bit boards
 include ../ppc-softmmu/default.mak
 
-# For PowerNV
-CONFIG_POWERNV=y
-
-# For pSeries
-CONFIG_PSERIES=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_POWERNV=n
+# CONFIG_PSERIES=n
.gitlab-ci.d/buildtest.yml +1 -1
index 49cd50c354d..a5f4b4d3793 100644
@@ -649,7 +649,7 @@ build-tci:
 
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
-#   mips64el, or1k, x86_64
+#   mips64el, or1k, ppc, ppc64, x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
hw/ppc/Kconfig +26 -0
index 37ccf9cdcaf..78f83e78ce5 100644
@@ -1,5 +1,7 @@
 config PSERIES
     bool
+    default y
+    depends on PPC64
     imply USB_OHCI_PCI
     imply PCI_DEVICES
     imply TEST_DEVICES
@@ -23,6 +25,8 @@ config SPAPR_RNG
 
 config POWERNV
     bool
+    default y
+    depends on PPC64
     imply PCI_DEVICES
     imply TEST_DEVICES
     select ISA_IPMI_BT
@@ -38,6 +42,8 @@ config POWERNV
 
 config PPC405
     bool
+    default y
+    depends on PPC
     select M48T59
     select PFLASH_CFI02
     select PPC4XX
@@ -45,6 +51,8 @@ config PPC405
 
 config PPC440
     bool
+    default y
+    depends on PPC
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply E1000_PCI
@@ -62,6 +70,8 @@ config PPC4XX
 
 config SAM460EX
     bool
+    default y
+    depends on PPC
     select PFLASH_CFI01
     select IDE_SII3112
     select M41T80
@@ -75,6 +85,8 @@ config SAM460EX
 
 config AMIGAONE
     bool
+    default y
+    depends on PPC
     imply ATI_VGA
     select ARTICIA
     select VT82C686
@@ -82,6 +94,8 @@ config AMIGAONE
 
 config PEGASOS2
     bool
+    default y
+    depends on PPC
     imply ATI_VGA
     select MV64361
     select VT82C686
@@ -90,6 +104,8 @@ config PEGASOS2
 
 config PREP
     bool
+    default y
+    depends on PPC
     imply PCI_DEVICES
     imply TEST_DEVICES
     select CS4231A
@@ -106,6 +122,8 @@ config RS6000_MC
 
 config MAC_OLDWORLD
     bool
+    default y
+    depends on PPC
     imply PCI_DEVICES
     imply SUNGEM
     imply TEST_DEVICES
@@ -117,6 +135,8 @@ config MAC_OLDWORLD
 
 config MAC_NEWWORLD
     bool
+    default y
+    depends on PPC
     imply PCI_DEVICES
     imply SUNGEM
     imply TEST_DEVICES
@@ -147,14 +167,20 @@ config E500
 
 config E500PLAT
     bool
+    default y
+    depends on PPC
     select E500
 
 config MPC8544DS
     bool
+    default y
+    depends on PPC
     select E500
 
 config VIRTEX
     bool
+    default y
+    depends on PPC
     select PPC4XX
     select PFLASH_CFI01
     select SERIAL
target/ppc/Kconfig +1 -0
index 3ff152051a3..0283711673e 100644
@@ -3,3 +3,4 @@ config PPC
 
 config PPC64
     bool
+    select PPC
Signature · 1 line
2.44.0
#7 lore raw

[PULL 02/46] Kconfig: kvm: allow building without any board

In reply to Paolo Bonzini

KVM code might have to call functions on the PCIDevice that is passed to kvm_arch_fixup_msi_route(). This fails in the case where --without-default-devices is used and no board is configured. While this is not really a useful configuration, and therefore setting up stubs for CONFIG_PCI is overkill, failing the build is impolite. Just include the PCI subsystem if kvm_arch_fixup_msi_route() requires it, as is the case for ARM and x86.

---
 target/arm/Kconfig  | 2 ++
 target/i386/Kconfig | 2 ++
 2 files changed, 4 insertions(+)
target/arm/Kconfig +2 -0
index bf57d739cd1..5847c5a74a7 100644
@@ -9,3 +9,5 @@ config ARM
 config AARCH64
     bool
     select ARM
+    # kvm_arch_fixup_msi_route() needs to access PCIDevice
+    select PCI if KVM
target/i386/Kconfig +2 -0
index ce6968906ee..46898946394 100644
@@ -1,5 +1,7 @@
 config I386
     bool
+    # kvm_arch_fixup_msi_route() needs to access PCIDevice
+    select PCI if KVM
 
 config X86_64
     bool
Signature · 1 line
2.44.0
#8 lore raw

[PULL 29/46] bitmap: Use g_try_new0/g_new0/g_renew

In reply to Paolo Bonzini

Avoids an explicit use of sizeof(). The GLib allocation macros ensure that the multiplication by the size of the element uses the right type and does not overflow.

While at it, change bitmap_new() to use g_new0 directly. Its current impl of calling bitmap_try_new() followed by a plain abort() has worse diagnostics than g_new0, which uses g_error to report the actual allocation size that failed.

---
 include/qemu/bitmap.h | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
include/qemu/bitmap.h +8 -11
index 97806811eeb..1cf288445f3 100644
@@ -92,17 +92,14 @@ long slow_bitmap_count_one(const unsigned long *bitmap, long nbits);
 
 static inline unsigned long *bitmap_try_new(long nbits)
 {
-    long len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
-    return g_try_malloc0(len);
+    long nelem = BITS_TO_LONGS(nbits);
+    return g_try_new0(unsigned long, nelem);
 }
 
 static inline unsigned long *bitmap_new(long nbits)
 {
-    unsigned long *ptr = bitmap_try_new(nbits);
-    if (ptr == NULL) {
-        abort();
-    }
-    return ptr;
+    long nelem = BITS_TO_LONGS(nbits);
+    return g_new0(unsigned long, nelem);
 }
 
 static inline void bitmap_zero(unsigned long *dst, long nbits)
@@ -265,10 +262,10 @@ unsigned long bitmap_find_next_zero_area(unsigned long *map,
 static inline unsigned long *bitmap_zero_extend(unsigned long *old,
                                                 long old_nbits, long new_nbits)
 {
-    long new_len = BITS_TO_LONGS(new_nbits) * sizeof(unsigned long);
-    unsigned long *new = g_realloc(old, new_len);
-    bitmap_clear(new, old_nbits, new_nbits - old_nbits);
-    return new;
+    long new_nelem = BITS_TO_LONGS(new_nbits);
+    unsigned long *ptr = g_renew(unsigned long, old, new_nelem);
+    bitmap_clear(ptr, old_nbits, new_nbits - old_nbits);
+    return ptr;
 }
 
 void bitmap_to_le(unsigned long *dst, const unsigned long *src,
Signature · 1 line
2.44.0
#9 lore raw

[PULL 35/46] qemu-option: remove QemuOpt from typedefs.h

In reply to Paolo Bonzini

QemuOpt is basically an internal data structure. It has no business being defined except if you need functions from include/qemu/option.h.

---
 include/qemu/option.h   | 2 ++
 include/qemu/typedefs.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
include/qemu/option.h +2 -0
index b3498287823..01e673ae03f 100644
@@ -54,6 +54,8 @@ enum QemuOptType {
     QEMU_OPT_SIZE,        /* size, accepts (K)ilo, (M)ega, (G)iga, (T)era postfix */
 };
 
+typedef struct QemuOpt QemuOpt;
+
 typedef struct QemuOptDesc {
     const char *name;
     enum QemuOptType type;
include/qemu/typedefs.h +0 -1
index 520f421397b..4519f0cd613 100644
@@ -108,7 +108,6 @@ typedef struct QEMUCursor QEMUCursor;
 typedef struct QEMUFile QEMUFile;
 typedef struct QemuLockable QemuLockable;
 typedef struct QemuMutex QemuMutex;
-typedef struct QemuOpt QemuOpt;
 typedef struct QemuOpts QemuOpts;
 typedef struct QemuOptsList QemuOptsList;
 typedef struct QEMUSGList QEMUSGList;
Signature · 1 line
2.44.0
#10 lore raw

[PULL 23/46] sh4: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with SH.

No changes to generated config-devices.mak file.

---
 configs/devices/sh4-softmmu/default.mak | 7 +++----
 .gitlab-ci.d/buildtest.yml              | 3 +--
 hw/sh4/Kconfig                          | 4 ++++
 3 files changed, 8 insertions(+), 6 deletions(-)
configs/devices/sh4-softmmu/default.mak +3 -4
index 565e8b0b5df..c06a427053a 100644
@@ -5,7 +5,6 @@
 #CONFIG_PCI_DEVICES=n
 #CONFIG_TEST_DEVICES=n
 
-# Boards:
-#
-CONFIG_R2D=y
-CONFIG_SHIX=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_R2D=n
+# CONFIG_SHIX=n
.gitlab-ci.d/buildtest.yml +1 -2
index 2475262c5c8..fd665931847 100644
@@ -650,7 +650,7 @@ build-tci:
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
 #   mips64el, or1k, ppc, ppc64, riscv32, riscv64, rx, x86_64
-# does not build without boards: i386, loongarch64, s390x, x86_64
+# does not build without boards: i386, loongarch64, s390x, sh4, sh4eb, x86_64
 build-without-defaults:
   extends: .native_build_job_template
   needs:
@@ -666,7 +666,6 @@ build-without-defaults:
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
       mips-softmmu mips64-softmmu mipsel-softmmu
-      sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/sh4/Kconfig +4 -0
index e0c4ecd1a53..99a76a94c3f 100644
@@ -1,5 +1,7 @@
 config R2D
     bool
+    default y
+    depends on SH4
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply RTL8139_PCI
@@ -13,6 +15,8 @@ config R2D
 
 config SHIX
     bool
+    default y
+    depends on SH4
     select SH7750
     select TC58128
 
Signature · 1 line
2.44.0
#11 lore raw

[PULL 39/46] monitor: remove MonitorDef from typedefs.h

In reply to Paolo Bonzini

MonitorDef is defined by hmp-target.h, and all users except one already include it; the reason why the stubs do not include it, is because hmp-target.h currently can only be used in files that are compiled per target. However, that is easily fixed. Because the benefit of having MonitorDef in typedefs.h is very small, do it and remove the type from typedefs.h.

---
 include/monitor/hmp-target.h | 11 +++++++----
 include/qemu/typedefs.h      |  1 -
 stubs/target-monitor-defs.c  |  3 +--
 3 files changed, 8 insertions(+), 7 deletions(-)
include/monitor/hmp-target.h +7 -4
index d78e979f053..b679aaebbff 100644
@@ -25,11 +25,10 @@
 #ifndef MONITOR_HMP_TARGET_H
 #define MONITOR_HMP_TARGET_H
 
+typedef struct MonitorDef MonitorDef;
+
+#ifdef COMPILING_PER_TARGET
 #include "cpu.h"
-
-#define MD_TLONG 0
-#define MD_I32   1
-
 struct MonitorDef {
     const char *name;
     int offset;
@@ -37,6 +36,10 @@ struct MonitorDef {
                              int val);
     int type;
 };
+#endif
+
+#define MD_TLONG 0
+#define MD_I32   1
 
 const MonitorDef *target_monitor_defs(void);
 int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
include/qemu/typedefs.h +0 -1
index 2b1948a19ac..b71a36d02b2 100644
@@ -75,7 +75,6 @@ typedef struct MemoryRegionSection MemoryRegionSection;
 typedef struct MigrationIncomingState MigrationIncomingState;
 typedef struct MigrationState MigrationState;
 typedef struct Monitor Monitor;
-typedef struct MonitorDef MonitorDef;
 typedef struct MSIMessage MSIMessage;
 typedef struct NetClientState NetClientState;
 typedef struct NetFilterState NetFilterState;
stubs/target-monitor-defs.c +1 -2
index ac07b19064c..35a0a342772 100644
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
-
-const MonitorDef *target_monitor_defs(void);
+#include "monitor/hmp-target.h"
 
 const MonitorDef *target_monitor_defs(void)
 {
Signature · 1 line
2.44.0
#12 lore raw

[PULL 15/46] microblaze: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Microblaze.

No changes to generated config-devices.mak file.

---
 configs/devices/microblaze-softmmu/default.mak | 9 ++++-----
 .gitlab-ci.d/buildtest.yml                     | 3 ++-
 hw/microblaze/Kconfig                          | 6 ++++++
 3 files changed, 12 insertions(+), 6 deletions(-)
configs/devices/microblaze-softmmu/default.mak +4 -5
index db8c6e4bba3..583e3959bb7 100644
@@ -1,7 +1,6 @@
 # Default configuration for microblaze-softmmu
 
-# Boards:
-#
-CONFIG_PETALOGIX_S3ADSP1800=y
-CONFIG_PETALOGIX_ML605=y
-CONFIG_XLNX_ZYNQMP_PMU=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_PETALOGIX_S3ADSP1800=n
+# CONFIG_PETALOGIX_ML605=n
+# CONFIG_XLNX_ZYNQMP_PMU=n
.gitlab-ci.d/buildtest.yml +2 -1
index a91e8d359d5..e2e92f25c58 100644
@@ -648,7 +648,8 @@ build-tci:
     - make check-tcg
 
 # Check our reduced build configurations
-# requires libfdt: aarch64, arm, i386, loongarch64, x86_64
+# requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
+#   x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
hw/microblaze/Kconfig +6 -0
index e2697ced9cc..d78ba843fac 100644
@@ -1,5 +1,7 @@
 config PETALOGIX_S3ADSP1800
     bool
+    default y
+    depends on MICROBLAZE
     select PFLASH_CFI01
     select XILINX
     select XILINX_AXI
@@ -8,6 +10,8 @@ config PETALOGIX_S3ADSP1800
 
 config PETALOGIX_ML605
     bool
+    default y
+    depends on MICROBLAZE
     select PFLASH_CFI01
     select SERIAL
     select SSI_M25P80
@@ -18,4 +22,6 @@ config PETALOGIX_ML605
 
 config XLNX_ZYNQMP_PMU
     bool
+    default y
+    depends on MICROBLAZE
     select XLNX_ZYNQMP
Signature · 1 line
2.44.0
#13 lore raw

[PULL 30/46] build: do not build virtio-vga-gl if virgl/opengl not available

In reply to Paolo Bonzini

If virgl and opengl are not available, the build process creates a useless libvirtio-vga-gl module that does not have any device in it. Follow the example of virtio-vga-rutabaga and do not build the module at all in that case.

---
 hw/display/meson.build | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
hw/display/meson.build +8 -6
index 7893b94c8ee..7db05eace97 100644
@@ -125,12 +125,14 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
                                          if_false: files('acpi-vga-stub.c'))
   hw_display_modules += {'virtio-vga': virtio_vga_ss}
 
-  virtio_vga_gl_ss = ss.source_set()
-  virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
-                       if_true: [files('virtio-vga-gl.c'), pixman])
-  virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
-                                            if_false: files('acpi-vga-stub.c'))
-  hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
+  if virgl.found() and opengl.found()
+    virtio_vga_gl_ss = ss.source_set()
+    virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
+                         if_true: [files('virtio-vga-gl.c'), pixman])
+    virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
+                                              if_false: files('acpi-vga-stub.c'))
+    hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
+  endif
 
   if rutabaga.found()
     virtio_vga_rutabaga_ss = ss.source_set()
Signature · 1 line
2.44.0
#14 lore raw

[PULL 10/46] cris: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with CRIS.

No changes to generated config-devices.mak file.

---
 configs/devices/cris-softmmu/default.mak | 5 ++---
 .gitlab-ci.d/buildtest.yml               | 3 ++-
 hw/cris/Kconfig                          | 2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)
configs/devices/cris-softmmu/default.mak +2 -3
index 5932cf4d06f..ff73cd40847 100644
@@ -1,5 +1,4 @@
 # Default configuration for cris-softmmu
 
-# Boards:
-#
-CONFIG_AXIS=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_AXIS=n
.gitlab-ci.d/buildtest.yml +2 -1
index 3a03cdb0151..f4dc5666467 100644
@@ -662,7 +662,8 @@ build-without-defaults:
       --disable-pie
       --disable-qom-cast-debug
       --disable-strip
-    TARGETS: alpha-softmmu avr-softmmu s390x-softmmu sh4-softmmu
+    TARGETS: alpha-softmmu avr-softmmu cris-softmmu
+      s390x-softmmu sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/cris/Kconfig +2 -0
index 884ad2cbc0d..26c7eef7437 100644
@@ -1,5 +1,7 @@
 config AXIS
     bool
+    default y
+    depends on CRIS
     select ETRAXFS
     select PFLASH_CFI02
     select NAND
Signature · 1 line
2.44.0
#15 lore raw

[PULL 37/46] lockable: remove QemuLockable from typedefs.h

In reply to Paolo Bonzini

Using QemuLockable almost always requires going through QEMU_MAKE_LOCKABLE(). Therefore, there is little point in having the typedef always present. Move it to lockable.h, with only a small adjustment to coroutine.h (which has a tricky co-dependency with lockable.h due to defining CoMutex *and* using QemuLockable as a part of the CoQueue API).

---
 include/qemu/coroutine.h | 4 ++--
 include/qemu/lockable.h  | 4 ++--
 include/qemu/typedefs.h  | 1 -
 3 files changed, 4 insertions(+), 5 deletions(-)
include/qemu/coroutine.h +2 -2
index e6aff453017..ff3084538b8 100644
@@ -84,6 +84,8 @@ static inline coroutine_fn void qemu_co_mutex_assert_locked(CoMutex *mutex)
            mutex->holder == qemu_coroutine_self());
 }
 
+#include "qemu/lockable.h"
+
 /**
  * CoQueues are a mechanism to queue coroutines in order to continue executing
  * them later.  They are similar to condition variables, but they need help
@@ -281,8 +283,6 @@ void qemu_coroutine_inc_pool_size(unsigned int additional_pool_size);
  */
 void qemu_coroutine_dec_pool_size(unsigned int additional_pool_size);
 
-#include "qemu/lockable.h"
-
 /**
  * Sends a (part of) iovec down a socket, yielding when the socket is full, or
  * Receives data into a (part of) iovec from a socket,
include/qemu/lockable.h +2 -2
index 9823220446d..62110d2eb74 100644
@@ -18,11 +18,11 @@
 
 typedef void QemuLockUnlockFunc(void *);
 
-struct QemuLockable {
+typedef struct QemuLockable {
     void *object;
     QemuLockUnlockFunc *lock;
     QemuLockUnlockFunc *unlock;
-};
+} QemuLockable;
 
 static inline __attribute__((__always_inline__)) QemuLockable *
 qemu_make_lockable(void *x, QemuLockable *lockable)
include/qemu/typedefs.h +0 -1
index 090e219248a..ab24ca2876c 100644
@@ -105,7 +105,6 @@ typedef struct QEMUBH QEMUBH;
 typedef struct QemuConsole QemuConsole;
 typedef struct QEMUCursor QEMUCursor;
 typedef struct QEMUFile QEMUFile;
-typedef struct QemuLockable QemuLockable;
 typedef struct QemuMutex QemuMutex;
 typedef struct QemuOpts QemuOpts;
 typedef struct QemuOptsList QemuOptsList;
Signature · 1 line
2.44.0
#16 lore raw

[PULL 09/46] avr: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with AVR.

No changes to generated config-devices.mak file.

---
 configs/devices/avr-softmmu/default.mak | 5 ++---
 hw/avr/Kconfig                          | 3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)
configs/devices/avr-softmmu/default.mak +2 -3
index 80218add98c..4207e7b3ce2 100644
@@ -1,5 +1,4 @@
 # Default configuration for avr-softmmu
 
-# Boards:
-#
-CONFIG_ARDUINO=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_ARDUINO=n
hw/avr/Kconfig +3 -0
index d31298c3cce..b29937be414 100644
@@ -5,5 +5,8 @@ config AVR_ATMEGA_MCU
     select AVR_POWER
 
 config ARDUINO
+    bool
+    default y
+    depends on AVR
     select AVR_ATMEGA_MCU
     select UNIMP
Signature · 1 line
2.44.0
#17 lore raw

[PULL 44/46] kvm: move target-dependent interrupt routing out of kvm-all.c

In reply to Paolo Bonzini

Let hw/hyperv/hyperv.c and hw/intc/s390_flic.c handle (respectively) SynIC and adapter routes, removing the code from target-independent files. This also removes the only occurrence of AdapterInfo outside s390 code, so remove that from typedefs.h.

---
 include/hw/s390x/adapter.h |  4 +--
 include/qemu/typedefs.h    |  1 -
 include/sysemu/kvm.h       |  5 +--
 accel/kvm/kvm-all.c        | 62 ++------------------------------------
 hw/hyperv/hyperv.c         | 25 +++++++++++++++
 hw/intc/s390_flic_kvm.c    | 28 +++++++++++++++++
 6 files changed, 61 insertions(+), 64 deletions(-)
include/hw/s390x/adapter.h +2 -2
index 7f1703508c4..d4fadc4f7f8 100644
@@ -12,12 +12,12 @@
 #ifndef S390X_ADAPTER_H
 #define S390X_ADAPTER_H
 
-struct AdapterInfo {
+typedef struct AdapterInfo {
     uint64_t ind_addr;
     uint64_t summary_addr;
     uint64_t ind_offset;
     uint32_t summary_offset;
     uint32_t adapter_id;
-};
+} AdapterInfo;
 
 #endif
include/qemu/typedefs.h +0 -1
index 5d999e20d7c..2ff50bf5970 100644
@@ -23,7 +23,6 @@
  */
 typedef struct AccelCPUState AccelCPUState;
 typedef struct AccelState AccelState;
-typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
 typedef struct Aml Aml;
include/sysemu/kvm.h +3 -2
index eaf801bc934..c31d9c73566 100644
@@ -470,10 +470,11 @@ static inline void kvm_irqchip_commit_route_changes(KVMRouteChange *c)
     }
 }
 
+int kvm_irqchip_get_virq(KVMState *s);
 void kvm_irqchip_release_virq(KVMState *s, int virq);
 
-int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter);
-int kvm_irqchip_add_hv_sint_route(KVMState *s, uint32_t vcpu, uint32_t sint);
+void kvm_add_routing_entry(KVMState *s,
+                           struct kvm_irq_routing_entry *entry);
 
 int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
                                        EventNotifier *rn, int virq);
accel/kvm/kvm-all.c +3 -59

80 lines not on this page · raw message

hw/hyperv/hyperv.c +25 -0
index 3ea54ba818b..483dcca3083 100644
@@ -373,6 +373,31 @@ int hyperv_set_event_flag(HvSintRoute *sint_route, unsigned eventno)
     return ret;
 }
 
+static int kvm_irqchip_add_hv_sint_route(KVMState *s, uint32_t vcpu, uint32_t sint)
+{
+    struct kvm_irq_routing_entry kroute = {};
+    int virq;
+
+    if (!kvm_gsi_routing_enabled()) {
+        return -ENOSYS;
+    }
+    virq = kvm_irqchip_get_virq(s);
+    if (virq < 0) {
+        return virq;
+    }
+
+    kroute.gsi = virq;
+    kroute.type = KVM_IRQ_ROUTING_HV_SINT;
+    kroute.flags = 0;
+    kroute.u.hv_sint.vcpu = vcpu;
+    kroute.u.hv_sint.sint = sint;
+
+    kvm_add_routing_entry(s, &kroute);
+    kvm_irqchip_commit_routes(s);
+
+    return virq;
+}
+
 HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint,
                                    HvSintMsgCb cb, void *cb_data)
 {
hw/intc/s390_flic_kvm.c +28 -0
index baaa30dcb73..330f08dfdc2 100644
@@ -324,6 +324,34 @@ static int kvm_s390_io_adapter_map(S390FLICState *fs, uint32_t id,
     return r ? -errno : 0;
 }
 
+static int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
+{
+    struct kvm_irq_routing_entry kroute = {};
+    int virq;
+
+    if (!kvm_gsi_routing_enabled()) {
+        return -ENOSYS;
+    }
+
+    virq = kvm_irqchip_get_virq(s);
+    if (virq < 0) {
+        return virq;
+    }
+
+    kroute.gsi = virq;
+    kroute.type = KVM_IRQ_ROUTING_S390_ADAPTER;
+    kroute.flags = 0;
+    kroute.u.adapter.summary_addr = adapter->summary_addr;
+    kroute.u.adapter.ind_addr = adapter->ind_addr;
+    kroute.u.adapter.summary_offset = adapter->summary_offset;
+    kroute.u.adapter.ind_offset = adapter->ind_offset;
+    kroute.u.adapter.adapter_id = adapter->adapter_id;
+
+    kvm_add_routing_entry(s, &kroute);
+
+    return virq;
+}
+
 static int kvm_s390_add_adapter_routes(S390FLICState *fs,
                                        AdapterRoutes *routes)
 {
Signature · 1 line
2.44.0
#18 lore raw

[PULL 33/46] numa: remove types from typedefs.h

In reply to Paolo Bonzini

Exactly nobody needs them there. Place the typedef in the header that defines the struct.

---
 include/qemu/typedefs.h | 2 --
 include/sysemu/numa.h   | 8 ++++----
 2 files changed, 4 insertions(+), 6 deletions(-)
include/qemu/typedefs.h +0 -2
index 66f0b146c8c..e0a0bc31e7f 100644
@@ -81,8 +81,6 @@ typedef struct MSIMessage MSIMessage;
 typedef struct NetClientState NetClientState;
 typedef struct NetFilterState NetFilterState;
 typedef struct NICInfo NICInfo;
-typedef struct NodeInfo NodeInfo;
-typedef struct NumaNodeMem NumaNodeMem;
 typedef struct Object Object;
 typedef struct ObjectClass ObjectClass;
 typedef struct PCIBridge PCIBridge;
include/sysemu/numa.h +4 -4
index 825cfe86bc1..04676141470 100644
@@ -36,7 +36,7 @@ enum {
 
 #define UINT16_BITS       16
 
-struct NodeInfo {
+typedef struct NodeInfo {
     uint64_t node_mem;
     struct HostMemoryBackend *node_memdev;
     bool present;
@@ -45,12 +45,12 @@ struct NodeInfo {
     uint8_t lb_info_provided;
     uint16_t initiator;
     uint8_t distance[MAX_NODES];
-};
+} NodeInfo;
 
-struct NumaNodeMem {
+typedef struct NumaNodeMem {
     uint64_t node_mem;
     uint64_t node_plugged_mem;
-};
+} NumaNodeMem;
 
 struct HMAT_LB_Data {
     uint8_t     initiator;
Signature · 1 line
2.44.0
#19 lore raw

[PULL 31/46] fw_cfg: remove useless declarations from typedefs.h

In reply to Paolo Bonzini

Only FWCfgState is used as part of APIs such as acpi_ghes_add_fw_cfg. Everything else need not be in typedefs.h.

---
 include/hw/nvram/fw_cfg.h | 2 ++
 include/qemu/typedefs.h   | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)
include/hw/nvram/fw_cfg.h +2 -0
index c1f81a5f13a..d173998803c 100644
@@ -59,6 +59,8 @@ typedef struct fw_cfg_dma_access FWCfgDmaAccess;
 typedef void (*FWCfgCallback)(void *opaque);
 typedef void (*FWCfgWriteCallback)(void *opaque, off_t start, size_t len);
 
+typedef struct FWCfgEntry FWCfgEntry;
+
 struct FWCfgState {
     /*< private >*/
     SysBusDevice parent_obj;
include/qemu/typedefs.h +0 -3
index 50c277cf0b4..949d3e1daf9 100644
@@ -56,9 +56,6 @@ typedef struct DumpState DumpState;
 typedef struct Error Error;
 typedef struct EventNotifier EventNotifier;
 typedef struct FlatView FlatView;
-typedef struct FWCfgEntry FWCfgEntry;
-typedef struct FWCfgIoState FWCfgIoState;
-typedef struct FWCfgMemState FWCfgMemState;
 typedef struct FWCfgState FWCfgState;
 typedef struct GraphicHwOps GraphicHwOps;
 typedef struct HostMemoryBackend HostMemoryBackend;
Signature · 1 line
2.44.0
#20 lore raw

[PULL 22/46] s390x: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with s390.

No changes to generated config-devices.mak file.

---
 configs/devices/s390x-softmmu/default.mak | 5 ++---
 .gitlab-ci.d/buildtest.yml                | 4 ++--
 hw/s390x/Kconfig                          | 2 ++
 3 files changed, 6 insertions(+), 5 deletions(-)
configs/devices/s390x-softmmu/default.mak +2 -3
index 6d87bc8b4b0..340c1092922 100644
@@ -9,6 +9,5 @@
 #CONFIG_WDT_DIAG288=n
 #CONFIG_PCIE_DEVICES=n
 
-# Boards:
-#
-CONFIG_S390_CCW_VIRTIO=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_S390_CCW_VIRTIO=n
.gitlab-ci.d/buildtest.yml +2 -2
index 13f505f20d7..2475262c5c8 100644
@@ -650,7 +650,7 @@ build-tci:
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
 #   mips64el, or1k, ppc, ppc64, riscv32, riscv64, rx, x86_64
-# does not build without boards: i386, loongarch64, x86_64
+# does not build without boards: i386, loongarch64, s390x, x86_64
 build-without-defaults:
   extends: .native_build_job_template
   needs:
@@ -666,7 +666,7 @@ build-without-defaults:
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
       mips-softmmu mips64-softmmu mipsel-softmmu
-      s390x-softmmu sh4-softmmu
+      sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/s390x/Kconfig +2 -0
index 26ad1044858..3bbf4ae56e4 100644
@@ -1,5 +1,7 @@
 config S390_CCW_VIRTIO
     bool
+    default y
+    depends on S390X
     imply VIRTIO_PCI
     imply TERMINAL3270
     imply VFIO_AP
Signature · 1 line
2.44.0
#21 lore raw

[PULL 46/46] qga/commands-posix: fix typo in qmp_guest_set_user_password

In reply to Paolo Bonzini

qga/commands-posix.c does not compile on FreeBSD due to a confusion between "chpasswdata" (wrong) and "chpasswddata" (used in the #else branch).

Fixes 0e5b75a390 ("qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper")
---
 qga/commands-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands-posix.c +1 -1
index 7a065c4085c..7f05996495a 100644
@@ -2173,7 +2173,7 @@ void qmp_guest_set_user_password(const char *username,
     }
 
 #ifdef __FreeBSD__
-    g_autofree char *chpasswdata = g_strdup(rawpasswddata);
+    g_autofree char *chpasswddata = g_strdup(rawpasswddata);
     const char *crypt_flag = crypted ? "-H" : "-h";
     const char *argv[] = {"pw", "usermod", "-n", username,
                           crypt_flag, "0", NULL};
Signature · 1 line
2.44.0
#22 lore raw

[PULL 24/46] sparc: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with SPARC and SPARC64.

No changes to generated config-devices.mak file.

---
 configs/devices/sparc-softmmu/default.mak   | 7 +++----
 configs/devices/sparc64-softmmu/default.mak | 7 +++----
 .gitlab-ci.d/buildtest.yml                  | 5 +++--
 hw/sparc/Kconfig                            | 4 ++++
 hw/sparc64/Kconfig                          | 4 ++++
 5 files changed, 17 insertions(+), 10 deletions(-)
configs/devices/sparc-softmmu/default.mak +3 -4
index ee852181151..87668fda5ea 100644
@@ -5,7 +5,6 @@
 #CONFIG_TCX=n
 #CONFIG_CG3=n
 
-# Boards:
-#
-CONFIG_SUN4M=y
-CONFIG_LEON3=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_SUN4M=n
+# CONFIG_LEON3=n
configs/devices/sparc64-softmmu/default.mak +3 -4
index e50030a229c..fa82f39a200 100644
@@ -6,7 +6,6 @@
 #CONFIG_SUNHME=n
 #CONFIG_TEST_DEVICES=n
 
-# Boards:
-#
-CONFIG_SUN4U=y
-CONFIG_NIAGARA=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_SUN4U=n
+# CONFIG_NIAGARA=n
.gitlab-ci.d/buildtest.yml +3 -2
index fd665931847..5d2ce161187 100644
@@ -665,8 +665,9 @@ build-without-defaults:
       --disable-qom-cast-debug
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
-      mips-softmmu mips64-softmmu mipsel-softmmu
-      sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
+      mips-softmmu mips64-softmmu mipsel-softmmu sparc-softmmu
+      sparc64-softmmu
+      hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
 build-libvhost-user:
hw/sparc/Kconfig +4 -0
index 79d58beb7a6..3cc165dbfb7 100644
@@ -1,5 +1,7 @@
 config SUN4M
     bool
+    default y
+    depends on SPARC && !SPARC64
     imply TCX
     imply CG3
     select CS4231
@@ -18,6 +20,8 @@ config SUN4M
 
 config LEON3
     bool
+    default y
+    depends on SPARC && !SPARC64
     select GRLIB
 
 config GRLIB
hw/sparc64/Kconfig +4 -0
index 7e557ad17b0..3b948a22907 100644
@@ -1,5 +1,7 @@
 config SUN4U
     bool
+    default y
+    depends on SPARC64
     imply PCI_DEVICES
     imply SUNHME
     imply TEST_DEVICES
@@ -16,6 +18,8 @@ config SUN4U
 
 config NIAGARA
     bool
+    default y
+    depends on SPARC64
     select EMPTY_SLOT
     select SUN4V_RTC
     select UNIMP
Signature · 1 line
2.44.0
#23 lore raw

[PULL 45/46] migration: do not include coroutine_int.h

In reply to Paolo Bonzini

Migration code needs no private fields of the coroutine backend. Include the "regular" coroutine.h header.

---
 migration/migration.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.h +1 -1
index 8045e39c26f..6c612c03819 100644
@@ -19,7 +19,7 @@
 #include "qapi/qapi-types-migration.h"
 #include "qapi/qmp/json-writer.h"
 #include "qemu/thread.h"
-#include "qemu/coroutine_int.h"
+#include "qemu/coroutine.h"
 #include "io/channel.h"
 #include "io/channel-buffer.h"
 #include "net/announce.h"
Signature · 1 line
2.44.0
#24 lore raw

[PULL 20/46] riscv: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with RISC-V.

No changes to generated config-devices.mak file.

---
 configs/devices/riscv32-softmmu/default.mak | 13 ++++++-------
 configs/devices/riscv64-softmmu/default.mak | 15 +++++++--------
 .gitlab-ci.d/buildtest.yml                  |  2 +-
 hw/riscv/Kconfig                            | 14 ++++++++++++++
 4 files changed, 28 insertions(+), 16 deletions(-)
configs/devices/riscv32-softmmu/default.mak +6 -7
index 07e4fd26df3..c2cd86ce05f 100644
@@ -4,10 +4,9 @@
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
-# Boards:
-#
-CONFIG_SPIKE=y
-CONFIG_SIFIVE_E=y
-CONFIG_SIFIVE_U=y
-CONFIG_RISCV_VIRT=y
-CONFIG_OPENTITAN=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_SPIKE=n
+# CONFIG_SIFIVE_E=n
+# CONFIG_SIFIVE_U=n
+# CONFIG_RISCV_VIRT=n
+# CONFIG_OPENTITAN=n
configs/devices/riscv64-softmmu/default.mak +7 -8
index 221963d4c5c..39ed3a0061a 100644
@@ -4,11 +4,10 @@
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
-# Boards:
-#
-CONFIG_SPIKE=y
-CONFIG_SIFIVE_E=y
-CONFIG_SIFIVE_U=y
-CONFIG_RISCV_VIRT=y
-CONFIG_MICROCHIP_PFSOC=y
-CONFIG_SHAKTI_C=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_SPIKE=n
+# CONFIG_SIFIVE_E=n
+# CONFIG_SIFIVE_U=n
+# CONFIG_RISCV_VIRT=n
+# CONFIG_MICROCHIP_PFSOC=n
+# CONFIG_SHAKTI_C=n
.gitlab-ci.d/buildtest.yml +1 -1
index a5f4b4d3793..a65b5fc9560 100644
@@ -649,7 +649,7 @@ build-tci:
 
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
-#   mips64el, or1k, ppc, ppc64, x86_64
+#   mips64el, or1k, ppc, ppc64, riscv32, riscv64, x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
hw/riscv/Kconfig +14 -0
index fc72ef03799..5f5f9e31bb0 100644
@@ -8,6 +8,8 @@ config IBEX
 
 config MICROCHIP_PFSOC
     bool
+    default y
+    depends on RISCV64
     select CADENCE_SDHCI
     select CPU_CLUSTER
     select MCHP_PFSOC_DMC
@@ -21,12 +23,16 @@ config MICROCHIP_PFSOC
 
 config OPENTITAN
     bool
+    default y
+    depends on RISCV32
     select IBEX
     select SIFIVE_PLIC
     select UNIMP
 
 config RISCV_VIRT
     bool
+    default y
+    depends on RISCV32 || RISCV64
     imply PCI_DEVICES
     imply VIRTIO_VGA
     imply TEST_DEVICES
@@ -51,6 +57,8 @@ config RISCV_VIRT
 
 config SHAKTI_C
     bool
+    default y
+    depends on RISCV64
     select RISCV_ACLINT
     select SHAKTI_UART
     select SIFIVE_PLIC
@@ -58,6 +66,8 @@ config SHAKTI_C
 
 config SIFIVE_E
     bool
+    default y
+    depends on RISCV32 || RISCV64
     select RISCV_ACLINT
     select SIFIVE_GPIO
     select SIFIVE_PLIC
@@ -68,6 +78,8 @@ config SIFIVE_E
 
 config SIFIVE_U
     bool
+    default y
+    depends on RISCV32 || RISCV64
     select CADENCE
     select CPU_CLUSTER
     select RISCV_ACLINT
@@ -85,6 +97,8 @@ config SIFIVE_U
 
 config SPIKE
     bool
+    default y
+    depends on RISCV32 || RISCV64
     select RISCV_NUMA
     select HTIF
     select RISCV_ACLINT
Signature · 1 line
2.44.0
#25 lore raw

[PULL 16/46] meson: make target endianneess available to Kconfig

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. MIPS boards may only be available for big-endian or only for little-endian emulators, add a symbol so that this can be described with a "depends on" clause.

---
 meson.build    | 12 +++++++-----
 target/Kconfig |  3 +++
 2 files changed, 10 insertions(+), 5 deletions(-)
meson.build +7 -5
index 5db2dbc12ec..43da4923721 100644
@@ -3005,7 +3005,7 @@ foreach target : target_dirs
     }
   endif
 
-  accel_kconfig = []
+  target_kconfig = []
   foreach sym: accelerators
     if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
       config_target += { sym: 'y' }
@@ -3015,10 +3015,10 @@ foreach target : target_dirs
       else
         config_target += { 'CONFIG_TCG_BUILTIN': 'y' }
       endif
-      accel_kconfig += [ sym + '=y' ]
+      target_kconfig += [ sym + '=y' ]
     endif
   endforeach
-  if accel_kconfig.length() == 0
+  if target_kconfig.length() == 0
     if default_targets
       continue
     endif
@@ -3078,6 +3078,9 @@ foreach target : target_dirs
                                                configuration: config_target_data)}
 
   if target.endswith('-softmmu')
+    target_kconfig += 'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'
+    target_kconfig += 'CONFIG_TARGET_BIG_ENDIAN=' + config_target['TARGET_BIG_ENDIAN']
+
     config_input = meson.get_external_property(target, 'default')
     config_devices_mak = target + '-config-devices.mak'
     config_devices_mak = configure_file(
@@ -3088,8 +3091,7 @@ foreach target : target_dirs
       command: [minikconf,
                 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
                 config_devices_mak, '@DEPFILE@', '@INPUT@',
-                host_kconfig, accel_kconfig,
-                'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
+                host_kconfig, target_kconfig])
 
     config_devices_data = configuration_data()
     config_devices = keyval.load(config_devices_mak)
target/Kconfig +3 -0
index 5275a93ad02..7f64112e9e7 100644
@@ -17,3 +17,6 @@ source sh4/Kconfig
 source sparc/Kconfig
 source tricore/Kconfig
 source xtensa/Kconfig
+
+config TARGET_BIG_ENDIAN
+    bool
Signature · 1 line
2.44.0
#26 lore raw

[PULL 17/46] mips: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with MIPS.

No changes to generated config-devices.mak file.

---
 configs/devices/mips-softmmu/common.mak      |  5 +++--
 configs/devices/mips64-softmmu/default.mak   |  4 +++-
 configs/devices/mips64el-softmmu/default.mak | 10 ++++++----
 .gitlab-ci.d/buildtest.yml                   |  3 ++-
 hw/mips/Kconfig                              | 12 ++++++++++++
 5 files changed, 26 insertions(+), 8 deletions(-)
configs/devices/mips-softmmu/common.mak +3 -2
index 416a5d353e8..b50107feafe 100644
@@ -4,5 +4,6 @@
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
-CONFIG_MALTA=y
-CONFIG_MIPSSIM=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_MALTA=n
+# CONFIG_MIPSSIM=n
configs/devices/mips64-softmmu/default.mak +3 -1
index 566672f3c22..1b8d7ced1c6 100644
@@ -1,4 +1,6 @@
 # Default configuration for mips64-softmmu
 
 include ../mips-softmmu/common.mak
-CONFIG_JAZZ=y
+
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_JAZZ=n
configs/devices/mips64el-softmmu/default.mak +6 -4
index 88a37cf27f1..9dce346c4fb 100644
@@ -1,7 +1,9 @@
 # Default configuration for mips64el-softmmu
 
 include ../mips-softmmu/common.mak
-CONFIG_FULOONG=y
-CONFIG_LOONGSON3V=y
-CONFIG_JAZZ=y
-CONFIG_MIPS_BOSTON=y
+
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_FULOONG=n
+# CONFIG_LOONGSON3V=n
+# CONFIG_JAZZ=n
+# CONFIG_MIPS_BOSTON=n
.gitlab-ci.d/buildtest.yml +2 -1
index e2e92f25c58..811132443a7 100644
@@ -649,7 +649,7 @@ build-tci:
 
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
-#   x86_64
+#   mips64el, x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
@@ -665,6 +665,7 @@ build-without-defaults:
       --disable-qom-cast-debug
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
+      mips-softmmu mips64-softmmu mipsel-softmmu
       s390x-softmmu sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
hw/mips/Kconfig +12 -0
index 5c83ef49cf6..9bccb363eb9 100644
@@ -1,5 +1,7 @@
 config MALTA
     bool
+    default y
+    depends on MIPS
     imply PCNET_PCI
     imply PCI_DEVICES
     imply TEST_DEVICES
@@ -13,11 +15,15 @@ config MALTA
 
 config MIPSSIM
     bool
+    default y
+    depends on MIPS
     select SERIAL
     select MIPSNET
 
 config JAZZ
     bool
+    default y
+    depends on MIPS64
     select ISA_BUS
     select RC4030
     select I8259
@@ -38,6 +44,8 @@ config JAZZ
 
 config FULOONG
     bool
+    default y
+    depends on MIPS64 && !TARGET_BIG_ENDIAN
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply ATI_VGA
@@ -48,6 +56,8 @@ config FULOONG
 
 config LOONGSON3V
     bool
+    default y
+    depends on MIPS64 && !TARGET_BIG_ENDIAN
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply VIRTIO_PCI
@@ -69,6 +79,8 @@ config MIPS_CPS
 
 config MIPS_BOSTON
     bool
+    default y
+    depends on MIPS64 && !TARGET_BIG_ENDIAN
     imply PCI_DEVICES
     imply TEST_DEVICES
     select FITLOADER
Signature · 1 line
2.44.0
#27 lore raw

[PULL 25/46] tricore: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with TriCore.

No changes to generated config-devices.mak file.

---
 configs/devices/tricore-softmmu/default.mak | 7 +++++--
 .gitlab-ci.d/buildtest.yml                  | 2 +-
 hw/tricore/Kconfig                          | 4 ++++
 3 files changed, 10 insertions(+), 3 deletions(-)
configs/devices/tricore-softmmu/default.mak +5 -2
index cb8fc286eb2..c7ab542244b 100644
@@ -1,2 +1,5 @@
-CONFIG_TRICORE_TESTBOARD=y
-CONFIG_TRIBOARD=y
+# Default configuration for tricore-softmmu
+
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_TRICORE_TESTBOARD=n
+# CONFIG_TRIBOARD=n
.gitlab-ci.d/buildtest.yml +1 -1
index 5d2ce161187..bdd4dc49b17 100644
@@ -666,7 +666,7 @@ build-without-defaults:
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
       mips-softmmu mips64-softmmu mipsel-softmmu sparc-softmmu
-      sparc64-softmmu
+      sparc64-softmmu tricore-softmmu
       hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/tricore/Kconfig +4 -0
index 33c1e852c33..6c04f64949d 100644
@@ -1,8 +1,12 @@
 config TRICORE_TESTBOARD
+    default y
+    depends on TRICORE
     bool
 
 config TRIBOARD
     bool
+    default y
+    depends on TRICORE
     select TC27X_SOC
 
 config TC27X_SOC
Signature · 1 line
2.44.0
#28 lore raw

[PULL 38/46] migration: remove PostcopyDiscardState from typedefs.h

In reply to Paolo Bonzini

It is defined and referred to exclusively from a .c file.

---
 include/qemu/typedefs.h  | 1 -
 migration/postcopy-ram.c | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
include/qemu/typedefs.h +0 -1
index ab24ca2876c..2b1948a19ac 100644
@@ -96,7 +96,6 @@ typedef struct PCIExpressDevice PCIExpressDevice;
 typedef struct PCIExpressHost PCIExpressHost;
 typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
-typedef struct PostcopyDiscardState PostcopyDiscardState;
 typedef struct Property Property;
 typedef struct PropertyInfo PropertyInfo;
 typedef struct QBool QBool;
migration/postcopy-ram.c +2 -2
index eccff499cb2..34197795482 100644
@@ -44,7 +44,7 @@
  */
 #define MAX_DISCARDS_PER_COMMAND 12
 
-struct PostcopyDiscardState {
+typedef struct PostcopyDiscardState {
     const char *ramblock_name;
     uint16_t cur_entry;
     /*
@@ -54,7 +54,7 @@ struct PostcopyDiscardState {
     uint64_t length_list[MAX_DISCARDS_PER_COMMAND];
     unsigned int nsentwords;
     unsigned int nsentcmds;
-};
+} PostcopyDiscardState;
 
 static NotifierWithReturnList postcopy_notifier_list;
 
Signature · 1 line
2.44.0
#29 lore raw

[PULL 41/46] display: remove GraphicHwOps from typedefs.h

In reply to Paolo Bonzini

Basically all uses of GraphicHwOps are defining an instance of it, which requires the full definition of the struct. It is pointless to have it in typedefs.h.

---
 hw/display/vga_int.h    | 1 +
 include/qemu/typedefs.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/display/vga_int.h +1 -0
index 876a1d3697b..f77c1c11457 100644
@@ -25,6 +25,7 @@
 #ifndef HW_VGA_INT_H
 #define HW_VGA_INT_H
 
+#include "ui/console.h"
 #include "exec/ioport.h"
 #include "exec/memory.h"
 
include/qemu/typedefs.h +0 -1
index 78598f27f32..7e3597e94c5 100644
@@ -53,7 +53,6 @@ typedef struct Error Error;
 typedef struct EventNotifier EventNotifier;
 typedef struct FlatView FlatView;
 typedef struct FWCfgState FWCfgState;
-typedef struct GraphicHwOps GraphicHwOps;
 typedef struct HostMemoryBackend HostMemoryBackend;
 typedef struct I2CBus I2CBus;
 typedef struct I2SCodec I2SCodec;
Signature · 1 line
2.44.0
#30 lore raw

[PULL 26/46] xtensa: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Xtensa.

No changes to generated config-devices.mak file.

---
 configs/devices/xtensa-softmmu/default.mak | 9 ++++-----
 .gitlab-ci.d/buildtest.yml                 | 2 +-
 hw/xtensa/Kconfig                          | 6 ++++++
 3 files changed, 11 insertions(+), 6 deletions(-)
configs/devices/xtensa-softmmu/default.mak +4 -5
index f650cad7609..fbc3079a943 100644
@@ -4,8 +4,7 @@
 #
 #CONFIG_PCI_DEVICES=n
 
-# Boards:
-#
-CONFIG_XTENSA_SIM=y
-CONFIG_XTENSA_VIRT=y
-CONFIG_XTENSA_XTFPGA=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_XTENSA_SIM=n
+# CONFIG_XTENSA_VIRT=n
+# CONFIG_XTENSA_XTFPGA=n
.gitlab-ci.d/buildtest.yml +1 -1
index bdd4dc49b17..e9402a68a79 100644
@@ -666,7 +666,7 @@ build-without-defaults:
       --disable-strip
     TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
       mips-softmmu mips64-softmmu mipsel-softmmu sparc-softmmu
-      sparc64-softmmu tricore-softmmu
+      sparc64-softmmu tricore-softmmu xtensa-softmmu xtensaeb-softmmu
       hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/xtensa/Kconfig +6 -0
index 0740657ea58..443b415c2ba 100644
@@ -1,14 +1,20 @@
 config XTENSA_SIM
+    default y
+    depends on XTENSA
     bool
 
 config XTENSA_VIRT
     bool
+    default y
+    depends on XTENSA
     select XTENSA_SIM
     select PCI_EXPRESS_GENERIC_BRIDGE
     select PCI_DEVICES
 
 config XTENSA_XTFPGA
     bool
+    default y
+    depends on XTENSA
     select OPENCORES_ETH
     select PFLASH_CFI01
     select SERIAL
Signature · 1 line
2.44.0
#31 lore raw

[PULL 21/46] rx: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with RX.

No changes to generated config-devices.mak file.

---
 configs/devices/rx-softmmu/default.mak | 3 ++-
 .gitlab-ci.d/buildtest.yml             | 2 +-
 hw/rx/Kconfig                          | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)
configs/devices/rx-softmmu/default.mak +2 -1
index df2b4e4f426..e7caebe1974 100644
@@ -1,3 +1,4 @@
 # Default configuration for rx-softmmu
 
-CONFIG_RX_GDBSIM=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_RX_GDBSIM=n
.gitlab-ci.d/buildtest.yml +1 -1
index a65b5fc9560..13f505f20d7 100644
@@ -649,7 +649,7 @@ build-tci:
 
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
-#   mips64el, or1k, ppc, ppc64, riscv32, riscv64, x86_64
+#   mips64el, or1k, ppc, ppc64, riscv32, riscv64, rx, x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
hw/rx/Kconfig +2 -0
index 2b297c5a6a6..b2fa2b7eec3 100644
@@ -7,4 +7,6 @@ config RX62N_MCU
 
 config RX_GDBSIM
     bool
+    default y
+    depends on RX
     select RX62N_MCU
Signature · 1 line
2.44.0
#32 lore raw

[PULL 07/46] alpha: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Start with Alpha.

No changes to generated config-devices.mak file.

---
 configs/devices/alpha-softmmu/default.mak | 5 ++---
 .gitlab-ci.d/buildtest.yml                | 2 +-
 hw/alpha/Kconfig                          | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)
configs/devices/alpha-softmmu/default.mak +2 -3
index d186fe8e9b1..3de6a9f5779 100644
@@ -5,6 +5,5 @@
 #CONFIG_PCI_DEVICES=n
 #CONFIG_TEST_DEVICES=n
 
-# Boards:
-#
-CONFIG_DP264=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_DP264=n
.gitlab-ci.d/buildtest.yml +1 -1
index 6394b8f41e4..c6c9c242c5c 100644
@@ -661,7 +661,7 @@ build-without-defaults:
       --disable-pie
       --disable-qom-cast-debug
       --disable-strip
-    TARGETS: avr-softmmu s390x-softmmu sh4-softmmu
+    TARGETS: alpha-softmmu avr-softmmu s390x-softmmu sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
 
hw/alpha/Kconfig +2 -0
index 9af650c94ec..7f3455ce1e1 100644
@@ -1,5 +1,7 @@
 config DP264
     bool
+    default y
+    depends on ALPHA
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply E1000_PCI
Signature · 1 line
2.44.0
#33 lore raw

[PULL 42/46] tcg: remove CPU* types from typedefs.h

In reply to Paolo Bonzini

hw/core/cpu.h is already using struct forward declarations in some cases to avoid inclusions, and otherwise CPUAddressSpace and CPUJumpCache are only used together with their definition. CPUTLBEntryFull is always used when their definition is available. Remove all three from typedefs.h.

---
 accel/tcg/tb-jmp-cache.h |  4 ++--
 include/hw/core/cpu.h    | 10 ++++++++--
 include/qemu/typedefs.h  |  3 ---
 system/physmem.c         |  4 ++--
 4 files changed, 12 insertions(+), 9 deletions(-)
accel/tcg/tb-jmp-cache.h +2 -2
index 184bb3e3e2e..c3a505e394a 100644
@@ -22,12 +22,12 @@
  * non-NULL value of 'tb'.  Strictly speaking pc is only needed for
  * CF_PCREL, but it's used always for simplicity.
  */
-struct CPUJumpCache {
+typedef struct CPUJumpCache {
     struct rcu_head rcu;
     struct {
         TranslationBlock *tb;
         vaddr pc;
     } array[TB_JMP_CACHE_SIZE];
-};
+} CPUJumpCache;
 
 #endif /* ACCEL_TCG_TB_JMP_CACHE_H */
include/hw/core/cpu.h +8 -2
index a23d39f6a0c..1382a986158 100644
@@ -85,6 +85,12 @@ DECLARE_CLASS_CHECKERS(CPUClass, CPU,
 
 typedef struct CPUWatchpoint CPUWatchpoint;
 
+/* see physmem.c */
+struct CPUAddressSpace;
+
+/* see accel/tcg/tb-jmp-cache.h */
+struct CPUJumpCache;
+
 /* see accel-cpu.h */
 struct AccelCPUClass;
 
@@ -473,12 +479,12 @@ struct CPUState {
     QemuMutex work_mutex;
     QSIMPLEQ_HEAD(, qemu_work_item) work_list;
 
-    CPUAddressSpace *cpu_ases;
+    struct CPUAddressSpace *cpu_ases;
     int num_ases;
     AddressSpace *as;
     MemoryRegion *memory;
 
-    CPUJumpCache *tb_jmp_cache;
+    struct CPUJumpCache *tb_jmp_cache;
 
     GArray *gdb_regs;
     int gdb_num_regs;
include/qemu/typedefs.h +0 -3
index 7e3597e94c5..d23020ed232 100644
@@ -38,12 +38,9 @@ typedef struct BusState BusState;
 typedef struct Chardev Chardev;
 typedef struct Clock Clock;
 typedef struct ConfidentialGuestSupport ConfidentialGuestSupport;
-typedef struct CPUAddressSpace CPUAddressSpace;
 typedef struct CPUArchState CPUArchState;
 typedef struct CPUPluginState CPUPluginState;
-typedef struct CPUJumpCache CPUJumpCache;
 typedef struct CPUState CPUState;
-typedef struct CPUTLBEntryFull CPUTLBEntryFull;
 typedef struct DeviceState DeviceState;
 typedef struct DirtyBitmapSnapshot DirtyBitmapSnapshot;
 typedef struct DisplayChangeListener DisplayChangeListener;
system/physmem.c +2 -2
index 1a81c226bae..6dc58b34bbb 100644
@@ -158,12 +158,12 @@ static void tcg_commit(MemoryListener *listener);
  * @memory_dispatch: its dispatch pointer (cached, RCU protected)
  * @tcg_as_listener: listener for tracking changes to the AddressSpace
  */
-struct CPUAddressSpace {
+typedef struct CPUAddressSpace {
     CPUState *cpu;
     AddressSpace *as;
     struct AddressSpaceDispatch *memory_dispatch;
     MemoryListener tcg_as_listener;
-};
+} CPUAddressSpace;
 
 struct DirtyBitmapSnapshot {
     ram_addr_t start;
Signature · 1 line
2.44.0
#34 lore raw

[PULL 43/46] pci: remove some types from typedefs.h

In reply to Paolo Bonzini

For types that are embedded in structs defined by pci.h, the definition is pretty much required to be available. Remove them from typedefs.h.

---
 include/hw/pci/pcie.h       |  3 +++
 include/hw/pci/pcie_aer.h   | 38 ++++++++++++++++++-------------------
 include/hw/pci/pcie_sriov.h |  8 ++++----
 include/qemu/typedefs.h     |  5 -----
 4 files changed, 26 insertions(+), 28 deletions(-)
include/hw/pci/pcie.h +3 -0
index 11f5a91bbb7..5eddb909769 100644
@@ -27,6 +27,9 @@
 #include "hw/pci/pcie_sriov.h"
 #include "hw/hotplug.h"
 
+typedef struct PCIEPort PCIEPort;
+typedef struct PCIESlot PCIESlot;
+
 typedef enum {
     /* these bits must match the bits in Slot Control/Status registers.
      * PCI_EXP_HP_EV_xxx = PCI_EXP_SLTCTL_xxxE = PCI_EXP_SLTSTA_xxx
include/hw/pci/pcie_aer.h +19 -19
index 4a9f0ea69dc..4d8c0e05077 100644
@@ -25,8 +25,23 @@
 
 /* definitions which PCIExpressDevice uses */
 
+/* error */
+typedef struct PCIEAERErr {
+    uint32_t status;    /* error status bits */
+    uint16_t source_id; /* bdf */
+
+#define PCIE_AER_ERR_IS_CORRECTABLE     0x1     /* correctable/uncorrectable */
+#define PCIE_AER_ERR_MAYBE_ADVISORY     0x2     /* maybe advisory non-fatal */
+#define PCIE_AER_ERR_HEADER_VALID       0x4     /* TLP header is logged */
+#define PCIE_AER_ERR_TLP_PREFIX_PRESENT 0x8     /* TLP Prefix is logged */
+    uint16_t flags;
+
+    uint32_t header[4]; /* TLP header */
+    uint32_t prefix[4]; /* TLP header prefix */
+} PCIEAERErr;
+
 /* AER log */
-struct PCIEAERLog {
+typedef struct PCIEAERLog {
     /* This structure is saved/loaded.
        So explicitly size them instead of unsigned int */
 
@@ -48,11 +63,11 @@ struct PCIEAERLog {
 
     /* Error log. log_max-sized array */
     PCIEAERErr *log;
-};
+} PCIEAERLog;
 
 /* aer error message: error signaling message has only error severity and
    source id. See 2.2.8.3 error signaling messages */
-struct PCIEAERMsg {
+typedef struct PCIEAERMsg {
     /*
      * PCI_ERR_ROOT_CMD_{COR, NONFATAL, FATAL}_EN
      * = PCI_EXP_DEVCTL_{CERE, NFERE, FERE}
@@ -60,7 +75,7 @@ struct PCIEAERMsg {
     uint32_t severity;
 
     uint16_t source_id; /* bdf */
-};
+} PCIEAERMsg;
 
 static inline bool
 pcie_aer_msg_is_uncor(const PCIEAERMsg *msg)
@@ -69,21 +84,6 @@ pcie_aer_msg_is_uncor(const PCIEAERMsg *msg)
         msg->severity == PCI_ERR_ROOT_CMD_FATAL_EN;
 }
 
-/* error */
-struct PCIEAERErr {
-    uint32_t status;    /* error status bits */
-    uint16_t source_id; /* bdf */
-
-#define PCIE_AER_ERR_IS_CORRECTABLE     0x1     /* correctable/uncorrectable */
-#define PCIE_AER_ERR_MAYBE_ADVISORY     0x2     /* maybe advisory non-fatal */
-#define PCIE_AER_ERR_HEADER_VALID       0x4     /* TLP header is logged */
-#define PCIE_AER_ERR_TLP_PREFIX_PRESENT 0x8     /* TLP Prefix is logged */
-    uint16_t flags;
-
-    uint32_t header[4]; /* TLP header */
-    uint32_t prefix[4]; /* TLP header prefix */
-};
-
 extern const VMStateDescription vmstate_pcie_aer_log;
 
 int pcie_aer_init(PCIDevice *dev, uint8_t cap_ver, uint16_t offset,
include/hw/pci/pcie_sriov.h +4 -4
index b77eb7bf58a..450cbef6c20 100644
@@ -15,17 +15,17 @@
 
 #include "hw/pci/pci.h"
 
-struct PCIESriovPF {
+typedef struct PCIESriovPF {
     uint16_t num_vfs;   /* Number of virtual functions created */
     uint8_t vf_bar_type[PCI_NUM_REGIONS];   /* Store type for each VF bar */
     const char *vfname; /* Reference to the device type used for the VFs */
     PCIDevice **vf;     /* Pointer to an array of num_vfs VF devices */
-};
+} PCIESriovPF;
 
-struct PCIESriovVF {
+typedef struct PCIESriovVF {
     PCIDevice *pf;      /* Pointer back to owner physical function */
     uint16_t vf_number; /* Logical VF number of this function */
-};
+} PCIESriovVF;
 
 void pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset,
                         const char *vfname, uint16_t vf_dev_id,
include/qemu/typedefs.h +0 -5
index d23020ed232..5d999e20d7c 100644
@@ -78,13 +78,8 @@ typedef struct ObjectClass ObjectClass;
 typedef struct PCIBridge PCIBridge;
 typedef struct PCIBus PCIBus;
 typedef struct PCIDevice PCIDevice;
-typedef struct PCIEAERErr PCIEAERErr;
-typedef struct PCIEAERLog PCIEAERLog;
-typedef struct PCIEAERMsg PCIEAERMsg;
 typedef struct PCIEPort PCIEPort;
 typedef struct PCIESlot PCIESlot;
-typedef struct PCIESriovPF PCIESriovPF;
-typedef struct PCIESriovVF PCIESriovVF;
 typedef struct PCIExpressDevice PCIExpressDevice;
 typedef struct PCIExpressHost PCIExpressHost;
 typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
Signature · 1 line
2.44.0
#35 lore raw

[PULL 36/46] intc: remove PICCommonState from typedefs.h

In reply to Paolo Bonzini

Move it to the existing "PIC related things" header, hw/intc/i8259.h.

---
 include/hw/intc/i8259.h | 2 ++
 include/qemu/typedefs.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
include/hw/intc/i8259.h +2 -0
index c4125757753..1f2420231f1 100644
@@ -3,6 +3,8 @@
 
 /* i8259.c */
 
+typedef struct PICCommonState PICCommonState;
+
 extern PICCommonState *isa_pic;
 
 /*
include/qemu/typedefs.h +0 -1
index 4519f0cd613..090e219248a 100644
@@ -96,7 +96,6 @@ typedef struct PCIExpressDevice PCIExpressDevice;
 typedef struct PCIExpressHost PCIExpressHost;
 typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
-typedef struct PICCommonState PICCommonState;
 typedef struct PostcopyDiscardState PostcopyDiscardState;
 typedef struct Property Property;
 typedef struct PropertyInfo PropertyInfo;
Signature · 1 line
2.44.0
#36 lore raw

[PULL 06/46] configs: list "implied" device groups in the default configs

In reply to Paolo Bonzini

Match the optional device groups to what is actually included in the config-devices.mak files.

---
 configs/devices/arm-softmmu/default.mak         | 2 ++
 configs/devices/loongarch64-softmmu/default.mak | 3 +++
 configs/devices/or1k-softmmu/default.mak        | 4 ++++
 configs/devices/ppc-softmmu/default.mak         | 4 ++++
 configs/devices/riscv32-softmmu/default.mak     | 4 ++--
 configs/devices/riscv64-softmmu/default.mak     | 4 ++--
 configs/devices/xtensa-softmmu/default.mak      | 4 ++++
 7 files changed, 21 insertions(+), 4 deletions(-)
configs/devices/arm-softmmu/default.mak +2 -0
index 6ee31bc1ab9..c1cfb3bcf75 100644
@@ -1,5 +1,7 @@
 # Default configuration for arm-softmmu
 
+# Uncomment the following lines to disable these optional devices:
+# CONFIG_I2C_DEVICES=n
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
configs/devices/loongarch64-softmmu/default.mak +3 -0
index 928bc117ef7..0893112b81d 100644
@@ -1,3 +1,6 @@
 # Default configuration for loongarch64-softmmu
 
+# Uncomment the following lines to disable these optional devices:
+# CONFIG_PCI_DEVICES=n
+
 CONFIG_LOONGARCH_VIRT=y
configs/devices/or1k-softmmu/default.mak +4 -0
index 89c39e31237..3aecdf9d738 100644
@@ -1,5 +1,9 @@
 # Default configuration for or1k-softmmu
 
+# Uncomment the following lines to disable these optional devices:
+# CONFIG_PCI_DEVICES=n
+# CONFIG_TEST_DEVICES=n
+
 # Boards:
 #
 CONFIG_OR1K_SIM=y
configs/devices/ppc-softmmu/default.mak +4 -0
index b85fd2bcd71..3061b26749a 100644
@@ -1,5 +1,9 @@
 # Default configuration for ppc-softmmu
 
+# Uncomment the following lines to disable these optional devices:
+# CONFIG_PCI_DEVICES=n
+# CONFIG_TEST_DEVICES=n
+
 # For embedded PPCs:
 CONFIG_E500PLAT=y
 CONFIG_MPC8544DS=y
configs/devices/riscv32-softmmu/default.mak +2 -2
index 94a236c9c25..07e4fd26df3 100644
@@ -1,8 +1,8 @@
 # Default configuration for riscv32-softmmu
 
 # Uncomment the following lines to disable these optional devices:
-#
-#CONFIG_PCI_DEVICES=n
+# CONFIG_PCI_DEVICES=n
+# CONFIG_TEST_DEVICES=n
 
 # Boards:
 #
configs/devices/riscv64-softmmu/default.mak +2 -2
index 3f680594484..221963d4c5c 100644
@@ -1,8 +1,8 @@
 # Default configuration for riscv64-softmmu
 
 # Uncomment the following lines to disable these optional devices:
-#
-#CONFIG_PCI_DEVICES=n
+# CONFIG_PCI_DEVICES=n
+# CONFIG_TEST_DEVICES=n
 
 # Boards:
 #
configs/devices/xtensa-softmmu/default.mak +4 -0
index 49e4c9da88c..f650cad7609 100644
@@ -1,5 +1,9 @@
 # Default configuration for Xtensa
 
+# Uncomment the following lines to disable these optional devices:
+#
+#CONFIG_PCI_DEVICES=n
+
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
Signature · 1 line
2.44.0
#37 lore raw

[PULL 27/46] docs: document new convention for Kconfig board symbols

In reply to Paolo Bonzini

Boards have been switched to use "default y" and are now listed in default-configs/*.mak only for convenience.

Document this change and the new possibilities that it allows.

---
 docs/devel/kconfig.rst | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
docs/devel/kconfig.rst +12 -2
index ccb9a46bd77..52d4b905f67 100644
@@ -211,6 +211,8 @@ declares its dependencies in different ways:
 
     config SUN4M
       bool
+      default y
+      depends on SPARC && !SPARC64
       imply TCX
       imply CG3
       select CS4231
@@ -228,8 +230,16 @@ declares its dependencies in different ways:
   directives.  A device should be listed under ``select`` if the board
   cannot be started at all without it.  It should be listed under
   ``imply`` if (depending on the QEMU command line) the board may or
-  may not be started without it.  Boards also default to false; they are
-  enabled by the ``default-configs/*.mak`` for the target they apply to.
+  may not be started without it.  Boards default to true, but also
+  have a ``depends on`` clause to limit them to the appropriate targets.
+  For some targets, not all boards may be supported by hardware
+  virtualization, in which case they also depend on the ``TCG`` symbol,
+  Other symbols that are commonly used as dependencies for boards
+  include libraries (such as ``FDT``) or ``TARGET_BIG_ENDIAN``
+  (possibly negated).
+
+  Boards are listed for convenience in the ``default-configs/*.mak``
+  for the target they apply to.
 
 **internal elements**
 
Signature · 1 line
2.44.0
#38 lore raw

[PULL 32/46] qdev-core: remove DeviceListener from typedefs.h

In reply to Paolo Bonzini

It is needed in very few places, which already depend on other parts of qdev-core.h files. The benefit of having it in typedefs.h is small.

---
 include/hw/qdev-core.h  | 1 +
 include/qemu/typedefs.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
include/hw/qdev-core.h +1 -0
index 9228e96c87e..5336728a23f 100644
@@ -294,6 +294,7 @@ struct DeviceState {
     MemReentrancyGuard mem_reentrancy_guard;
 };
 
+typedef struct DeviceListener DeviceListener;
 struct DeviceListener {
     void (*realize)(DeviceListener *listener, DeviceState *dev);
     void (*unrealize)(DeviceListener *listener, DeviceState *dev);
include/qemu/typedefs.h +0 -1
index 949d3e1daf9..66f0b146c8c 100644
@@ -47,7 +47,6 @@ typedef struct CpuInfoFast CpuInfoFast;
 typedef struct CPUJumpCache CPUJumpCache;
 typedef struct CPUState CPUState;
 typedef struct CPUTLBEntryFull CPUTLBEntryFull;
-typedef struct DeviceListener DeviceListener;
 typedef struct DeviceState DeviceState;
 typedef struct DirtyBitmapSnapshot DirtyBitmapSnapshot;
 typedef struct DisplayChangeListener DisplayChangeListener;
Signature · 1 line
2.44.0
#39 lore raw

[PULL 18/46] openrisc: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with OpenRISC.

No changes to generated config-devices.mak file.

---
 configs/devices/or1k-softmmu/default.mak | 5 ++---
 .gitlab-ci.d/buildtest.yml               | 2 +-
 hw/openrisc/Kconfig                      | 4 ++++
 3 files changed, 7 insertions(+), 4 deletions(-)
configs/devices/or1k-softmmu/default.mak +2 -3
index 3aecdf9d738..efe3bc278bc 100644
@@ -5,6 +5,5 @@
 # CONFIG_TEST_DEVICES=n
 
 # Boards:
-#
-CONFIG_OR1K_SIM=y
-CONFIG_OR1K_VIRT=y
+# CONFIG_OR1K_SIM=n
+# CONFIG_OR1K_VIRT=n
.gitlab-ci.d/buildtest.yml +1 -1
index 811132443a7..49cd50c354d 100644
@@ -649,7 +649,7 @@ build-tci:
 
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
-#   mips64el, x86_64
+#   mips64el, or1k, x86_64
 # does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
hw/openrisc/Kconfig +4 -0
index 97af258b556..9c9015e0a5d 100644
@@ -1,5 +1,7 @@
 config OR1K_SIM
     bool
+    default y
+    depends on OPENRISC
     select SERIAL
     select OPENCORES_ETH
     select OMPIC
@@ -7,6 +9,8 @@ config OR1K_SIM
 
 config OR1K_VIRT
     bool
+    default y
+    depends on OPENRISC
     imply PCI_DEVICES
     imply VIRTIO_VGA
     imply TEST_DEVICES
Signature · 1 line
2.44.0
#40 lore raw

[PULL 28/46] target/i386: Introduce SapphireRapids-v3 to add missing features

In reply to Paolo Bonzini

From: Lei Wang <[email protected]>

Add the missing features(ss, tsc-adjust, cldemote, movdiri, movdir64b) in the SapphireRapids-v3 CPU model.

Message-ID: <[email protected]>

---
 target/i386/cpu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
target/i386/cpu.c +11 -0
index aa3b2d83912..e5723f232c0 100644
@@ -3970,6 +3970,17 @@ static const X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 }
             },
+            {
+                .version = 3,
+                .props = (PropValue[]) {
+                    { "ss", "on" },
+                    { "tsc-adjust", "on" },
+                    { "cldemote", "on" },
+                    { "movdiri", "on" },
+                    { "movdir64b", "on" },
+                    { /* end of list */ }
+                }
+            },
             { /* end of list */ }
         }
     },
Signature · 1 line
2.44.0
#41 lore raw

[PULL 11/46] hppa: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with PARISC.

No changes to generated config-devices.mak file.

---
 configs/devices/hppa-softmmu/default.mak | 5 ++---
 .gitlab-ci.d/buildtest.yml               | 2 +-
 hw/hppa/Kconfig                          | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)
configs/devices/hppa-softmmu/default.mak +2 -3
index b0364bb88f2..059510cdbb7 100644
@@ -4,6 +4,5 @@
 #
 #CONFIG_PCI_DEVICES=n
 
-# Boards:
-#
-CONFIG_HPPA_B160L=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_HPPA_B160L=n
.gitlab-ci.d/buildtest.yml +1 -1
index f4dc5666467..6531758d968 100644
@@ -662,7 +662,7 @@ build-without-defaults:
       --disable-pie
       --disable-qom-cast-debug
       --disable-strip
-    TARGETS: alpha-softmmu avr-softmmu cris-softmmu
+    TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu
       s390x-softmmu sh4-softmmu
       sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
     MAKE_CHECK_ARGS: check
hw/hppa/Kconfig +2 -0
index ee7ffd2bfb5..d4d457f4ab4 100644
@@ -1,5 +1,7 @@
 config HPPA_B160L
     bool
+    default y
+    depends on HPPA
     imply PCI_DEVICES
     imply E1000_PCI
     imply USB_OHCI_PCI
Signature · 1 line
2.44.0
#42 lore raw

[PULL 34/46] net: remove AnnounceTimer from typedefs.h

In reply to Paolo Bonzini

Exactly nobody needs it there. Place the typedef in the header that defines the struct.

---
 include/net/announce.h  | 4 ++--
 include/qemu/typedefs.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
include/net/announce.h +2 -2
index 3d90c83c237..72e7e501f7e 100644
@@ -12,12 +12,12 @@
 #include "qapi/qapi-types-net.h"
 #include "qemu/timer.h"
 
-struct AnnounceTimer {
+typedef struct AnnounceTimer {
     QEMUTimer *tm;
     AnnounceParameters params;
     QEMUClockType type;
     int round;
-};
+} AnnounceTimer;
 
 /* Returns: update the timer to the next time point */
 int64_t qemu_announce_timer_step(AnnounceTimer *timer);
include/qemu/typedefs.h +0 -1
index e0a0bc31e7f..520f421397b 100644
@@ -27,7 +27,6 @@ typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
 typedef struct Aml Aml;
-typedef struct AnnounceTimer AnnounceTimer;
 typedef struct ArchCPU ArchCPU;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
Signature · 1 line
2.44.0
#43 lore raw

[PULL 40/46] qapi/machine: remove types from typedefs.h

In reply to Paolo Bonzini

They are needed in very few places, which already depends on other generated QAPI files. The benefit of having these types in typedefs.h is small.

---
 include/hw/core/cpu.h   | 1 +
 include/qemu/typedefs.h | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
include/hw/core/cpu.h +1 -0
index 46b99a7ea55..a23d39f6a0c 100644
@@ -28,6 +28,7 @@
 #include "exec/memattrs.h"
 #include "exec/mmu-access-type.h"
 #include "exec/tlb-common.h"
+#include "qapi/qapi-types-machine.h"
 #include "qapi/qapi-types-run-state.h"
 #include "qemu/bitmap.h"
 #include "qemu/rcu_queue.h"
include/qemu/typedefs.h +0 -2
index b71a36d02b2..78598f27f32 100644
@@ -37,12 +37,10 @@ typedef struct BusClass BusClass;
 typedef struct BusState BusState;
 typedef struct Chardev Chardev;
 typedef struct Clock Clock;
-typedef struct CompatProperty CompatProperty;
 typedef struct ConfidentialGuestSupport ConfidentialGuestSupport;
 typedef struct CPUAddressSpace CPUAddressSpace;
 typedef struct CPUArchState CPUArchState;
 typedef struct CPUPluginState CPUPluginState;
-typedef struct CpuInfoFast CpuInfoFast;
 typedef struct CPUJumpCache CPUJumpCache;
 typedef struct CPUState CPUState;
 typedef struct CPUTLBEntryFull CPUTLBEntryFull;
Signature · 1 line
2.44.0
#44 lore raw

[PULL 08/46] arm: switch boards to "default y"

In reply to Paolo Bonzini

For ARM targets, boards that require TCG are already using "default y". Switch ARM_VIRT to the same selection mechanism.

No changes to generated config-devices.mak file.

---
 configs/devices/arm-softmmu/default.mak | 3 ++-
 .gitlab-ci.d/buildtest.yml              | 1 +
 hw/arm/Kconfig                          | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
configs/devices/arm-softmmu/default.mak +2 -1
index c1cfb3bcf75..31f77c20269 100644
@@ -5,7 +5,8 @@
 # CONFIG_PCI_DEVICES=n
 # CONFIG_TEST_DEVICES=n
 
-CONFIG_ARM_VIRT=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_ARM_VIRT=n
 
 # These are selected by default when TCG is enabled, uncomment them to
 # keep out of the build.
.gitlab-ci.d/buildtest.yml +1 -0
index c6c9c242c5c..3a03cdb0151 100644
@@ -648,6 +648,7 @@ build-tci:
     - make check-tcg
 
 # Check our reduced build configurations
+# requires libfdt: aarch64, arm
 build-without-defaults:
   extends: .native_build_job_template
   needs:
hw/arm/Kconfig +2 -0
index fe1f9643bd9..98c264ed219 100644
@@ -1,5 +1,7 @@
 config ARM_VIRT
     bool
+    default y
+    depends on ARM
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply VFIO_AMD_XGBE
Signature · 1 line
2.44.0
#45 lore raw

[PULL 03/46] tests/qtest: skip m48t59-test if the machine is absent

In reply to Paolo Bonzini

Together with the series at https://patchew.org/QEMU/[email protected]/,
this allows adding sparc-softmmu to the target list of the
build-without-defaults CI job.

---
 tests/qtest/m48t59-test.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tests/qtest/m48t59-test.c +6 -5
index b9cd209165a..605797ab785 100644
@@ -262,11 +262,12 @@ int main(int argc, char **argv)
     base_setup();
 
     g_test_init(&argc, &argv, NULL);
-
-    if (g_test_slow()) {
-        /* Do not run this in timing-sensitive environments */
-        qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
+    if (qtest_has_machine(base_machine)) {
+        if (g_test_slow()) {
+            /* Do not run this in timing-sensitive environments */
+            qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
+        }
+        qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     }
-    qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     return g_test_run();
 }
Signature · 1 line
2.44.0
#46 lore raw

[PULL 13/46] loongarch: switch boards to "default y"

In reply to Paolo Bonzini

Some targets use "default y" for boards to filter out those that require TCG. For consistency we are switching all other targets to do the same. Continue with Loongarch.

No changes to generated config-devices.mak file.

---
 configs/devices/loongarch64-softmmu/default.mak | 3 ++-
 .gitlab-ci.d/buildtest.yml                      | 4 ++--
 hw/loongarch/Kconfig                            | 2 ++
 3 files changed, 6 insertions(+), 3 deletions(-)
configs/devices/loongarch64-softmmu/default.mak +2 -1
index 0893112b81d..ffe705836fd 100644
@@ -3,4 +3,5 @@
 # Uncomment the following lines to disable these optional devices:
 # CONFIG_PCI_DEVICES=n
 
-CONFIG_LOONGARCH_VIRT=y
+# Boards are selected by default, uncomment to keep out of the build.
+# CONFIG_LOONGARCH_VIRT=n
.gitlab-ci.d/buildtest.yml +2 -2
index 75222c4450b..a82848ba55b 100644
@@ -648,8 +648,8 @@ build-tci:
     - make check-tcg
 
 # Check our reduced build configurations
-# requires libfdt: aarch64, arm, i386, x86_64
-# does not build without boards: i386, x86_64
+# requires libfdt: aarch64, arm, i386, loongarch64, x86_64
+# does not build without boards: i386, loongarch64, x86_64
 build-without-defaults:
   extends: .native_build_job_template
   needs:
hw/loongarch/Kconfig +2 -0
index 5727efed6d8..78640505630 100644
@@ -1,5 +1,7 @@
 config LOONGARCH_VIRT
     bool
+    default y
+    depends on LOONGARCH64
     select PCI
     select PCI_EXPRESS_GENERIC_BRIDGE
     imply VIRTIO_VGA
Signature · 1 line
2.44.0
#47 lore raw
In reply to Paolo Bonzini
Quoted 12 lines · Paolo Bonzini

The following changes since commit 4977ce198d2390bff8c71ad5cb1a5f6aa24b56fb:

   Merge tag 'pull-tcg-20240501' ofhttps://gitlab.com/rth7680/qemu  into staging (2024-05-01 15:15:33 -0700)

are available in the Git repository at:

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

for you to fetch changes up to deb686ef0e609ceaec0daa5dc88eb5b3dd9701b0:

   qga/commands-posix: fix typo in qmp_guest_set_user_password (2024-05-03 19:36:51 +0200)
Quoted 7 lines

----------------------------------------------------------------
* target/i386: Introduce SapphireRapids-v3 to add missing features
* switch boards to "default y"
* allow building emulators without any board
* configs: list "implied" device groups in the default configs
* remove unnecessary declarations from typedefs.h
* target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/9.1 as appropriate.

r~