diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-06-13 11:56:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-13 11:56:00 +0100 |
commit | 9746211baa6ff1275e9c726c6f3a3bcfe4b1f8bd (patch) | |
tree | a53b570a5344370b8d6991ae1c84691024330a80 /include/hw | |
parent | 8e3cf49c47064da19f4bfb1c5bf16e6e613f1bfa (diff) | |
parent | 593080936a06a04eacc589350e3a7ebc02f2ed8e (diff) |
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170609' into staging
ppc patch queue 2017-06-09
This batch contains more patches to rework the pseries machine hotplug
infrastructure, plus an assorted batch of bugfixes.
It contains a start on fixes to restore migration from older machine
types on older versions which was broken by some xics changes. There
are still a few missing pieces here, though.
# gpg: Signature made Fri 09 Jun 2017 06:26:03 BST
# gpg: using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg: aka "David Gibson (kernel.org) <dwg@kernel.org>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392
* remotes/dgibson/tags/ppc-for-2.10-20170609:
Revert "spapr: fix memory hot-unplugging"
xics: drop ICPStateClass::cpu_setup() handler
xics: setup cpu at realize time
xics: pass appropriate types to realize() handlers.
xics: introduce macros for ICP/ICS link properties
hw/cpu: core.c can be compiled as common object
hw/ppc/spapr: Adjust firmware name for PCI bridges
xics: add reset() handler to ICPStateClass
pnv_core: drop reference on ICPState object during CPU realization
spapr: Rework DRC name handling
spapr: Fold spapr_phb_{add,remove}_pci_device() into their only callers
spapr: Change DRC attach & detach methods to functions
spapr: Clean up handling of DR-indicator
spapr: Clean up RTAS set-indicator
spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state()
spapr: Clean up DR entity sense handling
pseries: Correct panic behaviour for pseries machine type
spapr: fix memory leak in spapr_memory_pre_plug()
target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok()
target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/ppc/spapr_drc.h | 31 | ||||
-rw-r--r-- | include/hw/ppc/xics.h | 17 |
2 files changed, 25 insertions, 23 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index c88e1beed4..bc9f98851e 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -125,7 +125,7 @@ typedef enum { } sPAPRDRAllocationState; /* - * LED/visual indicator state + * DR-indicator (LED/visual indicator) * * set via set-indicator RTAS calls * as documented by PAPR+ 2.7 13.5.3.4, Table 177, @@ -137,10 +137,10 @@ typedef enum { * action: (currently unused) */ typedef enum { - SPAPR_DR_INDICATOR_STATE_INACTIVE = 0, - SPAPR_DR_INDICATOR_STATE_ACTIVE = 1, - SPAPR_DR_INDICATOR_STATE_IDENTIFY = 2, - SPAPR_DR_INDICATOR_STATE_ACTION = 3, + SPAPR_DR_INDICATOR_INACTIVE = 0, + SPAPR_DR_INDICATOR_ACTIVE = 1, + SPAPR_DR_INDICATOR_IDENTIFY = 2, + SPAPR_DR_INDICATOR_ACTION = 3, } sPAPRDRIndicatorState; /* @@ -184,12 +184,13 @@ typedef struct sPAPRDRConnector { uint32_t id; Object *owner; - const char *name; + + /* DR-indicator */ + uint32_t dr_indicator; /* sensor/indicator states */ uint32_t isolation_state; uint32_t allocation_state; - uint32_t indicator_state; /* configure-connector state */ void *fdt; @@ -200,7 +201,6 @@ typedef struct sPAPRDRConnector { bool awaiting_release; bool signalled; bool awaiting_allocation; - bool awaiting_allocation_skippable; /* device pointer, via link property */ DeviceState *dev; @@ -213,22 +213,17 @@ typedef struct sPAPRDRConnectorClass { /*< public >*/ sPAPRDRConnectorTypeShift typeshift; const char *typename; /* used in device tree, PAPR 13.5.2.6 & C.6.1 */ + const char *drc_name_prefix; /* used other places in device tree */ + + sPAPRDREntitySense (*dr_entity_sense)(sPAPRDRConnector *drc); /* accessors for guest-visible (generally via RTAS) DR state */ uint32_t (*set_isolation_state)(sPAPRDRConnector *drc, sPAPRDRIsolationState state); - uint32_t (*set_indicator_state)(sPAPRDRConnector *drc, - sPAPRDRIndicatorState state); uint32_t (*set_allocation_state)(sPAPRDRConnector *drc, sPAPRDRAllocationState state); - const char *(*get_name)(sPAPRDRConnector *drc); - - uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state); /* QEMU interfaces for managing hotplug operations */ - void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt, - int fdt_start_offset, bool coldplug, Error **errp); - void (*detach)(sPAPRDRConnector *drc, DeviceState *d, Error **errp); bool (*release_pending)(sPAPRDRConnector *drc); void (*set_signalled)(sPAPRDRConnector *drc); } sPAPRDRConnectorClass; @@ -243,4 +238,8 @@ 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); +void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, + int fdt_start_offset, bool coldplug, Error **errp); +void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp); + #endif /* HW_SPAPR_DRC_H */ diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index a3073f9053..28d248abad 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -65,10 +65,10 @@ typedef struct XICSFabric XICSFabric; struct ICPStateClass { DeviceClass parent_class; - void (*realize)(DeviceState *dev, Error **errp); - void (*pre_save)(ICPState *s); - int (*post_load)(ICPState *s, int version_id); - void (*cpu_setup)(ICPState *icp, PowerPCCPU *cpu); + void (*realize)(ICPState *icp, Error **errp); + void (*pre_save)(ICPState *icp); + int (*post_load)(ICPState *icp, int version_id); + void (*reset)(ICPState *icp); }; struct ICPState { @@ -85,6 +85,9 @@ struct ICPState { XICSFabric *xics; }; +#define ICP_PROP_XICS "xics" +#define ICP_PROP_CPU "cpu" + struct PnvICPState { ICPState parent_obj; @@ -110,7 +113,7 @@ struct PnvICPState { struct ICSStateClass { DeviceClass parent_class; - void (*realize)(DeviceState *dev, Error **errp); + void (*realize)(ICSState *s, Error **errp); void (*pre_save)(ICSState *s); int (*post_load)(ICSState *s, int version_id); void (*reject)(ICSState *s, uint32_t irq); @@ -129,6 +132,8 @@ struct ICSState { XICSFabric *xics; }; +#define ICS_PROP_XICS "xics" + static inline bool ics_valid_irq(ICSState *ics, uint32_t nr) { return (ics->offset != 0) && (nr >= ics->offset) @@ -182,8 +187,6 @@ void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle); qemu_irq xics_get_qirq(XICSFabric *xi, int irq); ICPState *xics_icp_get(XICSFabric *xi, int server); -void xics_cpu_setup(XICSFabric *xi, PowerPCCPU *cpu, ICPState *icp); -void xics_cpu_destroy(XICSFabric *xi, PowerPCCPU *cpu); /* Internal XICS interfaces */ void icp_set_cppr(ICPState *icp, uint8_t cppr); |