Skip to content

Commit

Permalink
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Browse files Browse the repository at this point in the history
* target/i386: miscellaneous changes, mostly TCG-related
* fix --without-default-devices build
* fix --without-default-devices qtests on s390x and arm

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmY+JWIUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroOGmwf+JKY/i7ihXvfINQIRSKaz+H7KM3Br
# BGv/iXj4hrRA+zflcZswwoWmPrkrXM3J5JqGG6zTqqhGne+fRKt60KBFwn+lRaMY
# n48icR4zOSaEcGKBOFKs9CB1JgL7SWMe+fZ8d02amYlIZ005af0d69ACenF9r/oX
# pTxYIrR90FdZStbF4Yl0G5CzMLBdHZd/b6bMNmbefVPv3/d2zuL7VgqLX3y3J0ee
# ASYkYjn8Wpda4KX9s2rvH9ENXj80Q7EqhuDvoBlyK72/2lE5aTojbUiyGB4n5AuX
# 5OHA+0HEpuCXXToijOeDXD1NDOk9E5DP8cEwwZfZ2gjWKjja0U6OODGLVw==
# =woTe
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 10 May 2024 03:47:14 PM CEST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (27 commits)
  configs: disable emulators that require it if libfdt is not found
  hw/xtensa: require libfdt
  kconfig: express dependency of individual boards on libfdt
  kconfig: allow compiling out QEMU device tree code per target
  meson: move libfdt together with other dependencies
  meson: pick libfdt from common_ss when building target-specific files
  tests/qtest: arm: fix operation in a build without any boards or devices
  i386: select correct components for no-board build
  hw/i386: move rtc-reset-reinjection command out of hw/rtc
  hw/i386: split x86.c in multiple parts
  i386: pc: remove unnecessary MachineClass overrides
  i386: correctly select code in hw/i386 that depends on other components
  xen: register legacy backends via xen_backend_init
  xen: initialize legacy backends from xen_bus_init()
  tests/qtest: s390x: fix operation in a build without any boards or devices
  s390x: select correct components for no-board build
  s390: move css_migration_enabled from machine to css.c
  s390_flic: add migration-enabled property
  s390x: move s390_cpu_addr2state to target/s390x/sigp.c
  sh4: select correct components for no-board build
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 12, 2024
2 parents dafec28 + 9b089d2 commit 9360070
Show file tree
Hide file tree
Showing 90 changed files with 1,515 additions and 1,334 deletions.
9 changes: 5 additions & 4 deletions .gitlab-ci.d/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,9 @@ build-tci:
- make check-tcg

# 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, s390x, sh4, sh4eb, x86_64
# requires libfdt: aarch64, arm, loongarch64, microblaze, microblazeel,
# or1k, ppc64, riscv32, riscv64, rx
# fails qtest without boards: i386, x86_64
build-without-defaults:
extends: .native_build_job_template
needs:
Expand All @@ -665,7 +665,8 @@ 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 sparc-softmmu
mips-softmmu mips64-softmmu mipsel-softmmu mips64el-softmmu
ppc-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu
sparc64-softmmu tricore-softmmu xtensa-softmmu xtensaeb-softmmu
hexagon-linux-user i386-linux-user s390x-linux-user
MAKE_CHECK_ARGS: check
Expand Down
3 changes: 3 additions & 0 deletions Kconfig.host
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ config IVSHMEM
config TPM
bool

config FDT
bool

config VHOST_USER
bool

