aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-06-04 14:53:05 -0500
committerRichard Henderson <richard.henderson@linaro.org>2024-06-04 14:53:05 -0500
commitd16cab541ab9217977e2a39abf3d79f914146741 (patch)
tree5f96e6dbedd778c02e574f27cf4dff0eef2dc577 /hw
parent6e47f7cfcd78ed8e6f192cb0a4c61f209d0c2aaf (diff)
parent7c2397643c1e025c157bab95088b3b480f0d98ae (diff)
downloadqemu-d16cab541ab9217977e2a39abf3d79f914146741.zip
qemu-d16cab541ab9217977e2a39abf3d79f914146741.tar.gz
qemu-d16cab541ab9217977e2a39abf3d79f914146741.tar.bz2
Merge tag 'hw-misc-accel-20240604' of https://github.com/philmd/qemu into staging
Misc HW & accelerators patch queue - Use async exit in debugexit model (Thomas) - Fixed bug reading xlnx_dpdma descriptor (Peter) - Initialise plugin state before vCPU/thread creation (Alex) - Few sprintf() calls removed (Richard & Philippe) - Few deprecated QMP events removed (Philippe) - Housekeeping in Xen (Edgar & Philippe) - Split USB HID/HUB & update MAINTAINERS (Gerd) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmZe5FMACgkQ4+MsLN6t # wN5QghAAl1j5++wKcJaWoribnhxYctcBPhg3eEAwg2qVRbx5tz7HwYw8jYp+qB47 # abAtE3WOUg+Z+NaBi0bTj8Ns0wrBTZy0toJrQb+k5M9CzJJIFSURcFV2J40ORld8 # VHNKmzNN+ZscxAW3fSFruJlGLaskwB0bk9VF0cYSip2Y+xjbPlJZ8dlffX/HAvwB # Ul4gJW04FT3k6KoeJASNiAMm7mPW9iP4kY7rKz+j+NWydAfl8yPzxFwW6J6U2npi # Hvmy1519W74cftZSqxkBETtbw1YVKyT6QEA9HjJOjc05E6UYnxoR13taEzLNaDHA # B7Xhp6IUYZGRD1bt85WZCP5t5yUINLgmzJU2OQnv9dfU1HdSkk0FQiBr0Iif3tCI # /2cQumkGI4etXX77oVIwkioo0ZTvEggDNsN1eKHIY7yIE5etqXduPwnTfwHFI3lv # Nj18MGF0cftbYDEbUwNUnN5U6+msW3Si6hQaUxpUWXy7Idkl9pBiWjv1OpBg9PqX # YIuw9/USs7i8yZkh0/q8UcZxdzB3LF+LxjVVVoTVD6t+KbRSkJSOJm7hfqCKuXbC # lEmtLt+aH/pdZ2Banug1Ayen2L7s0czRHQWC++DfNQve1xEUkSFp5VE0mxsr+6Rp # 18/dSGo++Nh52jUt2QFEv9LyAAQCKxg72I9DW9sB7uC004+ub84= # =xcID # -----END PGP SIGNATURE----- # gpg: Signature made Tue 04 Jun 2024 04:54:27 AM CDT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] * tag 'hw-misc-accel-20240604' of https://github.com/philmd/qemu: (32 commits) usb: add config options for the hub and hid devices qga: Remove deprecated 'blacklist' argument / config key trace: Remove deprecated 'vcpu' field from QMP trace events hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event hw/dma/xlnx_dpdma: Read descriptor into buffer, not into pointer-to-buffer hw/misc/debugexit: use runstate API instead of plain exit() hw/xen: Register framebuffer backend via xen_backend_init() hw/xen: Make XenDevOps structures const hw/xen: Constify xenstore_be::XenDevOps hw/xen: Constify XenLegacyDevice::XenDevOps physmem: Replace check for RAMBlock offset 0 with xen_mr_is_memory physmem: Always pass offset + addr to xen_map_cache xen: Add xen_mr_is_memory() core/cpu-common: initialise plugin state before thread creation plugins: remove special casing for cpu->realized cpu-target: don't set cpu->thread_id to bogus value cpu: move Qemu[Thread|Cond] setup into common code hw/core: expand on the alignment of CPUState accel/kvm: Fix two lines with hard-coded tabs accel/tcg: Move common declarations to 'internal-common.h' ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/xen-9p-backend.c2
-rw-r--r--hw/acpi/memory_hotplug.c8
-rw-r--r--hw/core/cpu-common.c25
-rw-r--r--hw/display/xenfb.c13
-rw-r--r--hw/dma/xlnx_dpdma.c2
-rw-r--r--hw/misc/debugexit.c4
-rw-r--r--hw/ppc/spapr.c11
-rw-r--r--hw/usb/Kconfig10
-rw-r--r--hw/usb/meson.build4
-rw-r--r--hw/usb/xen-usb.c2
-rw-r--r--hw/virtio/trace-events2
-rw-r--r--hw/virtio/vhost-vdpa.c4
-rw-r--r--hw/xen/xen-hvm-common.c10
-rw-r--r--hw/xen/xen-legacy-backend.c8
-rw-r--r--hw/xenpv/xen_machine_pv.c2
15 files changed, 60 insertions, 47 deletions
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index a3ac53f..79359d9 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev)
xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER);
}
-static struct XenDevOps xen_9pfs_ops = {
+static const struct XenDevOps xen_9pfs_ops = {
.size = sizeof(Xen9pfsDev),
.flags = DEVOPS_FLAG_NEED_GNTDEV,
.alloc = xen_9pfs_alloc,
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index de6f974..9b974b7 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -178,14 +178,6 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
hotplug_handler_unplug(hotplug_ctrl, dev, &local_err);
if (local_err) {
trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector);
-
- /*
- * Send both MEM_UNPLUG_ERROR and DEVICE_UNPLUG_GUEST_ERROR
- * while the deprecation of MEM_UNPLUG_ERROR is
- * pending.
- */
- qapi_event_send_mem_unplug_error(dev->id ? : "",
- error_get_pretty(local_err));
qapi_event_send_device_unplug_guest_error(dev->id,
dev->canonical_path);
error_free(local_err);
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 0f0a247..bf1a7b8 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -222,14 +222,6 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
cpu_resume(cpu);
}
- /* Plugin initialization must wait until the cpu start executing code */
-#ifdef CONFIG_PLUGIN
- if (tcg_enabled()) {
- cpu->plugin_state = qemu_plugin_create_vcpu_state();
- async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL);
- }
-#endif
-
/* NOTE: latest generic point where the cpu is fully realized */
}
@@ -261,6 +253,11 @@ static void cpu_common_initfn(Object *obj)
cpu->nr_threads = 1;
cpu->cflags_next_tb = -1;
+ /* allocate storage for thread info, initialise condition variables */
+ cpu->thread = g_new0(QemuThread, 1);
+ cpu->halt_cond = g_new0(QemuCond, 1);
+ qemu_cond_init(cpu->halt_cond);
+
qemu_mutex_init(&cpu->work_mutex);
qemu_lockcnt_init(&cpu->in_ioctl_lock);
QSIMPLEQ_INIT(&cpu->work_list);
@@ -268,6 +265,18 @@ static void cpu_common_initfn(Object *obj)
QTAILQ_INIT(&cpu->watchpoints);
cpu_exec_initfn(cpu);
+
+ /*
+ * Plugin initialization must wait until the cpu start executing
+ * code, but we must queue this work before the threads are
+ * created to ensure we don't race.
+ */
+#ifdef CONFIG_PLUGIN
+ if (tcg_enabled()) {
+ cpu->plugin_state = qemu_plugin_create_vcpu_state();
+ async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL);
+ }
+#endif
}
static void cpu_common_finalize(Object *obj)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 27536bf..ff442ce 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -29,6 +29,7 @@
#include "ui/input.h"
#include "ui/console.h"
+#include "sysemu/sysemu.h"
#include "hw/xen/xen-legacy-backend.h"
#include "hw/xen/interface/io/fbif.h"
@@ -972,7 +973,7 @@ static void fb_event(struct XenLegacyDevice *xendev)
/* -------------------------------------------------------------------- */
-static struct XenDevOps xen_kbdmouse_ops = {
+static const struct XenDevOps xen_kbdmouse_ops = {
.size = sizeof(struct XenInput),
.init = input_init,
.initialise = input_initialise,
@@ -981,7 +982,7 @@ static struct XenDevOps xen_kbdmouse_ops = {
.event = input_event,
};
-struct XenDevOps xen_framebuffer_ops = {
+const struct XenDevOps xen_framebuffer_ops = {
.size = sizeof(struct XenFB),
.init = fb_init,
.initialise = fb_initialise,
@@ -996,8 +997,12 @@ static const GraphicHwOps xenfb_ops = {
.ui_info = xenfb_ui_info,
};
-static void xen_vkbd_register_backend(void)
+static void xen_ui_register_backend(void)
{
xen_be_register("vkbd", &xen_kbdmouse_ops);
+
+ if (vga_interface_type == VGA_XENFB) {
+ xen_be_register("vfb", &xen_framebuffer_ops);
+ }
}
-xen_backend_init(xen_vkbd_register_backend);
+xen_backend_init(xen_ui_register_backend);
diff --git a/hw/dma/xlnx_dpdma.c b/hw/dma/xlnx_dpdma.c
index dde4aec..a685bd2 100644
--- a/hw/dma/xlnx_dpdma.c
+++ b/hw/dma/xlnx_dpdma.c
@@ -619,7 +619,7 @@ static MemTxResult xlnx_dpdma_read_descriptor(XlnxDPDMAState *s,
DPDMADescriptor *desc)
{
MemTxResult res = dma_memory_read(&address_space_memory, desc_addr,
- &desc, sizeof(DPDMADescriptor),
+ desc, sizeof(DPDMADescriptor),
MEMTXATTRS_UNSPECIFIED);
if (res) {
return res;
diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c
index ab6de69..c5c562f 100644
--- a/hw/misc/debugexit.c
+++ b/hw/misc/debugexit.c
@@ -12,6 +12,7 @@
#include "hw/qdev-properties.h"
#include "qemu/module.h"
#include "qom/object.h"
+#include "sysemu/runstate.h"
#define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit"
OBJECT_DECLARE_SIMPLE_TYPE(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE)
@@ -32,7 +33,8 @@ static uint64_t debug_exit_read(void *opaque, hwaddr addr, unsigned size)
static void debug_exit_write(void *opaque, hwaddr addr, uint64_t val,
unsigned width)
{
- exit((val << 1) | 1);
+ qemu_system_shutdown_request_with_code(SHUTDOWN_CAUSE_GUEST_SHUTDOWN,
+ (val << 1) | 1);
}
static const MemoryRegionOps debug_exit_ops = {
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 4345764..81a187f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3786,7 +3786,6 @@ void spapr_memory_unplug_rollback(SpaprMachineState *spapr, DeviceState *dev)
SpaprDrc *drc;
uint32_t nr_lmbs;
uint64_t size, addr_start, addr;
- g_autofree char *qapi_error = NULL;
int i;
if (!dev) {
@@ -3823,16 +3822,8 @@ void spapr_memory_unplug_rollback(SpaprMachineState *spapr, DeviceState *dev)
/*
* Tell QAPI that something happened and the memory
- * hotunplug wasn't successful. Keep sending
- * MEM_UNPLUG_ERROR even while sending
- * DEVICE_UNPLUG_GUEST_ERROR until the deprecation of
- * MEM_UNPLUG_ERROR is due.
+ * hotunplug wasn't successful.
*/
- qapi_error = g_strdup_printf("Memory hotunplug rejected by the guest "
- "for device %s", dev->id);
-
- qapi_event_send_mem_unplug_error(dev->id ? : "", qapi_error);
-
qapi_event_send_device_unplug_guest_error(dev->id,
dev->canonical_path);
}
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index f569ed7..84bc7fb 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -65,6 +65,16 @@ config TUSB6010
bool
select USB_MUSB
+config USB_HUB
+ bool
+ default y
+ depends on USB
+
+config USB_HID
+ bool
+ default y
+ depends on USB
+
config USB_TABLET_WACOM
bool
default y
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 23f7f7a..d7de100 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -35,8 +35,8 @@ system_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-
system_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
# emulated usb devices
-system_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
-system_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
+system_ss.add(when: 'CONFIG_USB_HUB', if_true: files('dev-hub.c'))
+system_ss.add(when: 'CONFIG_USB_HID', if_true: files('dev-hid.c'))
system_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
system_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c'))
system_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 416623f..1390162 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -1083,7 +1083,7 @@ static void usbback_event(struct XenLegacyDevice *xendev)
qemu_bh_schedule(usbif->bh);
}
-static struct XenDevOps xen_usb_ops = {
+static const struct XenDevOps xen_usb_ops = {
.size = sizeof(struct usbback_info),
.flags = DEVOPS_FLAG_NEED_GNTDEV,
.init = usbback_init,
diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 96632fd..3cf84e0 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -50,7 +50,7 @@ vhost_vdpa_get_device_id(void *dev, uint32_t device_id) "dev: %p device_id %"PRI
vhost_vdpa_reset_device(void *dev) "dev: %p"
vhost_vdpa_get_vq_index(void *dev, int idx, int vq_idx) "dev: %p idx: %d vq idx: %d"
vhost_vdpa_set_vring_enable_one(void *dev, unsigned i, int enable, int r) "dev: %p, idx: %u, enable: %u, r: %d"
-vhost_vdpa_dump_config(void *dev, const char *line) "dev: %p %s"
+vhost_vdpa_dump_config(void *dev, unsigned ofs, const char *line) "dev: %p 0x%04x: %s"
vhost_vdpa_set_config(void *dev, uint32_t offset, uint32_t size, uint32_t flags) "dev: %p offset: %"PRIu32" size: %"PRIu32" flags: 0x%"PRIx32
vhost_vdpa_get_config(void *dev, void *config, uint32_t config_len) "dev: %p config: %p config_len: %"PRIu32
vhost_vdpa_suspend(void *dev) "dev: %p"
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index ed99ab8..7368b71 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -949,8 +949,8 @@ static void vhost_vdpa_dump_config(struct vhost_dev *dev, const uint8_t *config,
for (b = 0; b < config_len; b += 16) {
len = config_len - b;
- qemu_hexdump_line(line, b, config, len, false);
- trace_vhost_vdpa_dump_config(dev, line);
+ qemu_hexdump_line(line, config + b, len);
+ trace_vhost_vdpa_dump_config(dev, b, line);
}
}
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 2d1b032..a0a0252 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -12,6 +12,12 @@
MemoryRegion xen_memory;
+/* Check for xen memory. */
+bool xen_mr_is_memory(MemoryRegion *mr)
+{
+ return mr == &xen_memory;
+}
+
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
Error **errp)
{
@@ -28,7 +34,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
return;
}
- if (mr == &xen_memory) {
+ if (xen_mr_is_memory(mr)) {
return;
}
@@ -55,7 +61,7 @@ static void xen_set_memory(struct MemoryListener *listener,
{
XenIOState *state = container_of(listener, XenIOState, memory_listener);
- if (section->mr == &xen_memory) {
+ if (xen_mr_is_memory(section->mr)) {
return;
} else {
if (add) {
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 6f0b300..5514184 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -170,7 +170,7 @@ int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev,
*/
static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom,
int dev,
- struct XenDevOps *ops)
+ const struct XenDevOps *ops)
{
struct XenLegacyDevice *xendev;
@@ -520,7 +520,7 @@ void xen_be_check_state(struct XenLegacyDevice *xendev)
struct xenstore_be {
const char *type;
int dom;
- struct XenDevOps *ops;
+ const struct XenDevOps *ops;
};
static void xenstore_update_be(void *opaque, const char *watch)
@@ -557,7 +557,7 @@ static void xenstore_update_be(void *opaque, const char *watch)
}
}
-static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
+static int xenstore_scan(const char *type, int dom, const struct XenDevOps *ops)
{
struct XenLegacyDevice *xendev;
char path[XEN_BUFSIZE];
@@ -624,7 +624,7 @@ void xen_be_init(void)
xen_set_dynamic_sysbus();
}
-int xen_be_register(const char *type, struct XenDevOps *ops)
+int xen_be_register(const char *type, const struct XenDevOps *ops)
{
char path[50];
diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c
index b500ce0..24395f4 100644
--- a/hw/xenpv/xen_machine_pv.c
+++ b/hw/xenpv/xen_machine_pv.c
@@ -50,8 +50,6 @@ static void xen_init_pv(MachineState *machine)
break;
}
- xen_be_register("vfb", &xen_framebuffer_ops);
-
/* configure framebuffer */
if (vga_interface_type == VGA_XENFB) {
xen_config_dev_vfb(0, "vnc");