aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorRorie Reyes <rreyes@linux.ibm.com>2025-06-09 12:44:16 -0400
committerCédric Le Goater <clg@redhat.com>2025-06-11 14:01:58 +0200
commitbc36d14e13ee9bfc17a6818c5e1664fb8e316621 (patch)
treec7f7da8a1d8ed061062724e521e06637e55d4a92 /hw
parent0fb8a62fe46ca0cdcc75479658301b7e1c3aa797 (diff)
downloadqemu-bc36d14e13ee9bfc17a6818c5e1664fb8e316621.zip
qemu-bc36d14e13ee9bfc17a6818c5e1664fb8e316621.tar.gz
qemu-bc36d14e13ee9bfc17a6818c5e1664fb8e316621.tar.bz2
hw/vfio/ap: store object indicating AP config changed in a queue
Creates an object indicating that an AP configuration change event has been received and stores it in a queue. These objects will later be used to store event information for an AP configuration change when the CHSC instruction is intercepted. Signed-off-by: Rorie Reyes <rreyes@linux.ibm.com> Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20250609164418.17585-3-rreyes@linux.ibm.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/vfio/ap.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 93c74eb..681fd4a 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -21,6 +21,7 @@
#include "hw/s390x/css.h"
#include "qemu/error-report.h"
#include "qemu/event_notifier.h"
+#include "qemu/lockable.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
#include "qemu/option.h"
@@ -41,6 +42,15 @@ struct VFIOAPDevice {
EventNotifier cfg_notifier;
};
+typedef struct APConfigChgEvent {
+ QTAILQ_ENTRY(APConfigChgEvent) next;
+} APConfigChgEvent;
+
+static QTAILQ_HEAD(, APConfigChgEvent) cfg_chg_events =
+ QTAILQ_HEAD_INITIALIZER(cfg_chg_events);
+
+static QemuMutex cfg_chg_events_lock;
+
OBJECT_DECLARE_SIMPLE_TYPE(VFIOAPDevice, VFIO_AP_DEVICE)
static void vfio_ap_compute_needs_reset(VFIODevice *vdev)
@@ -74,12 +84,19 @@ static void vfio_ap_req_notifier_handler(void *opaque)
static void vfio_ap_cfg_chg_notifier_handler(void *opaque)
{
+ APConfigChgEvent *cfg_chg_event;
VFIOAPDevice *vapdev = opaque;
if (!event_notifier_test_and_clear(&vapdev->cfg_notifier)) {
return;
}
+ cfg_chg_event = g_new0(APConfigChgEvent, 1);
+
+ WITH_QEMU_LOCK_GUARD(&cfg_chg_events_lock) {
+ QTAILQ_INSERT_TAIL(&cfg_chg_events, cfg_chg_event, next);
+ }
+
css_generate_css_crws(0);
}