Skip to contentSkip to conversation

Trivial patches for 2024-10-04

GIT PULL Applied Michael Tokarev 3 participants 27 messages Oct 4, 2024 – Oct 11, 2024

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

The following changes since commit 423be09ab9492735924e73a2d36069784441ebc6:

Merge tag 'warn-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2024-10-03 10:32:54 +0100)

are available in the Git repository at:

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 6b7d2f6e1896fb675e8518ed61c792d4dd92e034:

MAINTAINERS: Add myself as maintainer of e500 machines (2024-10-04 18:57:38 +0300)

----------------------------------------------------------------
trivial patches for 2024-10-04

- many dead code removals by Dr. David Alan Gilbert
- forgotten minor bugfixes (vnc, resource freeing in qemu-keymap)
- some more..

----------------------------------------------------------------
Akihiko Odaki (1):
qemu-keymap: Release local allocation references

Bernhard Beschow (1):
MAINTAINERS: Add myself as maintainer of e500 machines

Dr. David Alan Gilbert (14):
hw/xen: Remove deadcode
q35: Remove unused mch_mcfg_base
net: Remove deadcode
hw/net/net_rx_pkt: Remove deadcode hw/char: Remove unused serial_set_frequency
linux-user: Remove unused handle_vm86_fault
hw: Remove unused fw_cfg_init_io ui/cursor: remove cursor_get_mono_image
vhost: Remove unused vhost_dev_{load|save}_inflight
remote: Remove unused remote_iohub_finalize
replay: Remove unused replay_disable_events hw/pci: Remove unused pcie_chassis_find_slot hw/net/rocker: Remove unused rocker_fp_ports
block-backend: Remove deadcode

Laurent Vivier (1):
MAINTAINERS: remove gensyscalls.sh from the linux-user section

Marc-André Lureau (1):
vnc: fix crash when no console attached

Peter Maydell (1):
docs/devel: Mention post_load hook restrictions where we document the hook

Philippe Mathieu-Daudé (2):
hw/audio/virtio-snd: Remove unnecessary "exec/tswap.h" header hw/mips: Build fw_cfg.c once

Thomas Huth (2):
tests/tcg/plugins: Remove remainder of the cris target tests/functional: Fix hash validation

 MAINTAINERS                                 |   7 +-
 block/block-backend.c                       |  73 ---------------
 docs/devel/migration/main.rst               |   6 ++
 docs/devel/replay.rst                       |   3 +
 hw/audio/virtio-snd.c                       |   1 -
 hw/char/serial.c                            |   7 --
 hw/mips/meson.build                         |   2 +-
 hw/net/net_rx_pkt.c                         |  13 ---
 hw/net/net_rx_pkt.h                         |  17 ----
 hw/net/rocker/rocker.c                      |   5 -
 hw/net/rocker/rocker.h                      |   1 -
 hw/nvram/fw_cfg.c                           |   5 -
 hw/pci-host/q35.c                           |  10 --
 hw/pci/pcie_port.c                          |  10 --
 hw/remote/iohub.c                           |  13 ---
 hw/virtio/vhost.c                           |  56 ------------
 hw/xen/xen-legacy-backend.c                 |  18 ----
 hw/xen/xen_devconfig.c                      |   8 --
 include/hw/char/serial.h                    |   2 -
 include/hw/nvram/fw_cfg.h                   |   1 -
 include/hw/pci-host/q35.h                   |   2 -
 include/hw/pci/pcie_port.h                  |   1 -
 include/hw/remote/iohub.h                   |   1 -
 include/hw/virtio/vhost.h                   |   2 -
 include/hw/xen/xen-legacy-backend.h         |   5 -
 include/net/net.h                           |   4 -
 include/net/queue.h                         |   4 -
 include/sysemu/block-backend-global-state.h |   8 --
 include/sysemu/replay.h                     |   2 -
 include/ui/console.h                        |   1 -
 linux-user/user-internals.h                 |   1 -
 linux-user/vm86.c                           | 136 ----------------------------
 net/hub.c                                   |  25 -----
 net/net.c                                   |  10 --
 net/queue.c                                 |  11 ---
 qemu-keymap.c                               |   9 +-
 replay/replay-events.c                      |   9 --
 tests/functional/qemu_test/asset.py         |   2 +-
 tests/tcg/plugins/syscall.c                 |   1 -
 ui/cursor.c                                 |  24 -----
 ui/vnc.c                                    |   2 +-
 41 files changed, 22 insertions(+), 496 deletions(-)
#1 lore raw

[PULL 01/23] hw/audio/virtio-snd: Remove unnecessary "exec/tswap.h" header

From: Philippe Mathieu-Daudé <[email protected]>

We were including the "exec/tswap.h" header to get target_words_bigendian() declaration, but since commit a276ec8e26 ("hw/audio/virtio-snd: Always use little endian audio format") removed this method call, we don't need this header anymore.

---
 hw/audio/virtio-snd.c | 1 -
 1 file changed, 1 deletion(-)
hw/audio/virtio-snd.c +0 -1
index 69838181dd..c5581d7b3d 100644
@@ -20,7 +20,6 @@
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "qemu/lockable.h"
-#include "exec/tswap.h"
 #include "sysemu/runstate.h"
 #include "trace.h"
 #include "qapi/error.h"
Signature · 1 line
2.39.5
#2 lore raw

[PULL 02/23] qemu-keymap: Release local allocation references

In reply to Michael Tokarev

From: Akihiko Odaki <[email protected]>

Commit 2523baf7fb4d ("qemu-keymap: Make references to allocations static") made references to allocations static to ensure LeakSanitizer can track them. This trick unfortunately did not work with gcc version 14.0.1; that compiler is clever enough to know that the value of the "state" variable is only referred in the current execution of the function and to put it on the stack.

Release references to allocations and suppress the error once for all.

---
 qemu-keymap.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
