qemu/docs
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
..
specs fw-cfg: turn FW_CFG_FILE_SLOTS into a device property 2017-01-18 22:59:53 +02:00
aio_notify_accept.promela
aio_notify_bug.promela
aio_notify.promela
atomics.txt atomic: base mb_read/mb_set on load-acquire and store-release 2016-10-24 15:27:15 +02:00
bitmaps.md
blkdebug.txt
blkverify.txt
block-replication.txt docs: block replication's description 2016-09-13 11:00:56 +01:00
bootindex.txt
build-system.txt
ccid.txt
COLO-FT.txt docs: fix COLO architecture diagram 2016-11-15 15:36:21 +08:00
colo-proxy.txt docs: Add documentation for COLO-proxy 2016-09-27 17:54:22 +08:00
generic-loader.txt docs/generic-loader: Update the document 2016-10-17 19:22:16 +01:00
ich9-ehci-uhci.cfg
igd-assign.txt
image-fuzzer.txt
live-block-ops.txt docs: Document how to stream to an intermediate layer 2016-10-31 16:52:38 +01:00
lockcnt.txt qemu-thread: optimize QemuLockCnt with futexes on Linux 2017-01-16 13:25:18 +00:00
memory-hotplug.txt
memory.txt memory: Provide memory_region_init_rom() 2016-07-04 13:06:35 +01:00
migration.txt
multi-thread-compression.txt docs/multi-thread-compression: Fix wrong command string 2016-06-07 18:19:24 +03:00
multiple-iothreads.txt aio: document locking 2017-01-16 13:25:18 +00:00
multiseat.txt
pci_expander_bridge.txt
pcie.txt doc/pcie: correct command line examples 2017-01-10 07:02:52 +02:00
q35-chipset.cfg
qapi-code-gen.txt qapi: add qapi2texi script 2017-01-16 10:10:35 +01:00
qcow2-cache.txt docs: Specify that cache-clean-interval is only supported in Linux 2016-11-25 13:51:31 +01:00
qdev-device-use.txt
qemu_logo.pdf docs: add qemu logo to pdf 2017-01-16 10:11:43 +01:00
qemu-ga-ref.texi docs: add qemu logo to pdf 2017-01-16 10:11:43 +01:00
qemu-qmp-ref.texi docs: add qemu logo to pdf 2017-01-16 10:11:43 +01:00
qemupciserial.inf
qmp-intro.txt build-sys: add qapi doc generation targets 2017-01-16 10:11:43 +01:00
qmp-spec.txt
rcu.txt docs/rcu.txt: Fix minor typo 2016-11-02 09:28:57 +01:00
rdma.txt
replay.txt record/replay: add network support 2017-01-06 10:38:00 +08:00
spice-port-fqdn.txt
tcg-exclusive.promela cpus-common: lock-free fast path for cpu_exec_start/end 2016-09-27 11:57:30 +02:00
throttle.txt docs: Fix description of the leaky bucket algorithm in throttle.txt 2016-09-13 18:12:34 +03:00
tracing.txt docs/tracing.txt: Update documentation of default backend 2016-11-08 18:16:48 +00:00
usb2.txt
usb-storage.txt usb: add storage hotplug documentation 2016-07-12 10:25:30 +02:00
virtio-balloon-stats.txt
virtio-migration.txt virtio: Update migration docs 2016-07-21 20:44:20 +03:00
vnc-ledstate-Pseudo-encoding.txt
win32-qemu-event.promela
writing-qmp-commands.txt docs: Belatedly update for move of QMP/* to docs/ 2016-10-07 19:22:11 +02:00
xbzrle.txt docs/xbzrle: correction 2016-10-13 17:23:53 +02:00
xen-save-devices-state.txt docs: Belatedly update for move of qmp-commands.txt 2016-10-07 19:22:11 +02:00