qemu-patch-raspberry4/hw
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
..
9pfs Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
acpi include/exec/poison: Mark CONFIG_KVM as poisoned, too 2017-07-04 14:30:03 +02:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha memory/iommu: introduce IOMMUMemoryRegionClass 2017-07-14 12:04:41 +02:00
arm * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
audio audio: Rename hw/audio/audio.h to hw/audio/soundhw.h 2017-05-19 10:48:54 +02:00
block virtio-blk: Convert to DEFINE_PROP_LINK 2017-07-14 12:04:42 +02:00
bt be-hci: use backend functions 2017-06-02 11:33:53 +04:00
char chardev: fix parallel device can't be reconnect 2017-07-14 12:04:41 +02:00
core * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
cpu hw/cpu: core.c can be compiled as common object 2017-06-09 12:02:55 +10:00
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display qom: enforce readonly nature of link's check callback 2017-07-14 12:04:42 +02:00
dma * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
gpio qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
i2c migration/next for 20170601 2017-06-02 14:07:53 +01:00
i386 * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
ide pci: Replace pci_add_capability2() with pci_add_capability() 2017-07-03 22:29:49 +03:00
input vmstate: error hint for failed equal checks 2017-06-28 11:18:44 +02:00
intc s390x/flic: migrate ais states 2017-07-14 12:29:49 +02:00
ipack ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
ipmi qom: enforce readonly nature of link's check callback 2017-07-14 12:04:42 +02:00
isa chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
lm32 char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
m68k hw/m68k: QOMify the ColdFire interrupt controller 2017-02-18 22:23:31 +01:00
mem dimm: Convert to DEFINE_PROP_LINK 2017-07-14 12:04:43 +02:00
microblaze Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
mips memory/iommu: QOM'fy IOMMU MemoryRegion 2017-07-14 12:04:41 +02:00
misc * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
moxie hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
net xilinx: Fix latent error handling bug 2017-07-13 13:45:53 +02:00
nios2 Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
nvram Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
openrisc target/openrisc: Support non-busy idle state using PMR SPR 2017-05-04 09:39:14 +09:00
pci hw/pci: define msi_nonbroken in pci-stub 2017-07-11 11:18:37 +03:00
pci-bridge pci: Convert shpc_init() to Error 2017-07-03 22:29:49 +03:00
pci-host * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc spapr: migrate pending_events of spapr state 2017-07-17 15:07:05 +10:00
s390x s390x/kvm/migration/cpumodel: fixes, enhancements and cleanups 2017-07-14 14:19:35 +01:00
scsi * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
sd generic-sdhci: Remove user_creatable flag 2017-05-17 10:37:01 -03:00
sh4 shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
smbios stubs: move smbios stubs to hw/smbios 2017-01-16 17:52:35 +01:00
sparc -----BEGIN PGP SIGNATURE----- 2017-06-05 10:09:14 +01:00
sparc64 hw/sparc: use ARRAY_SIZE() macro 2017-06-04 18:42:55 +03:00
ssi xilinx_spips: allow mmio execution 2017-06-27 15:09:15 +02:00
timer timer/aspeed: fix timer enablement when a reload is not set 2017-06-13 14:57:00 +01:00
tpm clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
tricore Remove reduntant qemu: from error functions 2017-05-07 09:57:51 +03:00
unicore32 clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
usb * gdbstub fixes (Alex) 2017-07-14 12:16:09 +01:00
vfio memory/iommu: QOM'fy IOMMU MemoryRegion 2017-07-14 12:04:41 +02:00
virtio virtio-crypto: Convert to DEFINE_PROP_LINK 2017-07-14 12:04:43 +02:00
watchdog shutdown: Add source information to SHUTDOWN and RESET 2017-05-23 13:28:17 +02:00
xen xen/pt: Fixup addr validation in xen_pt_pci_config_access_check 2017-07-07 11:13:10 -07:00
xenpv xenfb: remove xen_init_display "temporary" hack 2017-07-07 11:10:03 -07:00
xtensa target/xtensa: support output to chardev console 2017-06-06 02:40:48 -07:00
Makefile.objs acpi: filter based on CONFIG_ACPI_X86 rather than TARGET 2017-01-16 17:52:35 +01:00