qemu-keymap.c +6 -3
index 701e4332af..6707067fea 100644
@@ -154,9 +154,9 @@ static xkb_mod_mask_t get_mod(struct xkb_keymap *map, const char *name)
 
 int main(int argc, char *argv[])
 {
-    static struct xkb_context *ctx;
-    static struct xkb_keymap *map;
-    static struct xkb_state *state;
+    struct xkb_context *ctx;
+    struct xkb_keymap *map;
+    struct xkb_state *state;
     xkb_mod_index_t mod, mods;
     int rc;
 
@@ -213,6 +213,7 @@ int main(int argc, char *argv[])
 
     ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
     map = xkb_keymap_new_from_names(ctx, &names, XKB_KEYMAP_COMPILE_NO_FLAGS);
+    xkb_context_unref(ctx);
     if (!map) {
         /* libxkbcommon prints error */
         exit(1);
@@ -234,6 +235,8 @@ int main(int argc, char *argv[])
 
     state = xkb_state_new(map);
     xkb_keymap_key_for_each(map, walk_map, state);
+    xkb_state_unref(state);
+    xkb_keymap_unref(map);
 
     /* add quirks */
     fprintf(outfile,
Signature · 1 line
2.39.5
#3 lore raw

[PULL 05/23] hw/xen: Remove deadcode

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

xen_be_copy_grant_refs is unused since 2019's
19f87870ba ("xen: remove the legacy 'xen_disk' backend")

xen_config_dev_console is unused since 2018's
6d7c06c213 ("Remove broken Xen PV domain builder")

Remove them.

---
 hw/xen/xen-legacy-backend.c         | 18 ------------------
 hw/xen/xen_devconfig.c              |  8 --------
 include/hw/xen/xen-legacy-backend.h |  5 -----
 3 files changed, 31 deletions(-)
hw/xen/xen-legacy-backend.c +0 -18
index 5514184f9c..e8e1ee4f7d 100644
@@ -147,24 +147,6 @@ void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr,
     }
 }
 
-int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev,
-                           bool to_domain,
-                           XenGrantCopySegment segs[],
-                           unsigned int nr_segs)
-{
-    int rc;
-
-    assert(xendev->ops->flags & DEVOPS_FLAG_NEED_GNTDEV);
-
-    rc = qemu_xen_gnttab_grant_copy(xendev->gnttabdev, to_domain, xen_domid,
-                                    segs, nr_segs, NULL);
-    if (rc) {
-        xen_pv_printf(xendev, 0, "xengnttab_grant_copy failed: %s\n",
-                      strerror(-rc));
-    }
-    return rc;
-}
-
 /*
  * get xen backend device, allocate a new one if it doesn't exist.
  */
hw/xen/xen_devconfig.c +0 -8
index 2150869f60..45ae134b84 100644
@@ -66,11 +66,3 @@ int xen_config_dev_vkbd(int vdev)
     xen_config_dev_dirs("vkbd", "vkbd", vdev, fe, be, sizeof(fe));
     return xen_config_dev_all(fe, be);
 }
-
-int xen_config_dev_console(int vdev)
-{
-    char fe[256], be[256];
-
-    xen_config_dev_dirs("console", "console", vdev, fe, be, sizeof(fe));
-    return xen_config_dev_all(fe, be);
-}
include/hw/xen/xen-legacy-backend.h +0 -5
index 943732b8d1..e198b120c5 100644
@@ -50,10 +50,6 @@ void *xen_be_map_grant_refs(struct XenLegacyDevice *xendev, uint32_t *refs,
 void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr,
                              uint32_t *refs, unsigned int nr_refs);
 
-int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev,
-                           bool to_domain, XenGrantCopySegment segs[],
-                           unsigned int nr_segs);
-
 static inline void *xen_be_map_grant_ref(struct XenLegacyDevice *xendev,
                                          uint32_t ref, int prot)
 {
@@ -70,6 +66,5 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev,
 void xen_config_cleanup(void);
 int xen_config_dev_vfb(int vdev, const char *type);
 int xen_config_dev_vkbd(int vdev);
-int xen_config_dev_console(int vdev);
 
 #endif /* HW_XEN_LEGACY_BACKEND_H */
Signature · 1 line
2.39.5
#4 lore raw

[PULL 06/23] q35: Remove unused mch_mcfg_base

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

mch_mcfg_base has been unused since it was added by
6f1426ab0f ("ich9: APIs for pc guest info")
back in 2013.

Remove it.

---
 hw/pci-host/q35.c         | 10 ----------
 include/hw/pci-host/q35.h |  2 --
 2 files changed, 12 deletions(-)
hw/pci-host/q35.c +0 -10
index d5a657a02a..f3e713318e 100644
@@ -662,16 +662,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
                                    OBJECT(&mch->smram));
 }
 
-uint64_t mch_mcfg_base(void)
-{
-    bool ambiguous;
-    Object *o = object_resolve_path_type("", TYPE_MCH_PCI_DEVICE, &ambiguous);
-    if (!o) {
-        return 0;
-    }
-    return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
-}
-
 static Property mch_props[] = {
     DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbytes,
                        16),
include/hw/pci-host/q35.h +0 -2
index 22fadfa3ed..ddafc3f2e3 100644
@@ -181,8 +181,6 @@ struct Q35PCIHost {
 #define MCH_PCIE_DEV                           1
 #define MCH_PCIE_FUNC                          0
 
-uint64_t mch_mcfg_base(void);
-
 /*
  * Arbitrary but unique BNF number for IOAPIC device.
  *
Signature · 1 line
2.39.5
#5 lore raw

[PULL 07/23] net: Remove deadcode

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

net_hub_port_find is unused since 2018's commit
af1a5c3eb4 ("net: Remove the deprecated "vlan" parameter")

qemu_receive_packet_iov is unused since commit
ffbd2dbd8e ("e1000e: Perform software segmentation for loopback")

in turn it was the last user of qemu_net_queue_receive_iov.

Remove them.

---
 include/net/net.h   |  4 ----
 include/net/queue.h |  4 ----
 net/hub.c           | 25 -------------------------
 net/net.c           | 10 ----------
 net/queue.c         | 11 -----------
 5 files changed, 54 deletions(-)
include/net/net.h +0 -4
index c8f679761b..cdd5b109b0 100644
@@ -172,9 +172,6 @@ ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *iov,
                                 int iovcnt, NetPacketSent *sent_cb);
 ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size);
 ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int size);
-ssize_t qemu_receive_packet_iov(NetClientState *nc,
-                                const struct iovec *iov,
-                                int iovcnt);
 ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size);
 ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf,
                                int size, NetPacketSent *sent_cb);
@@ -307,7 +304,6 @@ void hmp_host_net_remove(Monitor *mon, const QDict *qdict);
 void netdev_add(QemuOpts *opts, Error **errp);
 
 int net_hub_id_for_client(NetClientState *nc, int *id);
-NetClientState *net_hub_port_find(int hub_id);
 
 #define DEFAULT_NETWORK_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifdown"
include/net/queue.h +0 -4
index 9f2f289d77..2e686b1b61 100644
@@ -59,10 +59,6 @@ ssize_t qemu_net_queue_receive(NetQueue *queue,
                                const uint8_t *data,
                                size_t size);
 
-ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
-                                   const struct iovec *iov,
-                                   int iovcnt);
-
 ssize_t qemu_net_queue_send(NetQueue *queue,
                             NetClientState *sender,
                             unsigned flags,
net/hub.c +0 -25
index 4c8a469a50..496a3d3b4b 100644
@@ -193,31 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const char *name,
     return &port->nc;
 }
 
-/**
- * Find a available port on a hub; otherwise create one new port
- */
-NetClientState *net_hub_port_find(int hub_id)
-{
-    NetHub *hub;
-    NetHubPort *port;
-    NetClientState *nc;
-
-    QLIST_FOREACH(hub, &hubs, next) {
-        if (hub->id == hub_id) {
-            QLIST_FOREACH(port, &hub->ports, next) {
-                nc = port->nc.peer;
-                if (!nc) {
-                    return &(port->nc);
-                }
-            }
-            break;
-        }
-    }
-
-    nc = net_hub_add_port(hub_id, NULL, NULL);
-    return nc;
-}
-
 /**
  * Print hub configuration
  */
net/net.c +0 -10
index fc1125111c..d9b23a8f8c 100644
@@ -750,16 +750,6 @@ ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int size)
     return qemu_net_queue_receive(nc->incoming_queue, buf, size);
 }
 
-ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *iov,
-                                int iovcnt)
-{
-    if (!qemu_can_receive_packet(nc)) {
-        return 0;
-    }
-
-    return qemu_net_queue_receive_iov(nc->incoming_queue, iov, iovcnt);
-}
-
 ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size)
 {
     return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW,
net/queue.c +0 -11
index c872d51df8..fb33856c18 100644
@@ -193,17 +193,6 @@ ssize_t qemu_net_queue_receive(NetQueue *queue,
     return qemu_net_queue_deliver(queue, NULL, 0, data, size);
 }
 
-ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
-                                   const struct iovec *iov,
-                                   int iovcnt)
-{
-    if (queue->delivering) {
-        return 0;
-    }
-
-    return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt);
-}
-
 ssize_t qemu_net_queue_send(NetQueue *queue,
                             NetClientState *sender,
                             unsigned flags,
Signature · 1 line
2.39.5
#6 lore raw

[PULL 08/23] hw/net/net_rx_pkt: Remove deadcode

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

Remove them.

(Mjt: also removed net_rx_pkt_get_l3_hdr_offset prototype from hw/net/net_rx_pkt.h as suggested by Akihiko Odaki)

---
 hw/net/net_rx_pkt.c | 13 -------------
 hw/net/net_rx_pkt.h | 17 -----------------
 2 files changed, 30 deletions(-)
hw/net/net_rx_pkt.c +0 -13
index 0ea8734474..f87b6f046c 100644
@@ -209,12 +209,6 @@ void net_rx_pkt_get_protocols(struct NetRxPkt *pkt,
     *l4hdr_proto = pkt->l4hdr_info.proto;
 }
 
-size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-    return pkt->l3hdr_off;
-}
-
 size_t net_rx_pkt_get_l4_hdr_offset(struct NetRxPkt *pkt)
 {
     assert(pkt);
@@ -426,13 +420,6 @@ struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt)
     return pkt->vec;
 }
 
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-
-    return pkt->vec_len;
-}
-
 void net_rx_pkt_set_vhdr(struct NetRxPkt *pkt,
                             struct virtio_net_hdr *vhdr)
 {
hw/net/net_rx_pkt.h +0 -17
index 55ec67a1a7..ea077f5fdb 100644
@@ -77,14 +77,6 @@ void net_rx_pkt_get_protocols(struct NetRxPkt *pkt,
                                  bool *hasip4, bool *hasip6,
                                  EthL4HdrProto *l4hdr_proto);
 
-/**
-* fetches L3 header offset
-*
-* @pkt:            packet
-*
-*/
-size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt);
-
 /**
 * fetches L4 header offset
 *
@@ -267,15 +259,6 @@ net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data,
  */
 struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt);
 
-/**
-* returns io vector length that holds the attached data
-*
-* @pkt:            packet
-* @ret:            IOVec length
-*
-*/
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt);
-
 /**
  * prints rx packet data if debug is enabled
  *
Signature · 1 line
2.39.5
#7 lore raw

[PULL 03/23] vnc: fix crash when no console attached

In reply to Michael Tokarev

From: Marc-André Lureau <[email protected]>

Since commit e99441a3793b5 ("ui/curses: Do not use console_select()") qemu_text_console_put_keysym() no longer checks for NULL console argument, which leads to a later crash:

Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31) at ../ui/console-vc.c:332
332 } else if (s->echo && (keysym == '\r' || keysym == '\n')) {
(gdb) bt

 #0  0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31) at ../ui/console-vc.c:332
 #1  0x00005555559e18e5 in qemu_text_console_put_keysym (s=<optimized out>, keysym=<optimized out>) at ../ui/console.c:303
 #2  0x00005555559f2e88 in do_key_event (vs=vs@entry=0x5555579045c0, down=down@entry=1, keycode=keycode@entry=60, sym=sym@entry=65471) at ../ui/vnc.c:2034
 #3  0x00005555559f845c in ext_key_event (vs=0x5555579045c0, down=1, sym=65471, keycode=<optimized out>) at ../ui/vnc.c:2070
 #4  protocol_client_msg (vs=0x5555579045c0, data=<optimized out>, len=<optimized out>) at ../ui/vnc.c:2514
 #5  0x00005555559f515c in vnc_client_read (vs=0x5555579045c0) at ../ui/vnc.c:1607
---
 ui/vnc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/vnc.c +1 -1
index b59af625dd..93a8dbd253 100644
@@ -1935,7 +1935,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
     }
 
     qkbd_state_key_event(vs->vd->kbd, qcode, down);
-    if (!qemu_console_is_graphic(vs->vd->dcl.con)) {
+    if (QEMU_IS_TEXT_CONSOLE(vs->vd->dcl.con)) {
         QemuTextConsole *con = QEMU_TEXT_CONSOLE(vs->vd->dcl.con);
         bool numlock = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK);
         bool control = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CTRL);
Signature · 1 line
2.39.5
#8 lore raw

[PULL 10/23] linux-user: Remove unused handle_vm86_fault

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

handle_vm86_fault has been unused since:
1ade5b2fed ("linux-user/i386: Split out maybe_handle_vm86_trap")

Remove it, and it's local macros.

---
 linux-user/user-internals.h |   1 -
 linux-user/vm86.c           | 136 ------------------------------------
 2 files changed, 137 deletions(-)
linux-user/user-internals.h +0 -1
index 5c7f173ceb..46ffc093f4 100644
@@ -102,7 +102,6 @@ int host_to_target_waitstatus(int status);
 /* vm86.c */
 void save_v86_state(CPUX86State *env);
 void handle_vm86_trap(CPUX86State *env, int trapno);
-void handle_vm86_fault(CPUX86State *env);
 int do_vm86(CPUX86State *env, long subfunction, abi_ulong v86_addr);
 #elif defined(TARGET_SPARC64)
 void sparc64_set_context(CPUSPARCState *env);
linux-user/vm86.c +0 -136

142 lines not on this page · raw message

Signature · 1 line
2.39.5
#9 lore raw

Re: [PULL 10/23] linux-user: Remove unused handle_vm86_fault

Quoted 161 lines · Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

handle_vm86_fault has been unused since:

   1ade5b2fed ("linux-user/i386: Split out maybe_handle_vm86_trap")

Remove it, and it's local macros.

---
  linux-user/user-internals.h |   1 -
  linux-user/vm86.c           | 136 ------------------------------------
  2 files changed, 137 deletions(-)
linux-user/user-internals.h +0 -1
index 5c7f173ceb..46ffc093f4 100644
@@ -102,7 +102,6 @@ int host_to_target_waitstatus(int status);
  /* vm86.c */
  void save_v86_state(CPUX86State *env);
  void handle_vm86_trap(CPUX86State *env, int trapno);
-void handle_vm86_fault(CPUX86State *env);
  int do_vm86(CPUX86State *env, long subfunction, abi_ulong v86_addr);
  #elif defined(TARGET_SPARC64)
  void sparc64_set_context(CPUSPARCState *env);
