From 19985792d4fae4c246d595394ef0c67bfc92eef2 Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Thu, 1 Feb 2024 16:40:24 +0800 Subject: [PATCH 01/15] hw/isa/vt82c686: Consolidate the use of device_class_set_parent_realize() Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/isa/vt82c686.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index d3e0f6d01f..a99eae4f63 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -328,8 +328,8 @@ static void via_superio_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); - sc->parent_realize = dc->realize; - dc->realize = via_superio_realize; + device_class_set_parent_realize(dc, via_superio_realize, + &sc->parent_realize); } static const TypeInfo via_superio_info = { From f669bd891475bbdbaf347e12d5e6bdb73a59f058 Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Thu, 1 Feb 2024 16:40:25 +0800 Subject: [PATCH 02/15] hw/isa/pc87312: Consolidate the use of device_class_set_parent_realize() Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/isa/pc87312.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index ee23f3e164..64dd17b537 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -338,10 +338,10 @@ static void pc87312_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass); - sc->parent_realize = dc->realize; - dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; + device_class_set_parent_realize(dc, pc87312_realize, + &sc->parent_realize); device_class_set_props(dc, pc87312_properties); sc->parallel = (ISASuperIOFuncs){ From 6269aad730d52aadf86661d58e985362f5ade508 Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Thu, 1 Feb 2024 16:40:26 +0800 Subject: [PATCH 03/15] hw/intc/s390_flic: Consolidate the use of device_class_set_parent_realize() Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/intc/s390_flic_kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index 4d5cbb2a2f..baaa30dcb7 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -646,9 +646,10 @@ static void kvm_s390_flic_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); S390FLICStateClass *fsc = S390_FLIC_COMMON_CLASS(oc); + KVMS390FLICStateClass *kfsc = KVM_S390_FLIC_CLASS(oc); - KVM_S390_FLIC_CLASS(oc)->parent_realize = dc->realize; - dc->realize = kvm_s390_flic_realize; + device_class_set_parent_realize(dc, kvm_s390_flic_realize, + &kfsc->parent_realize); dc->vmsd = &kvm_s390_flic_vmstate; dc->reset = kvm_s390_flic_reset; fsc->register_io_adapter = kvm_s390_register_io_adapter; From 9953bf34ee84f1c9b92fb4ab0aa698f9a76cfce6 Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Thu, 1 Feb 2024 16:40:27 +0800 Subject: [PATCH 04/15] hw/arm/smmuv3: Consolidate the use of device_class_set_parent_realize() Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- hw/arm/smmuv3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 68eeef3e1d..b3d8642a49 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1857,8 +1857,8 @@ static void smmuv3_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_smmuv3; resettable_class_set_parent_phases(rc, NULL, smmu_reset_hold, NULL, &c->parent_phases); - c->parent_realize = dc->realize; - dc->realize = smmu_realize; + device_class_set_parent_realize(dc, smmu_realize, + &c->parent_realize); device_class_set_props(dc, smmuv3_properties); } From cd8a35b913c24248267c682cb9a348461c106139 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 29 Jan 2024 17:03:07 +0900 Subject: [PATCH 05/15] hw/smbios: Fix OEM strings table option validation qemu_smbios_type11_opts did not have the list terminator and that resulted in out-of-bound memory access. It also needs to have an element for the type option. Cc: qemu-stable@nongnu.org Fixes: 2d6dcbf93fb0 ("smbios: support setting OEM strings table") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael Tokarev --- hw/smbios/smbios.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index c0c5a81e66..a9048c1342 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -375,6 +375,11 @@ static const QemuOptDesc qemu_smbios_type8_opts[] = { }; static const QemuOptDesc qemu_smbios_type11_opts[] = { + { + .name = "type", + .type = QEMU_OPT_NUMBER, + .help = "SMBIOS element type", + }, { .name = "value", .type = QEMU_OPT_STRING, @@ -385,6 +390,7 @@ static const QemuOptDesc qemu_smbios_type11_opts[] = { .type = QEMU_OPT_STRING, .help = "OEM string data from file", }, + { /* end of list */ } }; static const QemuOptDesc qemu_smbios_type17_opts[] = { From 196578c9d051d19c23e6c13e97b791a41b318315 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 29 Jan 2024 17:03:08 +0900 Subject: [PATCH 06/15] hw/smbios: Fix port connector option validation qemu_smbios_type8_opts did not have the list terminator and that resulted in out-of-bound memory access. It also needs to have an element for the type option. Cc: qemu-stable@nongnu.org Fixes: fd8caa253c56 ("hw/smbios: support for type 8 (port connector)") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael Tokarev --- hw/smbios/smbios.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index a9048c1342..a3c4e52ce9 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -352,6 +352,11 @@ static const QemuOptDesc qemu_smbios_type4_opts[] = { }; static const QemuOptDesc qemu_smbios_type8_opts[] = { + { + .name = "type", + .type = QEMU_OPT_NUMBER, + .help = "SMBIOS element type", + }, { .name = "internal_reference", .type = QEMU_OPT_STRING, @@ -372,6 +377,7 @@ static const QemuOptDesc qemu_smbios_type8_opts[] = { .type = QEMU_OPT_NUMBER, .help = "port type", }, + { /* end of list */ } }; static const QemuOptDesc qemu_smbios_type11_opts[] = { From 341d698c8d94cf690ea4864dccddf331d0ca02d0 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 5 Feb 2024 09:47:46 +0100 Subject: [PATCH 07/15] MAINTAINERS: Cover qapi/cxl.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 415442a1b4a (hw/mem/cxl_type3: Add CXL RAS Error Injection Support.) created qapi/cxl.json without adding it to MAINTAINERS. Fix that. Cc: Ben Widawsky Cc: Jonathan Cameron Cc: Fan Ni Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f80db6a96a..87f03ebccd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2894,6 +2894,7 @@ S: Supported F: hw/cxl/ F: hw/mem/cxl_type3.c F: include/hw/cxl/ +F: qapi/cxl.json Dirty Bitmaps M: Eric Blake From 967fbcc453c094728dbdefcc135e67141ab2c2f5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 5 Feb 2024 09:47:47 +0100 Subject: [PATCH 08/15] MAINTAINERS: Cover qapi/stats.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit aa09b3d5f8e (stats: Move QMP commands from monitor/ to stats/) created section Stats, but neglected to add qapi/stats.json to it. Fix that. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 87f03ebccd..2e09ed5595 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3321,6 +3321,7 @@ Stats S: Orphan F: include/sysemu/stats.h F: stats/ +F: qapi/stats.json Streams M: Edgar E. Iglesias From d81b797ca26e4cfbee5c7578c64f381c79caa5d1 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Wed, 7 Feb 2024 10:29:40 +0300 Subject: [PATCH 09/15] qemu-nbd: mention --tls-hostname option in qemu-nbd --help MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option was not documented. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1240 Reviewed-by: Daniel P. Berrangé Signed-off-by: Michael Tokarev --- qemu-nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-nbd.c b/qemu-nbd.c index bac0b5e3ec..d7b3ccab21 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -114,6 +114,7 @@ static void usage(const char *name) " --tls-creds=ID use id of an earlier --object to provide TLS\n" " --tls-authz=ID use id of an earlier --object to provide\n" " authorization\n" +" --tls-hostname=HOSTNAME override hostname used to check x509 certificate\n" " -T, --trace [[enable=]][,events=][,file=]\n" " specify tracing options\n" " --fork fork off the server process and exit the parent\n" From 694226410bc1fd59cb379d0b90158679ea42ab03 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 8 Feb 2024 11:16:57 +0100 Subject: [PATCH 10/15] iothread: Simplify expression in qemu_in_iothread() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'a == b ? false : true' is a rather convoluted way of writing 'a != b'. Use the more obvious way to write it. Signed-off-by: Kevin Wolf Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- iothread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iothread.c b/iothread.c index 6c1fc8c856..e1e9e04736 100644 --- a/iothread.c +++ b/iothread.c @@ -404,6 +404,5 @@ IOThread *iothread_by_id(const char *id) bool qemu_in_iothread(void) { - return qemu_get_current_aio_context() == qemu_get_aio_context() ? - false : true; + return qemu_get_current_aio_context() != qemu_get_aio_context(); } From b30fa6b81a89de058b5e5c8029b027eb7365ee55 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Thu, 8 Feb 2024 09:00:50 +0300 Subject: [PATCH 11/15] qemu-options.hx: document that tftp=dir is readonly Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1286 Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index f7c83362d1..aec2328736 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3100,6 +3100,8 @@ SRST server. The files in dir will be exposed as the root of a TFTP server. The TFTP client on the guest must be configured in binary mode (use the command ``bin`` of the Unix TFTP client). + The built-in TFTP server is read-only; it does not implement any + command for writing files. QEMU will not write to this directory. ``tftp-server-name=name`` In BOOTP reply, broadcast name as the "TFTP server name" From e26c9402c26c3e6e22d95aced7e5f34923ef570e Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 9 Feb 2024 01:05:06 +0100 Subject: [PATCH 12/15] qemu-options.hx: Add zoom-to-fit to option summary for gtk The detailed help lists zoom-to-fit as valid option but it is missing from the short option summary. Add it there too. Signed-off-by: BALATON Zoltan Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index aec2328736..8547254dbf 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2085,7 +2085,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #if defined(CONFIG_GTK) "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" " [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n" - " [,show-menubar=on|off]\n" + " [,show-menubar=on|off][,zoom-to-fit=on|off]\n" #endif #if defined(CONFIG_VNC) "-display vnc=[,]\n" From 0ccebcdcf4a1ee394fae415a0ebbec8a438ca2b5 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 9 Feb 2024 01:05:05 +0100 Subject: [PATCH 13/15] system: Move memory_ldst.c.inc to system This file is only used by system/physmem.c so move them together. Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell Reviewed-by: Michael Tokarev Reviewed-by: Richard Henderson Signed-off-by: Michael Tokarev --- memory_ldst.c.inc => system/memory_ldst.c.inc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename memory_ldst.c.inc => system/memory_ldst.c.inc (100%) diff --git a/memory_ldst.c.inc b/system/memory_ldst.c.inc similarity index 100% rename from memory_ldst.c.inc rename to system/memory_ldst.c.inc From 5f8d88bdeb4df6fc7d2a801719adfc92a8ff235a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 9 Feb 2024 16:00:37 +0100 Subject: [PATCH 14/15] cpu-target: Include missing 'exec/memory.h' header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include "exec/memory.h" in order to avoid: cpu-target.c:201:50: error: use of undeclared identifier 'TYPE_MEMORY_REGION' DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- cpu-target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu-target.c b/cpu-target.c index 958d63e882..86444cc2c6 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -31,6 +31,7 @@ #else #include "hw/core/sysemu-cpu-ops.h" #include "exec/address-spaces.h" +#include "exec/memory.h" #endif #include "sysemu/cpus.h" #include "sysemu/tcg.h" From f6e33708bbb824d493863bc936d3c86fc86f2004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 9 Feb 2024 16:00:38 +0100 Subject: [PATCH 15/15] monitor/target: Include missing 'exec/memory.h' header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include "exec/memory.h" in order to avoid: monitor/hmp-cmds-target.c:263:10: error: call to undeclared function 'memory_region_is_ram'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!memory_region_is_ram(mrs.mr) && !memory_region_is_romd(mrs.mr)) { ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- monitor/hmp-cmds-target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c index d9fbcac08d..9338ae8440 100644 --- a/monitor/hmp-cmds-target.c +++ b/monitor/hmp-cmds-target.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "disas/disas.h" #include "exec/address-spaces.h" +#include "exec/memory.h" #include "monitor/hmp-target.h" #include "monitor/monitor-internal.h" #include "qapi/error.h"