qemu-e2k/hw/ppc
Daniel Henrique Barboza fd38804b38 spapr: migrate pending_events of spapr state
In racing situations between hotplug events and migration operation,
a rtas hotplug event could have not yet be delivered to the source
guest when migration is started. In this case the pending_events of
spapr state need be transmitted to the target so that the hotplug
event can be finished on the target.

To achieve the minimal VMSD possible to migrate the pending_events list,
this patch makes the changes in spapr_events.c:

- 'log_type' of sPAPREventLogEntry struct deleted. This information can be
derived by inspecting the rtas_error_log summary field. A new function
called 'spapr_event_log_entry_type' was added to retrieve the type of
a given sPAPREventLogEntry.

- sPAPREventLogEntry, epow_log_full and hp_log_full were redesigned. The
only data we're going to migrate in the VMSD is the event log data itself,
which can be divided in two parts: a rtas_error_log header and an extended
event log field. The rtas_error_log header contains information about the
size of the extended log field, which can be used inside VMSD as the size
parameter of the VBUFFER_ALOC field that will store it. To allow this use,
the header.extended_length field must be exposed inline to the VMSD instead
of embedded into a 'data' field that holds everything. With this in mind,
the following changes were done:

    * a new 'header' field was added to sPAPREventLogEntry. This field holds a
a struct rtas_error_log inline.
    * the declaration of the 'rtas_error_log' struct was moved to spapr.h
to be visible to the VMSD macros.
    * 'data' field of sPAPREventLogEntry was renamed to 'extended_log' and
now holds only the contents of the extended event log.
   *  'struct rtas_error_log hdr' were taken away from both epow_log_full
and hp_log_full. This information is now available at the header field of
sPAPREventLogEntry.
   * epow_log_full and hp_log_full were renamed to epow_extended_log and
hp_extended_log respectively. This rename makes it clearer to understand
the new purpose of both structures: hold the information of an extended
event log field.
    * spapr_powerdown_req and spapr_hotplug_req_event now creates a
sPAPREventLogEntry structure that contains the full rtas log entry.
    * rtas_event_log_queue and rtas_event_log_dequeue now receives a
sPAPREventLogEntry pointer as a parameter instead of a void pointer.

- the endianess of the sPAPREventLogEntry header is now native instead
of be32. We can use the fields in native endianess internally and write
them in be32 in the guest physical memory inside 'check_exception'. This
allows the VMSD inside spapr.c to read the correct size of the
entended_log field.

- inside spapr.c, pending_events is put in a subsection in the spapr state
VMSD to make sure migration across different versions is not broken.

A small change in rtas_event_log_queue and rtas_event_log_dequeue were also
made: instead of calling qdev_get_machine(), both functions now receive
a pointer to the sPAPRMachineState. This pointer is already available in
the callers of these functions and we don't need to waste resources
calling qdev() again.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-07-17 15:07:05 +10:00
..
Makefile.objs ppc/pnv: add initial IPMI sensors for the BMC simulator 2017-04-26 12:41:56 +10:00
e500-ccsr.h ppc: do not use ../ in include files 2013-03-01 13:57:33 +01:00
e500.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
e500.h target-ppc: Eliminate redundant and incorrect function booke206_page_size_to_tlb 2016-07-01 09:57:01 +10:00
e500plat.c dma: do not depend on kvm_enabled() 2016-05-19 16:42:28 +02:00
fdt.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mac.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
mac_newworld.c ppc: add qemu_vga.ndrv ROM to fw_cfg interface for NewWorld Macs 2017-05-11 09:45:15 +10:00
mac_oldworld.c ppc: add qemu_vga.ndrv ROM to fw_cfg interface for OldWorld Macs 2017-05-11 09:45:15 +10:00
mpc8544_guts.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
mpc8544ds.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
pnv.c Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
pnv_bmc.c ppc/pnv: generate an OEM SEL event on shutdown 2017-04-26 12:41:56 +10:00
pnv_core.c pnv-core: use get_uint() for "core-pir" property 2017-06-20 14:31:33 +02:00
pnv_lpc.c ppc/pnv: enable only one LPC bus 2017-04-26 12:41:55 +10:00
pnv_occ.c ppc/pnv: Add OCC model stub with interrupt support 2017-04-26 12:00:42 +10:00
pnv_psi.c xics: introduce macros for ICP/ICS link properties 2017-06-09 12:12:34 +10:00
pnv_xscom.c kvm: move cpu synchronization code 2017-01-19 22:07:46 +01:00
ppc.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
ppc4xx_devs.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
ppc4xx_pci.c qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
ppc405.h Remove unused function declarations 2016-09-15 15:32:22 +03:00
ppc405_boards.c clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
ppc405_uc.c shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
ppc440_bamboo.c target-ppc: Add MMU model check for booke machines 2017-02-02 09:30:06 +11:00
ppc_booke.c ppc_booke: drop useless assignment 2017-05-07 09:57:51 +03:00
ppce500_spin.c hw/ppc: QOM'ify ppce500_spin.c 2017-01-31 10:10:13 +11:00
prep.c hw/ppc/prep: Remove superfluous call to soundhw_init() 2017-06-30 14:03:31 +10:00
prep_systemio.c prep: add PReP System I/O 2017-01-31 10:10:13 +11:00
rs6000_mc.c prep: add IBM RS/6000 7020 (40p) memory controller 2017-01-31 10:10:13 +11:00
spapr.c spapr: migrate pending_events of spapr state 2017-07-17 15:07:05 +10:00
spapr_cpu_core.c spapr: prevent QEMU crash when CPU realization fails 2017-06-30 14:03:31 +10:00
spapr_drc.c spapr: Remove unnecessary instance_size specifications from DRC subtypes 2017-07-17 15:06:08 +10:00
spapr_events.c spapr: migrate pending_events of spapr state 2017-07-17 15:07:05 +10:00
spapr_hcall.c pseries: Move CPU compatibility property to machine 2017-06-30 14:03:31 +10:00
spapr_iommu.c * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
spapr_ovec.c spapr: replace debug printf with trace points 2017-02-22 11:28:28 +11:00
spapr_pci.c spapr: Only report host/guest IOMMU page size mismatches on KVM 2017-07-11 11:04:02 +10:00
spapr_pci_vfio.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
spapr_rng.c spapr_rng: Convert to DEFINE_PROP_LINK 2017-07-14 12:04:43 +02:00
spapr_rtas.c pseries: Correct panic behaviour for pseries machine type 2017-06-08 14:38:18 +10:00
spapr_rtas_ddw.c spapr_pci/spapr_pci_vfio: Support Dynamic DMA Windows (DDW) 2016-07-05 14:31:08 +10:00
spapr_rtc.c ppc/spapr: QOM'ify sPAPRRTCState 2017-04-26 12:00:41 +10:00
spapr_vio.c vmstate: error hint for failed equal checks 2017-06-28 11:18:44 +02:00
trace-events spapr: Clean up handling of DR-indicator 2017-06-08 14:38:26 +10:00
virtex_ml507.c target-ppc: Add MMU model check for booke machines 2017-02-02 09:30:06 +11:00