linux-user/vm86.c +0 -125
index 9f512a2242..31a2d707cf 100644
@@ -255,142 +255,6 @@ void handle_vm86_trap(CPUX86State *env, int trapno)
      }
  }
 
-#define CHECK_IF_IN_TRAP() \
-      if ((ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_active) && \
-          (ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_TFpendig)) \
-                newflags |= TF_MASK
-
-#define VM86_FAULT_RETURN \
-        if ((ts->vm86plus.vm86plus.flags & TARGET_force_return_for_pic) && \
-            (ts->v86flags & (IF_MASK | VIF_MASK))) \
-            return_to_32bit(env, TARGET_VM86_PICRETURN); \
-        return
-
-void handle_vm86_fault(CPUX86State *env)
-{
-    CPUState *cs = env_cpu(env);
-    TaskState *ts = get_task_state(cs);
-    uint32_t csp, ssp;
-    unsigned int ip, sp, newflags, newip, newcs, opcode, intno;
-    int data32, pref_done;
-
-    csp = env->segs[R_CS].selector << 4;
-    ip = env->eip & 0xffff;
-
-    ssp = env->segs[R_SS].selector << 4;
-    sp = env->regs[R_ESP] & 0xffff;
-
-    LOG_VM86("VM86 exception %04x:%08x\n",
-             env->segs[R_CS].selector, env->eip);
-
-    data32 = 0;
-    pref_done = 0;
-    do {
-        opcode = vm_getb(env, csp, ip);
-        ADD16(ip, 1);
-        switch (opcode) {
-        case 0x66:      /* 32-bit data */     data32=1; break;
-        case 0x67:      /* 32-bit address */  break;
-        case 0x2e:      /* CS */              break;
-        case 0x3e:      /* DS */              break;
-        case 0x26:      /* ES */              break;
-        case 0x36:      /* SS */              break;
-        case 0x65:      /* GS */              break;
-        case 0x64:      /* FS */              break;
-        case 0xf2:      /* repnz */	      break;
-        case 0xf3:      /* rep */             break;
-        default: pref_done = 1;
-        }
-    } while (!pref_done);
-
-    /* VM86 mode */
-    switch(opcode) {
-    case 0x9c: /* pushf */
-        if (data32) {
-            vm_putl(env, ssp, sp - 4, get_vflags(env));
-            ADD16(env->regs[R_ESP], -4);
-        } else {
-            vm_putw(env, ssp, sp - 2, get_vflags(env));
-            ADD16(env->regs[R_ESP], -2);
-        }
-        env->eip = ip;
-        VM86_FAULT_RETURN;
-
-    case 0x9d: /* popf */
-        if (data32) {
-            newflags = vm_getl(env, ssp, sp);
-            ADD16(env->regs[R_ESP], 4);
-        } else {
-            newflags = vm_getw(env, ssp, sp);
-            ADD16(env->regs[R_ESP], 2);
-        }
-        env->eip = ip;
-        CHECK_IF_IN_TRAP();
-        if (data32) {
-            if (set_vflags_long(newflags, env))
-                return;
-        } else {
-            if (set_vflags_short(newflags, env))
-                return;
-        }
-        VM86_FAULT_RETURN;
-
-    case 0xcd: /* int */
-        intno = vm_getb(env, csp, ip);
-        ADD16(ip, 1);
-        env->eip = ip;
-        if (ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_active) {
-            if ( (ts->vm86plus.vm86plus.vm86dbg_intxxtab[intno >> 3] >>
-                  (intno &7)) & 1) {
-                return_to_32bit(env, TARGET_VM86_INTx + (intno << 8));
-                return;
-            }
-        }
-        do_int(env, intno);
-        break;
-
-    case 0xcf: /* iret */
-        if (data32) {
-            newip = vm_getl(env, ssp, sp) & 0xffff;
-            newcs = vm_getl(env, ssp, sp + 4) & 0xffff;
-            newflags = vm_getl(env, ssp, sp + 8);
-            ADD16(env->regs[R_ESP], 12);
-        } else {
-            newip = vm_getw(env, ssp, sp);
-            newcs = vm_getw(env, ssp, sp + 2);
-            newflags = vm_getw(env, ssp, sp + 4);
-            ADD16(env->regs[R_ESP], 6);
-        }
-        env->eip = newip;
-        cpu_x86_load_seg(env, R_CS, newcs);
-        CHECK_IF_IN_TRAP();
-        if (data32) {
-            if (set_vflags_long(newflags, env))
-                return;
-        } else {
-            if (set_vflags_short(newflags, env))
-                return;
-        }
-        VM86_FAULT_RETURN;
-
-    case 0xfa: /* cli */
-        env->eip = ip;
-        clear_IF(env);
-        VM86_FAULT_RETURN;
-
-    case 0xfb: /* sti */
-        env->eip = ip;

linux-user/vm86.c void handle_vm86_trap(CPUX86State *env, int trapno) · line 392

Quoted 10 lines
linux-user/vm86.c +0 -10
-        if (set_IF(env))
-            return;
-        VM86_FAULT_RETURN;
-
-    default:
-        /* real VM86 GPF exception */
-        return_to_32bit(env, TARGET_VM86_UNKNOWN);
-        break;
-    }
-}

FYI, looks like this broke compiling with Clang:

