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 AioContext: optimize clearing the EventNotifier 2015-07-22 12:41:40 +01:00
aio_notify_bug.promela AioContext: fix broken placement of event_notifier_test_and_clear 2015-07-22 12:41:40 +01:00
aio_notify.promela AioContext: fix broken ctx->dispatching optimization 2015-07-22 12:41:40 +01:00
atomics.txt atomic: base mb_read/mb_set on load-acquire and store-release 2016-10-24 15:27:15 +02:00
bitmaps.md docs: update bitmaps.md 2015-11-17 18:35:56 +08:00
blkdebug.txt blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum 2015-12-17 08:21:27 +01:00
blkverify.txt
block-replication.txt docs: block replication's description 2016-09-13 11:00:56 +01:00
bootindex.txt
build-system.txt docs: Add text for tests/docker in build-system.txt 2016-06-01 17:27:35 +08:00
ccid.txt libcacard: improve documentation 2014-06-10 07:44:01 +02:00
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 vfio/pci: Add IGD documentation 2016-05-26 11:12:05 -06:00
image-fuzzer.txt docs: List all image elements currently supported by the fuzzer 2014-09-22 11:39:35 +01:00
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 docs: update documentation for memory hot unplug 2015-04-27 21:07:38 +02:00
memory.txt memory: Provide memory_region_init_rom() 2016-07-04 13:06:35 +01:00
migration.txt migration: convert post-copy to use QIOChannelBuffer 2016-05-26 11:31:34 +05:30
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 maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
pci_expander_bridge.txt pxb: cleanup 2016-03-11 16:59:12 +02:00
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 qapi: Update docs to match recent generator changes 2016-03-05 10:41:16 +01:00
rcu.txt docs/rcu.txt: Fix minor typo 2016-11-02 09:28:57 +01:00
rdma.txt rdma: Fix incorrect description in comments 2014-09-20 17:55:53 +04:00
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-balloon: return empty data when no stats are available 2014-05-25 12:46:58 +03:00
virtio-migration.txt virtio: Update migration docs 2016-07-21 20:44:20 +03:00
vnc-ledstate-Pseudo-encoding.txt
win32-qemu-event.promela qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
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