Expand Down
1 change: 1 addition & 0 deletions configs/targets/aarch64-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TARGET_BASE_ARCH=arm
TARGET_SUPPORTS_MTTCG=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml gdb-xml/arm-m-profile-mve.xml gdb-xml/aarch64-pauth.xml
# needed by boot.c
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/arm-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TARGET_ARCH=arm
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml gdb-xml/arm-m-profile-mve.xml
# needed by boot.c
TARGET_NEED_FDT=y
1 change: 0 additions & 1 deletion configs/targets/i386-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
TARGET_ARCH=i386
TARGET_SUPPORTS_MTTCG=y
TARGET_NEED_FDT=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= gdb-xml/i386-32bit.xml
1 change: 1 addition & 0 deletions configs/targets/loongarch64-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TARGET_ARCH=loongarch64
TARGET_BASE_ARCH=loongarch
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml
# all boards require libfdt
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/microblaze-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
TARGET_ARCH=microblaze
TARGET_BIG_ENDIAN=y
TARGET_SUPPORTS_MTTCG=y
# needed by boot.c
TARGET_NEED_FDT=y
TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml
1 change: 1 addition & 0 deletions configs/targets/microblazeel-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TARGET_ARCH=microblaze
TARGET_SUPPORTS_MTTCG=y
# needed by boot.c
TARGET_NEED_FDT=y
TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml
1 change: 0 additions & 1 deletion configs/targets/mips64el-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/or1k-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TARGET_ARCH=openrisc
TARGET_SUPPORTS_MTTCG=y
TARGET_BIG_ENDIAN=y
# needed by boot.c and all boards
TARGET_NEED_FDT=y
1 change: 0 additions & 1 deletion configs/targets/ppc-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ TARGET_ARCH=ppc
TARGET_BIG_ENDIAN=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= gdb-xml/power-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/ppc64-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ TARGET_BIG_ENDIAN=y
TARGET_SUPPORTS_MTTCG=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml
# all boards require libfdt
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/riscv32-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TARGET_ARCH=riscv32
TARGET_BASE_ARCH=riscv
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-32bit-virtual.xml
# needed by boot.c
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/riscv64-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TARGET_ARCH=riscv64
TARGET_BASE_ARCH=riscv
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-64bit-virtual.xml
# needed by boot.c
TARGET_NEED_FDT=y
1 change: 1 addition & 0 deletions configs/targets/rx-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TARGET_ARCH=rx
TARGET_XML_FILES= gdb-xml/rx-core.xml
# all boards require libfdt
TARGET_NEED_FDT=y
1 change: 0 additions & 1 deletion configs/targets/x86_64-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
TARGET_ARCH=x86_64
TARGET_BASE_ARCH=i386
TARGET_SUPPORTS_MTTCG=y
TARGET_NEED_FDT=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= gdb-xml/i386-64bit.xml
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ for opt do
--*) meson_option_parse "$opt" "$optarg"
;;
# Pass through -Dxxxx options to meson
-D*) meson_options="$meson_options $opt"
-D*) meson_option_add "$opt"
;;
esac
done
Expand Down
8 changes: 8 additions & 0 deletions docs/about/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ Backend ``memory`` (since 9.0)
CPU device properties
'''''''''''''''''''''

``pcommit`` on x86 (since 9.1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The PCOMMIT instruction was never included in any physical processor.
It was implemented as a no-op instruction in TCG up to QEMU 9.0, but
only with ``-cpu max`` (which does not guarantee migration compatibility
across versions).

``pmu-num=n`` on RISC-V CPUs (since 8.2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
8 changes: 7 additions & 1 deletion hw/9pfs/xen-9p-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev)
xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER);
}

struct XenDevOps xen_9pfs_ops = {
static struct XenDevOps xen_9pfs_ops = {
.size = sizeof(Xen9pfsDev),
.flags = DEVOPS_FLAG_NEED_GNTDEV,
.alloc = xen_9pfs_alloc,
Expand All @@ -522,3 +522,9 @@ struct XenDevOps xen_9pfs_ops = {
.disconnect = xen_9pfs_disconnect,
.free = xen_9pfs_free,
};

static void xen_9pfs_register_backend(void)
{
xen_be_register("9pfs", &xen_9pfs_ops);
}
xen_backend_init(xen_9pfs_register_backend);
5 changes: 5 additions & 0 deletions hw/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config ARM_VIRT
select ACPI
select ARM_SMMUV3
select GPIO_KEY
select DEVICE_TREE
select FW_CFG_DMA
select PCI_EXPRESS
select PCI_EXPRESS_GENERIC_BRIDGE
Expand Down Expand Up @@ -265,6 +266,7 @@ config SBSA_REF
default y
depends on TCG && AARCH64
imply PCI_DEVICES
select DEVICE_TREE
select AHCI
select ARM_SMMUV3
select GPIO_KEY
Expand Down Expand Up @@ -347,6 +349,7 @@ config VEXPRESS
bool
default y
depends on TCG && ARM
select DEVICE_TREE
select A9MPCORE
select A15MPCORE
select ARM_MPTIMER
Expand Down Expand Up @@ -492,6 +495,7 @@ config XLNX_ZYNQMP_ARM
select CPU_CLUSTER
select DDC
select DPCD
select DEVICE_TREE
select SDHCI
select SSI
select SSI_M25P80
Expand All @@ -509,6 +513,7 @@ config XLNX_VERSAL
depends on TCG && AARCH64
select ARM_GIC
select CPU_CLUSTER
select DEVICE_TREE
select PL011
select CADENCE
select VIRTIO_MMIO
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
arm_ss = ss.source_set()
arm_ss.add(files('boot.c'), fdt)
arm_ss.add(files('boot.c'))
arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c'))
arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c'))
arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c'))
Expand Down
9 changes: 8 additions & 1 deletion hw/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ config EMPTY_SLOT
config PTIMER
bool

config DEVICE_TREE
bool
# fail the build if libfdt not found
depends on FDT

config FITLOADER
bool
depends on DEVICE_TREE

config GENERIC_LOADER
bool
Expand All @@ -14,13 +20,14 @@ config GENERIC_LOADER
config GUEST_LOADER
bool
default y
depends on TCG
depends on TCG && DEVICE_TREE

config OR_IRQ
bool

config PLATFORM_BUS
bool
depends on DEVICE_TREE

config REGISTER
bool
Expand Down
2 changes: 1 addition & 1 deletion hw/core/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ common_ss.add(files('cpu-common.c'))
common_ss.add(files('machine-smp.c'))
system_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c'))
system_ss.add(when: 'CONFIG_GENERIC_LOADER', if_true: files('generic-loader.c'))
system_ss.add(when: ['CONFIG_GUEST_LOADER', fdt], if_true: files('guest-loader.c'))
system_ss.add(when: 'CONFIG_GUEST_LOADER', if_true: files('guest-loader.c'))
system_ss.add(when: 'CONFIG_OR_IRQ', if_true: files('or-irq.c'))
system_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('platform-bus.c'))
system_ss.add(when: 'CONFIG_PTIMER', if_true: files('ptimer.c'))
Expand Down
8 changes: 7 additions & 1 deletion hw/display/xenfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ static void fb_event(struct XenLegacyDevice *xendev)

/* -------------------------------------------------------------------- */

struct XenDevOps xen_kbdmouse_ops = {
static struct XenDevOps xen_kbdmouse_ops = {
.size = sizeof(struct XenInput),
.init = input_init,
.initialise = input_initialise,
Expand All @@ -995,3 +995,9 @@ static const GraphicHwOps xenfb_ops = {
.gfx_update = xenfb_update,
.ui_info = xenfb_ui_info,
};

static void xen_vkbd_register_backend(void)
{
xen_be_register("vkbd", &xen_kbdmouse_ops);
}
xen_backend_init(xen_vkbd_register_backend);
3 changes: 2 additions & 1 deletion hw/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ config Q35
config MICROVM
bool
default y
depends on I386
depends on I386 && FDT
select DEVICE_TREE
select SERIAL_ISA # for serial_hds_isa_init()
select ISA_BUS
select APIC
Expand Down
2 changes: 2 additions & 0 deletions hw/i386/fw_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg)
fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val));
}

#ifdef CONFIG_ACPI
void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
{
/*
Expand All @@ -229,3 +230,4 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
aml_append(dev, aml_name_decl("_CRS", crs));
aml_append(scope, dev);
}
#endif
7 changes: 5 additions & 2 deletions hw/i386/meson.build
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
i386_ss = ss.source_set()
i386_ss.add(files(
'fw_cfg.c',
'vapic.c',
'e820_memory_layout.c',
'monitor.c',
'multiboot.c',
'x86.c',
'x86-cpu.c',
))

i386_ss.add(when: 'CONFIG_APIC', if_true: files('vapic.c'))
i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'),
if_false: files('x86-iommu-stub.c'))
i386_ss.add(when: 'CONFIG_AMD_IOMMU', if_true: files('amd_iommu.c'),
if_false: files('amd_iommu-stub.c'))
i386_ss.add(when: 'CONFIG_I440FX', if_true: files('pc_piix.c'))
i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-microvm.c', 'microvm-dt.c'))
i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('x86-common.c', 'microvm.c', 'acpi-microvm.c', 'microvm-dt.c'))
i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c'))
i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmouse.c'))
i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c'))
Expand All @@ -22,6 +24,7 @@ i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'),

i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c'))
i386_ss.add(when: 'CONFIG_PC', if_true: files(
'x86-common.c',
'pc.c',
'pc_sysfw.c',
'acpi-build.c',
Expand Down
46 changes: 46 additions & 0 deletions hw/i386/monitor.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* QEMU monitor
*
* Copyright (c) 2003-2004 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "monitor/monitor.h"
#include "qapi/qmp/qdict.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-misc-target.h"
#include "hw/i386/x86.h"
#include "hw/rtc/mc146818rtc.h"

#include CONFIG_DEVICES

void qmp_rtc_reset_reinjection(Error **errp)
{
X86MachineState *x86ms = X86_MACHINE(qdev_get_machine());

#ifdef CONFIG_MC146818RTC
if (x86ms->rtc) {
rtc_reset_reinjection(MC146818_RTC(x86ms->rtc));
}
#else
assert(!x86ms->rtc);
#endif
}
4 changes: 0 additions & 4 deletions hw/i386/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,6 @@ void pc_basic_device_init(struct PCMachineState *pcms,
pci_create_simple(pcms->pcibus, -1, "xen-platform");
}
xen_bus_init();
xen_be_init();
}
#endif

Expand Down Expand Up @@ -1827,9 +1826,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
assert(!mc->get_hotplug_handler);
mc->get_hotplug_handler = pc_get_hotplug_handler;
mc->hotplug_allowed = pc_hotplug_allowed;
mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
mc->get_default_cpu_node_id = x86_get_default_cpu_node_id;
mc->possible_cpu_arch_ids = x86_possible_cpu_arch_ids;
mc->auto_enable_numa_with_memhp = true;
mc->auto_enable_numa_with_memdev = true;
mc->has_hotpluggable_cpus = true;
Expand Down

0 comments on commit 9360070

Please sign in to comment.