../../devel/qemu/linux-user/vm86.c:50:20: error: unused function 'vm_putl' [-Werror,-Wunused-function]
50 | static inline void vm_putl(CPUX86State *env, uint32_t segptr,

      |                    ^~~~~~~

../../devel/qemu/linux-user/vm86.c:56:28: error: unused function 'vm_getb' [-Werror,-Wunused-function]
56 | static inline unsigned int vm_getb(CPUX86State *env,
| ^~~~~~~
../../devel/qemu/linux-user/vm86.c:62:28: error: unused function 'vm_getw' [-Werror,-Wunused-function]
62 | static inline unsigned int vm_getw(CPUX86State *env,
| ^~~~~~~
../../devel/qemu/linux-user/vm86.c:68:28: error: unused function 'vm_getl' [-Werror,-Wunused-function]
68 | static inline unsigned int vm_getl(CPUX86State *env,
| ^~~~~~~
../../devel/qemu/linux-user/vm86.c:165:19: error: unused function 'set_vflags_long' [-Werror,-Wunused-function]
165 | static inline int set_vflags_long(unsigned long eflags, CPUX86State
*env)

      |                   ^~~~~~~~~~~~~~~
../../devel/qemu/linux-user/vm86.c:179:19: error: unused function 'set_vflags_short' [-Werror,-Wunused-function]
  179 | static inline int set_vflags_short(unsigned short flags, 
CPUX86State *env)
      |                   ^~~~~~~~~~~~~~~~

6 errors generated.

Should be easy to fix, I guess..

Thomas

#10 lore raw

Re: [PULL 10/23] linux-user: Remove unused handle_vm86_fault

Quoted 6 lines · Thomas Huth
Quoted 5 lines · Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

handle_vm86_fault has been unused since:
   1ade5b2fed ("linux-user/i386: Split out maybe_handle_vm86_trap")

Quoted 8 lines
Quoted 1 line

Remove it, and it's local macros.

FYI, looks like this broke compiling with Clang:

../../devel/qemu/linux-user/vm86.c:50:20: error: unused function 'vm_putl' [-Werror,-Wunused-function]
   50 | static inline void vm_putl(CPUX86State *env, uint32_t segptr,
      |                    ^~~~~~~
../../devel/qemu/linux-user/vm86.c:56:28: error: unused function 'vm_getb' [-Werror,-Wunused-function]

...

Hm. I built it with clang before sending the MR. But it was clang16 - the most recent one on bookworm. It does not show this issue :)

Apparently I should upgrade clang somehow.

Thank you for the fix!

/mjt

#11 lore raw

[PULL 09/23] hw/char: Remove unused serial_set_frequency

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

serial_set_frequnecy has been unused since it was added in 2009:
038eaf82c8 ("serial: Add interface to set reference oscillator frequency")

It looks like the 'baudbase' is now a property anyway so the wrapper isn't needed.

Remove it.

---
 hw/char/serial.c         | 7 -------
 include/hw/char/serial.h | 2 --
 2 files changed, 9 deletions(-)
hw/char/serial.c +0 -7
index d8b2db5082..6c5c4a23c7 100644
@@ -951,13 +951,6 @@ static void serial_unrealize(DeviceState *dev)
     qemu_unregister_reset(serial_reset, s);
 }
 
-/* Change the main reference oscillator frequency. */
-void serial_set_frequency(SerialState *s, uint32_t frequency)
-{
-    s->baudbase = frequency;
-    serial_update_parameters(s);
-}
-
 const MemoryRegionOps serial_io_ops = {
     .read = serial_ioport_read,
     .write = serial_ioport_write,
include/hw/char/serial.h +0 -2
index 6e14099ee7..40aad21df3 100644
@@ -93,8 +93,6 @@ struct SerialMM {
 extern const VMStateDescription vmstate_serial;
 extern const MemoryRegionOps serial_io_ops;
 
-void serial_set_frequency(SerialState *s, uint32_t frequency);
-
 #define TYPE_SERIAL "serial"
 OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL)
 
Signature · 1 line
2.39.5
#12 lore raw

[PULL 04/23] MAINTAINERS: remove gensyscalls.sh from the linux-user section

In reply to Michael Tokarev

From: Laurent Vivier <[email protected]>

The file has been removed by c52e40596834 ("linux-user,loongarch: move to syscalltbl file").

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 4ee2699543..d013db1ccb 100644
@@ -3685,7 +3685,6 @@ F: configs/targets/*linux-user.mak
 F: scripts/qemu-binfmt-conf.sh
 F: scripts/update-syscalltbl.sh
 F: scripts/update-mips-syscall-args.sh
-F: scripts/gensyscalls.sh
 
 Tiny Code Generator (TCG)
 -------------------------
Signature · 1 line
2.39.5
#13 lore raw

[PULL 11/23] hw: Remove unused fw_cfg_init_io

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

fw_cfg_init_io has been unused since
918a7f706b ("i386: load kernel on xen using DMA")

Remove it.

---
 hw/nvram/fw_cfg.c         | 5 -----
 include/hw/nvram/fw_cfg.h | 1 -
 2 files changed, 6 deletions(-)
hw/nvram/fw_cfg.c +0 -5
index 2dadfd6e1f..b644577734 100644
@@ -1171,11 +1171,6 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     return s;
 }
 
-FWCfgState *fw_cfg_init_io(uint32_t iobase)
-{
-    return fw_cfg_init_io_dma(iobase, 0, NULL);
-}
-
 FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
                                  hwaddr data_addr, uint32_t data_width,
                                  hwaddr dma_addr, AddressSpace *dma_as)
include/hw/nvram/fw_cfg.h +0 -1
index d173998803..fa42677619 100644
@@ -321,7 +321,6 @@ void fw_cfg_add_extra_pci_roots(PCIBus *bus, FWCfgState *s);
 
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
                                 AddressSpace *dma_as);
-FWCfgState *fw_cfg_init_io(uint32_t iobase);
 FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
 FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
                                  hwaddr data_addr, uint32_t data_width,
Signature · 1 line
2.39.5
#14 lore raw

[PULL 12/23] ui/cursor: remove cursor_get_mono_image

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

cursor_get_mono_image has been unused since 2018's
0015ca5cba ("ui: remove support for SDL1.2 in favour of SDL2")

Remove it.

---
 include/ui/console.h |  1 -
 ui/cursor.c          | 24 ------------------------
 2 files changed, 25 deletions(-)
include/ui/console.h +0 -1
index fa986ab97e..5832d52a8a 100644
@@ -175,7 +175,6 @@ int cursor_get_mono_bpl(QEMUCursor *c);
 void cursor_set_mono(QEMUCursor *c,
                      uint32_t foreground, uint32_t background, uint8_t *image,
                      int transparent, uint8_t *mask);
-void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
 void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
 
 typedef void *QEMUGLContext;
ui/cursor.c +0 -24
index dd3853320d..6e23244fbe 100644
@@ -197,30 +197,6 @@ void cursor_set_mono(QEMUCursor *c,
     }
 }
 
-void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *image)
-{
-    uint32_t *data = c->data;
-    uint8_t bit;
-    int x,y,bpl;
-
-    bpl = cursor_get_mono_bpl(c);
-    memset(image, 0, bpl * c->height);
-    for (y = 0; y < c->height; y++) {
-        bit = 0x80;
-        for (x = 0; x < c->width; x++, data++) {
-            if (((*data & 0xff000000) == 0xff000000) &&
-                ((*data & 0x00ffffff) == foreground)) {
-                image[x/8] |= bit;
-            }
-            bit >>= 1;
-            if (bit == 0) {
-                bit = 0x80;
-            }
-        }
-        image += bpl;
-    }
-}
-
 void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask)
 {
     uint32_t *data = c->data;
Signature · 1 line
2.39.5
#15 lore raw

[PULL 13/23] vhost: Remove unused vhost_dev_{load|save}_inflight

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

vhost_dev_load_inflight and vhost_dev_save_inflight have been unused since they were added in 2019 by:

5ad204bf2a ("vhost-user: Support transferring inflight buffer between qemu and backend")

Remove them, and their helper vhost_dev_resize_inflight.

---
 hw/virtio/vhost.c         | 56 ---------------------------------------
 include/hw/virtio/vhost.h |  2 --
 2 files changed, 58 deletions(-)
hw/virtio/vhost.c +0 -56
index 7c5ef81b55..76f9b2aaad 100644
@@ -1930,62 +1930,6 @@ void vhost_dev_free_inflight(struct vhost_inflight *inflight)
     }
 }
 
-static int vhost_dev_resize_inflight(struct vhost_inflight *inflight,
-                                     uint64_t new_size)
-{
-    Error *err = NULL;
-    int fd = -1;
-    void *addr = qemu_memfd_alloc("vhost-inflight", new_size,
-                                  F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL,
-                                  &fd, &err);
-
-    if (err) {
-        error_report_err(err);
-        return -ENOMEM;
-    }
-
-    vhost_dev_free_inflight(inflight);
-    inflight->offset = 0;
-    inflight->addr = addr;
-    inflight->fd = fd;
-    inflight->size = new_size;
-
-    return 0;
-}
-
-void vhost_dev_save_inflight(struct vhost_inflight *inflight, QEMUFile *f)
-{
-    if (inflight->addr) {
-        qemu_put_be64(f, inflight->size);
-        qemu_put_be16(f, inflight->queue_size);
-        qemu_put_buffer(f, inflight->addr, inflight->size);
-    } else {
-        qemu_put_be64(f, 0);
-    }
-}
-
-int vhost_dev_load_inflight(struct vhost_inflight *inflight, QEMUFile *f)
-{
-    uint64_t size;
-
-    size = qemu_get_be64(f);
-    if (!size) {
-        return 0;
-    }
-
-    if (inflight->size != size) {
-        int ret = vhost_dev_resize_inflight(inflight, size);
-        if (ret < 0) {
-            return ret;
-        }
-    }
-    inflight->queue_size = qemu_get_be16(f);
-
-    qemu_get_buffer(f, inflight->addr, size);
-
-    return 0;
-}
-
 int vhost_dev_prepare_inflight(struct vhost_dev *hdev, VirtIODevice *vdev)
 {
     int r;
include/hw/virtio/vhost.h +0 -2
index c75be46c06..461c168c37 100644
@@ -338,8 +338,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev,
 
 void vhost_dev_reset_inflight(struct vhost_inflight *inflight);
 void vhost_dev_free_inflight(struct vhost_inflight *inflight);
-void vhost_dev_save_inflight(struct vhost_inflight *inflight, QEMUFile *f);
-int vhost_dev_load_inflight(struct vhost_inflight *inflight, QEMUFile *f);
 int vhost_dev_prepare_inflight(struct vhost_dev *hdev, VirtIODevice *vdev);
 int vhost_dev_set_inflight(struct vhost_dev *dev,
                            struct vhost_inflight *inflight);
Signature · 1 line
2.39.5
#16 lore raw

[PULL 14/23] remote: Remove unused remote_iohub_finalize

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

remote_iohub_finalize has never been used.

Remove it.

---
 hw/remote/iohub.c         | 13 -------------
 include/hw/remote/iohub.h |  1 -
 2 files changed, 14 deletions(-)
hw/remote/iohub.c +0 -13
index 40dfee4bad..988d3285cc 100644
@@ -33,19 +33,6 @@ void remote_iohub_init(RemoteIOHubState *iohub)
     }
 }
 
-void remote_iohub_finalize(RemoteIOHubState *iohub)
-{
-    int pirq;
-
-    for (pirq = 0; pirq < REMOTE_IOHUB_NB_PIRQS; pirq++) {
-        qemu_set_fd_handler(event_notifier_get_fd(&iohub->resamplefds[pirq]),
-                            NULL, NULL, NULL);
-        event_notifier_cleanup(&iohub->irqfds[pirq]);
-        event_notifier_cleanup(&iohub->resamplefds[pirq]);
-        qemu_mutex_destroy(&iohub->irq_level_lock[pirq]);
-    }
-}
-
 int remote_iohub_map_irq(PCIDevice *pci_dev, int intx)
 {
     return pci_dev->devfn;
include/hw/remote/iohub.h +0 -1
index 6a8444f9a9..09ee6c77b6 100644
@@ -37,6 +37,5 @@ void remote_iohub_set_irq(void *opaque, int pirq, int level);
 void process_set_irqfd_msg(PCIDevice *pci_dev, MPQemuMsg *msg);
 
 void remote_iohub_init(RemoteIOHubState *iohub);
-void remote_iohub_finalize(RemoteIOHubState *iohub);
 
 #endif
Signature · 1 line
2.39.5
#17 lore raw

[PULL 15/23] replay: Remove unused replay_disable_events

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

replay_disable_events has been unused since 2019's
c8aa7895eb ("replay: don't drain/flush bdrv queue while RR is working")

Remove it.

---
 include/sysemu/replay.h | 2 --
 replay/replay-events.c  | 9 ---------
 2 files changed, 11 deletions(-)
include/sysemu/replay.h +0 -2
index 8102fa54f0..cba74fa9bc 100644
@@ -117,8 +117,6 @@ void replay_async_events(void);
 
 /* Asynchronous events queue */
 
-/*! Disables storing events in the queue */
-void replay_disable_events(void);
 /*! Enables storing events in the queue */
 void replay_enable_events(void);
 /*! Returns true when saving events is enabled */
replay/replay-events.c +0 -9
index af0721cc1a..2e46eda6bf 100644
@@ -92,15 +92,6 @@ void replay_flush_events(void)
     }
 }
 
-void replay_disable_events(void)
-{
-    if (replay_mode != REPLAY_MODE_NONE) {
-        events_enabled = false;
-        /* Flush events queue before waiting of completion */
-        replay_flush_events();
-    }
-}
-
 /*! Adds specified async event to the queue */
 void replay_add_event(ReplayAsyncEventKind event_kind,
                       void *opaque,
Signature · 1 line
2.39.5
#18 lore raw

[PULL 16/23] hw/pci: Remove unused pcie_chassis_find_slot

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

pcie_chassis_find_slot has been unused since it was added.

Remove it.

---
 hw/pci/pcie_port.c         | 10 ----------
 include/hw/pci/pcie_port.h |  1 -
 2 files changed, 11 deletions(-)
hw/pci/pcie_port.c +0 -10
index 20ff2b39e8..9f978ba164 100644
@@ -92,16 +92,6 @@ static PCIESlot *pcie_chassis_find_slot_with_chassis(struct PCIEChassis *c,
     return s;
 }
 
-PCIESlot *pcie_chassis_find_slot(uint8_t chassis_number, uint16_t slot)
-{
-    struct PCIEChassis *c;
-    c = pcie_chassis_find(chassis_number);
-    if (!c) {
-        return NULL;
-    }
-    return pcie_chassis_find_slot_with_chassis(c, slot);
-}
-
 int pcie_chassis_add_slot(struct PCIESlot *slot)
 {
     struct PCIEChassis *c;
include/hw/pci/pcie_port.h +0 -1
index 90e6cf45b8..7cd7af8cfa 100644
@@ -72,7 +72,6 @@ struct PCIESlot {
 };
 
 void pcie_chassis_create(uint8_t chassis_number);
-PCIESlot *pcie_chassis_find_slot(uint8_t chassis, uint16_t slot);
 int pcie_chassis_add_slot(struct PCIESlot *slot);
 void pcie_chassis_del_slot(PCIESlot *s);
 
Signature · 1 line
2.39.5
#19 lore raw

[PULL 17/23] hw/net/rocker: Remove unused rocker_fp_ports

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

rocker_fp_ports hasn't been used since it was added back in 2015. Remove it.

---
 hw/net/rocker/rocker.c | 5 -----
 hw/net/rocker/rocker.h | 1 -
 2 files changed, 6 deletions(-)
hw/net/rocker/rocker.c +0 -5
index 1ab5852113..5e74acc969 100644
@@ -134,11 +134,6 @@ RockerPortList *qmp_query_rocker_ports(const char *name, Error **errp)
     return list;
 }
 
-uint32_t rocker_fp_ports(Rocker *r)
-{
-    return r->fp_ports;
-}
-
 static uint32_t rocker_get_pport_by_tx_ring(Rocker *r,
                                             DescRing *ring)
 {
hw/net/rocker/rocker.h +0 -1
index f85354d9d1..6e0962f47a 100644
@@ -72,7 +72,6 @@ DECLARE_INSTANCE_CHECKER(Rocker, ROCKER,
                          TYPE_ROCKER)
 
 Rocker *rocker_find(const char *name);
-uint32_t rocker_fp_ports(Rocker *r);
 int rocker_event_link_changed(Rocker *r, uint32_t pport, bool link_up);
 int rocker_event_mac_vlan_seen(Rocker *r, uint32_t pport, uint8_t *addr,
                                uint16_t vlan_id);
Signature · 1 line
2.39.5
#20 lore raw

[PULL 18/23] block-backend: Remove deadcode

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

blk_by_public last use was removed in 2017 by
c61791fc23 ("block: add aio_context field in ThrottleGroupMember")

blk_activate last use was removed earlier this year by
eef0bae3a7 ("migration: Remove block migration")

blk_add_insert_bs_notifier, blk_op_block_all, blk_op_unblock_all last uses were removed in 2016 by
ef8875b549 ("virtio-scsi: Remove op blocker for dataplane")

blk_iostatus_disable last use was removed in 2016 by
66a0fae438 ("blockjob: Don't touch BDS iostatus")

Remove them.

---
 block/block-backend.c                       | 73 ---------------------
 include/sysemu/block-backend-global-state.h |  8 ---
 2 files changed, 81 deletions(-)
block/block-backend.c +0 -73
index db6f9b92a3..7bea43bf72 100644
@@ -853,15 +853,6 @@ BlockBackendPublic *blk_get_public(BlockBackend *blk)
     return &blk->public;
 }
 
-/*
- * Returns a BlockBackend given the associated @public fields.
- */
-BlockBackend *blk_by_public(BlockBackendPublic *public)
-{
-    GLOBAL_STATE_CODE();
-    return container_of(public, BlockBackend, public);
-}
-
 /*
  * Disassociates the currently associated BlockDriverState from @blk.
  */
@@ -1214,12 +1205,6 @@ BlockDeviceIoStatus blk_iostatus(const BlockBackend *blk)
     return blk->iostatus;
 }
 
-void blk_iostatus_disable(BlockBackend *blk)
-{
-    GLOBAL_STATE_CODE();
-    blk->iostatus_enabled = false;
-}
-
 void blk_iostatus_reset(BlockBackend *blk)
 {
     GLOBAL_STATE_CODE();
@@ -2228,28 +2213,6 @@ void blk_set_enable_write_cache(BlockBackend *blk, bool wce)
     blk->enable_write_cache = wce;
 }
 
-void blk_activate(BlockBackend *blk, Error **errp)
-{
-    BlockDriverState *bs = blk_bs(blk);
-    GLOBAL_STATE_CODE();
-
-    if (!bs) {
-        error_setg(errp, "Device '%s' has no medium", blk->name);
-        return;
-    }
-
-    /*
-     * Migration code can call this function in coroutine context, so leave
-     * coroutine context if necessary.
-     */
-    if (qemu_in_coroutine()) {
-        bdrv_co_activate(bs, errp);
-    } else {
-        GRAPH_RDLOCK_GUARD_MAINLOOP();
-        bdrv_activate(bs, errp);
-    }
-}
-
 bool coroutine_fn blk_co_is_inserted(BlockBackend *blk)
 {
     BlockDriverState *bs = blk_bs(blk);
@@ -2380,36 +2343,6 @@ bool blk_op_is_blocked(BlockBackend *blk, BlockOpType op, Error **errp)
     return bdrv_op_is_blocked(bs, op, errp);
 }
 
-void blk_op_unblock(BlockBackend *blk, BlockOpType op, Error *reason)
-{
-    BlockDriverState *bs = blk_bs(blk);
-    GLOBAL_STATE_CODE();
-
-    if (bs) {
-        bdrv_op_unblock(bs, op, reason);
-    }
-}
-
-void blk_op_block_all(BlockBackend *blk, Error *reason)
-{
-    BlockDriverState *bs = blk_bs(blk);
-    GLOBAL_STATE_CODE();
-
-    if (bs) {
-        bdrv_op_block_all(bs, reason);
-    }
-}
-
-void blk_op_unblock_all(BlockBackend *blk, Error *reason)
-{
-    BlockDriverState *bs = blk_bs(blk);
-    GLOBAL_STATE_CODE();
-
-    if (bs) {
-        bdrv_op_unblock_all(bs, reason);
-    }
-}
-
 /**
  * Return BB's current AioContext.  Note that this context may change
  * concurrently at any time, with one exception: If the BB has a root node
@@ -2564,12 +2497,6 @@ void blk_add_remove_bs_notifier(BlockBackend *blk, Notifier *notify)
     notifier_list_add(&blk->remove_bs_notifiers, notify);
 }
 
-void blk_add_insert_bs_notifier(BlockBackend *blk, Notifier *notify)
-{
-    GLOBAL_STATE_CODE();
-    notifier_list_add(&blk->insert_bs_notifiers, notify);
-}
-
 BlockAcctStats *blk_get_stats(BlockBackend *blk)
 {
     IO_CODE();
include/sysemu/block-backend-global-state.h +0 -8
index 49c12b0fa9..9cc9b008ec 100644
@@ -54,7 +54,6 @@ bool monitor_add_blk(BlockBackend *blk, const char *name, Error **errp);
 void monitor_remove_blk(BlockBackend *blk);
 
 BlockBackendPublic *blk_get_public(BlockBackend *blk);
-BlockBackend *blk_by_public(BlockBackendPublic *public);
 
 void blk_remove_bs(BlockBackend *blk);
 int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp);
@@ -67,7 +66,6 @@ void blk_get_perm(BlockBackend *blk, uint64_t *perm, uint64_t *shared_perm);
 
 void blk_iostatus_enable(BlockBackend *blk);
 BlockDeviceIoStatus blk_iostatus(const BlockBackend *blk);
-void blk_iostatus_disable(BlockBackend *blk);
 void blk_iostatus_reset(BlockBackend *blk);
 int blk_attach_dev(BlockBackend *blk, DeviceState *dev);
 void blk_detach_dev(BlockBackend *blk, DeviceState *dev);
@@ -76,8 +74,6 @@ BlockBackend *blk_by_dev(void *dev);
 BlockBackend *blk_by_qdev_id(const char *id, Error **errp);
 void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaque);
 
-void blk_activate(BlockBackend *blk, Error **errp);
-
 int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags);
 void blk_aio_cancel(BlockAIOCB *acb);
 int blk_commit_all(void);
@@ -91,9 +87,6 @@ bool blk_is_sg(BlockBackend *blk);
 void blk_set_enable_write_cache(BlockBackend *blk, bool wce);
 int blk_get_flags(BlockBackend *blk);
 bool blk_op_is_blocked(BlockBackend *blk, BlockOpType op, Error **errp);
-void blk_op_unblock(BlockBackend *blk, BlockOpType op, Error *reason);
-void blk_op_block_all(BlockBackend *blk, Error *reason);
-void blk_op_unblock_all(BlockBackend *blk, Error *reason);
 int blk_set_aio_context(BlockBackend *blk, AioContext *new_context,
                         Error **errp);
 void blk_add_aio_context_notifier(BlockBackend *blk,
@@ -105,7 +98,6 @@ void blk_remove_aio_context_notifier(BlockBackend *blk,
                                      void (*detach_aio_context)(void *),
                                      void *opaque);
 void blk_add_remove_bs_notifier(BlockBackend *blk, Notifier *notify);
-void blk_add_insert_bs_notifier(BlockBackend *blk, Notifier *notify);
 BlockBackendRootState *blk_get_root_state(BlockBackend *blk);
 void blk_update_root_state(BlockBackend *blk);
 bool blk_get_detect_zeroes_from_root_state(BlockBackend *blk);
Signature · 1 line
2.39.5
#21 lore raw

[PULL 19/23] tests/tcg/plugins: Remove remainder of the cris target

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The cris target has recently been removed (see commit 44e4075bf4 - "target/cris: Remove the deprecated CRIS target"), but apparently this line has been forgotten. So clean it up now.

---
 tests/tcg/plugins/syscall.c | 1 -
 1 file changed, 1 deletion(-)
tests/tcg/plugins/syscall.c +0 -1
index 89dc7f49b1..ff452178b1 100644
@@ -34,7 +34,6 @@ static const struct SyscallInfo arch_syscall_info[] = {
     { "arm", 4 },
     { "armeb", 4 },
     { "avr", -1 },
-    { "cris", -1 },
     { "hexagon", 64 },
     { "hppa", -1 },
     { "i386", 4 },
Signature · 1 line
2.39.5
#22 lore raw

[PULL 20/23] hw/mips: Build fw_cfg.c once

In reply to Michael Tokarev

From: Philippe Mathieu-Daudé <[email protected]>

Nothing in fw_cfg.c requires target-specific knowledge, build it once for the 4 MIPS variants.

---
 hw/mips/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/meson.build +1 -1
index ca37c42d90..fcbee53bb3 100644
@@ -1,6 +1,6 @@
 mips_ss = ss.source_set()
 mips_ss.add(files('bootloader.c', 'mips_int.c'))
-mips_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c'))
+common_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c'))
 mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c', 'loongson3_virt.c'))
 mips_ss.add(when: 'CONFIG_MALTA', if_true: files('malta.c'))
 mips_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('cps.c'))
Signature · 1 line
2.39.5
#23 lore raw

[PULL 21/23] tests/functional: Fix hash validation

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The _check() function is supposed to check whether the hash of the downloaded file matches the expected one. Unfortunately, during the last rework of this function, the check was accidentally turned into returning the hash value itself instead of a True/False value, effectively accepting each hash as valid. Let's do a proper check again now.

Fixes 05e303210d ("tests/functional/qemu_test: Use Python hashlib ...")
---
 tests/functional/qemu_test/asset.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/functional/qemu_test/asset.py +1 -1
index 3ec429217e..e47bfac035 100644
@@ -57,7 +57,7 @@ def _check(self, cache_file):
                     break
                 hl.update(chunk)
 
-        return  hl.hexdigest()
+        return self.hash == hl.hexdigest()
 
     def valid(self):
         return self.cache_file.exists() and self._check(self.cache_file)
Signature · 1 line
2.39.5
#24 lore raw

[PULL 23/23] MAINTAINERS: Add myself as maintainer of e500 machines

In reply to Michael Tokarev

From: Bernhard Beschow <[email protected]>

---
 MAINTAINERS | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
MAINTAINERS +4 -2
index d013db1ccb..34fffcb5be 100644
@@ -1378,8 +1378,9 @@ F: hw/pci-host/ppc4xx_pci.c
 F: tests/functional/test_ppc_bamboo.py
 
 e500
+M: Bernhard Beschow <[email protected]>
 L: [email protected]
-S: Orphan
+S: Odd Fixes
 F: hw/ppc/e500*
 F: hw/ppc/ppce500_spin.c
 F: hw/gpio/mpc8xxx.c
@@ -1395,8 +1396,9 @@ F: docs/system/ppc/ppce500.rst
 F: tests/functional/test_ppc64_e500.py
 
 mpc8544ds
+M: Bernhard Beschow <[email protected]>
 L: [email protected]
-S: Orphan
+S: Odd Fixes
 F: hw/ppc/mpc8544ds.c
 F: hw/ppc/mpc8544_guts.c
 F: tests/functional/test_ppc_mpc8544ds.py
Signature · 1 line
2.39.5
#25 lore raw

[PULL 22/23] docs/devel: Mention post_load hook restrictions where we document the hook

In reply to Michael Tokarev

From: Peter Maydell <[email protected]>

Accessing another device in a post_load hook is a bad idea, because the order of device save/restore is not fixed, and so this cross-device access makes the save/restore non-deterministic.

We previously only flagged up this requirement in the record-and-replay developer docs; repeat it in the main migration documentation, where a developer trying to implement a post_load hook is more likely to see it.

---
 docs/devel/migration/main.rst | 6 ++++++
 docs/devel/replay.rst         | 3 +++
 2 files changed, 9 insertions(+)
docs/devel/migration/main.rst +6 -0
index 784c899dca..c2857fc244 100644
@@ -465,6 +465,12 @@ Examples of such API functions are:
   - portio_list_set_address()
   - portio_list_set_enabled()
 
+Since the order of device save/restore is not defined, you must
+avoid accessing or changing any other device's state in one of these
+callbacks. (For instance, don't do anything that calls ``update_irq()``
+in a ``post_load`` hook.) Otherwise, restore will not be deterministic,
+and this will break execution record/replay.
+
 Iterative device migration
 --------------------------
 
docs/devel/replay.rst +3 -0
index effd856f0c..40f58d9d4f 100644
@@ -202,6 +202,9 @@ into the log.
 Saving/restoring the VM state
 -----------------------------
 
+Record/replay relies on VM state save and restore being complete and
+deterministic.
+
 All fields in the device state structure (including virtual timers)
 should be restored by loadvm to the same values they had before savevm.
 
Signature · 1 line
2.39.5
#26 lore raw
In reply to Michael Tokarev
Quoted 11 lines · Michael Tokarev

The following changes since commit 423be09ab9492735924e73a2d36069784441ebc6:

Merge tag 'warn-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2024-10-03 10:32:54 +0100)

are available in the Git repository at:

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 6b7d2f6e1896fb675e8518ed61c792d4dd92e034:

Quoted 8 lines

MAINTAINERS: Add myself as maintainer of e500 machines (2024-10-04 18:57:38 +0300)

----------------------------------------------------------------
trivial patches for 2024-10-04

- many dead code removals by Dr. David Alan Gilbert
- forgotten minor bugfixes (vnc, resource freeing in qemu-keymap)
- some more..

Applied, thanks.

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

-- PMM