xemu/docs/specs
Laszlo Ersek e12f3a13e2 fw-cfg: turn FW_CFG_FILE_SLOTS into a device property
We'd like to raise the value of FW_CFG_FILE_SLOTS. Doing it naively could
lead to problems with backward migration: a more recent QEMU (running an
older machine type) would allow the guest, in fw_cfg_select(), to select a
high key value that is unavailable in the same machine type implemented by
the older (target) QEMU. On the target host, fw_cfg_data_read() for
example could dereference nonexistent entries.

As first step, size the FWCfgState.entries[*] and FWCfgState.entry_order
arrays dynamically. All three array sizes will be influenced by the new
field FWCfgState.file_slots (and matching device property).

Make the following changes:

- Replace the FW_CFG_FILE_SLOTS macro with FW_CFG_FILE_SLOTS_MIN (minimum
  count of fw_cfg file slots) in the header file. The value remains 0x10.

- Replace all uses of FW_CFG_FILE_SLOTS with a helper function called
  fw_cfg_file_slots(), returning the new property.

- Eliminate the macro FW_CFG_MAX_ENTRY, and replace all its uses with a
  helper function called fw_cfg_max_entry().

- In the MMIO- and IO-mapped realize functions both, allocate all three
  arrays dynamically, based on the new property.

- The new property defaults to FW_CFG_FILE_SLOTS_MIN. This is going to be
  customized in the following patches.

Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Gabriel Somlo <somlo@cmu.edu>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
2017-01-18 22:59:53 +02:00
..
acpi_cpu_hotplug.txt docs: update ACPI CPU hotplug spec with new protocol 2016-06-24 05:20:22 +03:00
acpi_mem_hotplug.txt pc: memhp: move nvdimm hotplug out of memory hotplug 2016-11-15 17:20:37 +02:00
acpi_nvdimm.txt docs: improve the doc of Read FIT method 2016-11-15 17:20:37 +02:00
acpi_pci_hotplug.txt acpi_piix4: Re-define PCI hotplug eject register read 2012-04-15 12:17:23 +03:00
edu.txt hw/misc/edu: support MSI interrupt 2016-10-04 10:00:25 +02:00
fw_cfg.txt fw-cfg: turn FW_CFG_FILE_SLOTS into a device property 2017-01-18 22:59:53 +02:00
ivshmem-spec.txt ivshmem: Require master to have ID zero 2016-03-21 21:29:03 +01:00
parallels.txt spec/parallels: fix a mistake 2016-07-18 15:09:31 +01:00
pci-ids.txt pci-ids: add virtio 1.0 ids to spec 2016-03-11 16:59:11 +02:00
pci-serial.txt serial: add pci-serial documentation 2012-10-22 13:26:42 -05:00
pci-testdev.txt pci: add pci test device 2013-04-16 01:41:53 +03:00
ppc-spapr-hcalls.txt typofixes - v4 2015-09-11 10:45:43 +03:00
ppc-spapr-hotplug.txt spapr: update spapr hotplug documentation 2016-10-28 11:17:35 +11:00
pvpanic.txt pvpanic: add document of pvpanic 2013-04-30 10:30:01 -05:00
qcow2.txt spec: add qcow2 bitmaps extension specification 2016-02-22 09:49:46 +01:00
qed_spec.txt docs: Describe zero data clusters in QED specification 2011-04-13 12:06:40 +02:00
rocker.txt Fix some typos found by codespell 2016-05-18 15:04:27 +03:00
standard-vga.txt vga-pci: add qext region to mmio 2014-10-15 11:08:35 +02:00
vhost-user.txt vhost-user: Add MTU protocol feature and op 2017-01-10 07:02:53 +02:00
vmw_pvscsi-spec.txt scsi: VMWare PVSCSI paravirtual device implementation 2013-04-19 10:44:17 +02:00