diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/ppc/spapr.h | 14 | ||||
-rw-r--r-- | include/hw/ppc/spapr_drc.h | 69 | ||||
-rw-r--r-- | include/migration/vmstate.h | 8 | ||||
-rw-r--r-- | include/sysemu/cpus.h | 1 | ||||
-rw-r--r-- | include/sysemu/hax.h | 1 | ||||
-rw-r--r-- | include/sysemu/hw_accel.h | 10 | ||||
-rw-r--r-- | include/sysemu/kvm.h | 1 |
7 files changed, 70 insertions, 34 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 98fb78b012..f973b02845 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -11,7 +11,6 @@ struct VIOsPAPRBus; struct sPAPRPHBState; struct sPAPRNVRAM; -typedef struct sPAPRConfigureConnectorState sPAPRConfigureConnectorState; typedef struct sPAPREventLogEntry sPAPREventLogEntry; typedef struct sPAPREventSource sPAPREventSource; @@ -102,9 +101,6 @@ struct sPAPRMachineState { bool htab_first_pass; int htab_fd; - /* RTAS state */ - QTAILQ_HEAD(, sPAPRConfigureConnectorState) ccs_list; - /* Pending DIMM unplug cache. It is populated when a LMB * unplug starts. It can be regenerated if a migration * occurs during the unplug process. */ @@ -646,16 +642,6 @@ void *spapr_populate_hotplug_cpu_dt(CPUState *cs, int *fdt_offset, void spapr_core_release(DeviceState *dev); void spapr_lmb_release(DeviceState *dev); -/* rtas-configure-connector state */ -struct sPAPRConfigureConnectorState { - uint32_t drc_index; - int fdt_offset; - int fdt_depth; - QTAILQ_ENTRY(sPAPRConfigureConnectorState) next; -}; - -void spapr_ccs_reset_hook(void *opaque); - void spapr_rtc_read(sPAPRRTCState *rtc, struct tm *tm, uint32_t *ns); int spapr_rtc_import_offset(sPAPRRTCState *rtc, int64_t legacy_offset); diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 813b9ffd60..c88e1beed4 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -26,6 +26,48 @@ #define SPAPR_DR_CONNECTOR(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ TYPE_SPAPR_DR_CONNECTOR) +#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" +#define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \ + OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_PHYSICAL) +#define SPAPR_DRC_PHYSICAL_CLASS(klass) \ + OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, \ + TYPE_SPAPR_DRC_PHYSICAL) +#define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + TYPE_SPAPR_DRC_PHYSICAL) + +#define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical" +#define SPAPR_DRC_LOGICAL_GET_CLASS(obj) \ + OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_LOGICAL) +#define SPAPR_DRC_LOGICAL_CLASS(klass) \ + OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, \ + TYPE_SPAPR_DRC_LOGICAL) +#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + TYPE_SPAPR_DRC_LOGICAL) + +#define TYPE_SPAPR_DRC_CPU "spapr-drc-cpu" +#define SPAPR_DRC_CPU_GET_CLASS(obj) \ + OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_CPU) +#define SPAPR_DRC_CPU_CLASS(klass) \ + OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_CPU) +#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + TYPE_SPAPR_DRC_CPU) + +#define TYPE_SPAPR_DRC_PCI "spapr-drc-pci" +#define SPAPR_DRC_PCI_GET_CLASS(obj) \ + OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_PCI) +#define SPAPR_DRC_PCI_CLASS(klass) \ + OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_PCI) +#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + TYPE_SPAPR_DRC_PCI) + +#define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb" +#define SPAPR_DRC_LMB_GET_CLASS(obj) \ + OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_LMB) +#define SPAPR_DRC_LMB_CLASS(klass) \ + OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_LMB) +#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + TYPE_SPAPR_DRC_LMB) + /* * Various hotplug types managed by sPAPRDRConnector * @@ -130,11 +172,16 @@ typedef enum { SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE = -9003, } sPAPRDRCCResponse; +/* rtas-configure-connector state */ +typedef struct sPAPRConfigureConnectorState { + int fdt_offset; + int fdt_depth; +} sPAPRConfigureConnectorState; + typedef struct sPAPRDRConnector { /*< private >*/ DeviceState parent; - sPAPRDRConnectorType type; uint32_t id; Object *owner; const char *name; @@ -148,6 +195,7 @@ typedef struct sPAPRDRConnector { void *fdt; int fdt_start_offset; bool configured; + sPAPRConfigureConnectorState *ccs; bool awaiting_release; bool signalled; @@ -163,6 +211,8 @@ typedef struct sPAPRDRConnectorClass { DeviceClass parent; /*< public >*/ + sPAPRDRConnectorTypeShift typeshift; + const char *typename; /* used in device tree, PAPR 13.5.2.6 & C.6.1 */ /* accessors for guest-visible (generally via RTAS) DR state */ uint32_t (*set_isolation_state)(sPAPRDRConnector *drc, @@ -171,16 +221,10 @@ typedef struct sPAPRDRConnectorClass { sPAPRDRIndicatorState state); uint32_t (*set_allocation_state)(sPAPRDRConnector *drc, sPAPRDRAllocationState state); - uint32_t (*get_index)(sPAPRDRConnector *drc); - uint32_t (*get_type)(sPAPRDRConnector *drc); const char *(*get_name)(sPAPRDRConnector *drc); uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state); - /* QEMU interfaces for managing FDT/configure-connector */ - const void *(*get_fdt)(sPAPRDRConnector *drc, int *fdt_start_offset); - void (*set_configured)(sPAPRDRConnector *drc); - /* QEMU interfaces for managing hotplug operations */ void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt, int fdt_start_offset, bool coldplug, Error **errp); @@ -189,12 +233,13 @@ typedef struct sPAPRDRConnectorClass { void (*set_signalled)(sPAPRDRConnector *drc); } sPAPRDRConnectorClass; -sPAPRDRConnector *spapr_dr_connector_new(Object *owner, - sPAPRDRConnectorType type, +uint32_t spapr_drc_index(sPAPRDRConnector *drc); +sPAPRDRConnectorType spapr_drc_type(sPAPRDRConnector *drc); + +sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type, uint32_t id); -sPAPRDRConnector *spapr_dr_connector_by_index(uint32_t index); -sPAPRDRConnector *spapr_dr_connector_by_id(sPAPRDRConnectorType type, - uint32_t id); +sPAPRDRConnector *spapr_drc_by_index(uint32_t index); +sPAPRDRConnector *spapr_drc_by_id(const char *type, uint32_t id); int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner, uint32_t drc_type_mask); diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 66895623da..8a3e9e6088 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -59,14 +59,6 @@ typedef struct SaveVMHandlers { LoadStateHandler *load_state; } SaveVMHandlers; -int register_savevm(DeviceState *dev, - const char *idstr, - int instance_id, - int version_id, - SaveStateHandler *save_state, - LoadStateHandler *load_state, - void *opaque); - int register_savevm_live(DeviceState *dev, const char *idstr, int instance_id, diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index a8053f1715..731756d948 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -27,6 +27,7 @@ void qemu_timer_notify_cb(void *opaque, QEMUClockType type); void cpu_synchronize_all_states(void); void cpu_synchronize_all_post_reset(void); void cpu_synchronize_all_post_init(void); +void cpu_synchronize_all_pre_loadvm(void); void qtest_clock_warp(int64_t dest); diff --git a/include/sysemu/hax.h b/include/sysemu/hax.h index d9f023918e..232a68ab1b 100644 --- a/include/sysemu/hax.h +++ b/include/sysemu/hax.h @@ -33,6 +33,7 @@ int hax_populate_ram(uint64_t va, uint32_t size); void hax_cpu_synchronize_state(CPUState *cpu); void hax_cpu_synchronize_post_reset(CPUState *cpu); void hax_cpu_synchronize_post_init(CPUState *cpu); +void hax_cpu_synchronize_pre_loadvm(CPUState *cpu); #ifdef CONFIG_HAX diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h index c9b3105bc7..469ffda460 100644 --- a/include/sysemu/hw_accel.h +++ b/include/sysemu/hw_accel.h @@ -45,4 +45,14 @@ static inline void cpu_synchronize_post_init(CPUState *cpu) } } +static inline void cpu_synchronize_pre_loadvm(CPUState *cpu) +{ + if (kvm_enabled()) { + kvm_cpu_synchronize_pre_loadvm(cpu); + } + if (hax_enabled()) { + hax_cpu_synchronize_pre_loadvm(cpu); + } +} + #endif /* QEMU_HW_ACCEL_H */ diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 5cc83f2003..a45c145560 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -459,6 +459,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, void kvm_cpu_synchronize_state(CPUState *cpu); void kvm_cpu_synchronize_post_reset(CPUState *cpu); void kvm_cpu_synchronize_post_init(CPUState *cpu); +void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu); void kvm_init_cpu_signals(CPUState *cpu); |