qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

fw-cfg: bump "x-file-slots" to 0x20 for 2.9+ machine types

More precisely, the "x-file-slots" count is bumped for all machine types
that:
(a) use fw_cfg, and
(b) are not versioned (hence migration is not expected to work for them
across QEMU releases anyway), or have version 2.9.

This affects machine types implemented in the following source files:

- "hw/arm/virt.c". The "virt-*" machine type is versioned, and the <= 2.8
versions already depend on HW_COMPAT_2_8 (see commit e353aac51b944).
Therefore adding the "x-file-slots" compat values to HW_COMPAT_2_8
suffices.

- "hw/i386/pc.c". The "pc-i440fx-*" (including "pc-*") and "pc-q35-*"
machine types are versioned. Modifying HW_COMPAT_2_8 is sufficient here
too (see commit "pc: Add 2.9 machine-types"). The "isapc" machtype is
not versioned. The "xenfv" machine type, which uses fw_cfg for direct
kernel booting, is also not versioned.

- "hw/ppc/mac_newworld.c". The "mac99" machine type is not versioned.

- "hw/ppc/mac_oldworld.c". The "g3beige" machine type is not versioned.

- "hw/sparc/sun4m.c". None of the 9 machine types defined in this file
appear versioned.

- "hw/sparc64/sun4u.c". None of the 3 machine types defined in this file
appear versioned.

Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Artyom Tarasenko <atar4qemu@gmail.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
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>

authored by

Laszlo Ersek and committed by
Michael S. Tsirkin
a5b3ebfd d580bd4b

+15 -5
+2 -2
docs/specs/fw_cfg.txt
··· 155 155 through the DMA interface in QEMU v2.9+) 156 156 0xc000 - 0xffff Arch. Specific (0x0000 - 0x3fff, RW, ignored in v2.4+) 157 157 158 - In practice, the number of allowed firmware configuration items is given 159 - by the value (FW_CFG_FILE_FIRST + FW_CFG_FILE_SLOTS_MIN) (see fw_cfg.h). 158 + In practice, the number of allowed firmware configuration items depends on the 159 + machine type/version. 160 160 161 161 = Guest-side DMA Interface = 162 162
+4 -2
hw/nvram/fw_cfg.c
··· 35 35 #include "qemu/cutils.h" 36 36 #include "qapi/error.h" 37 37 38 + #define FW_CFG_FILE_SLOTS_DFLT 0x20 39 + 38 40 #define FW_CFG_NAME "fw_cfg" 39 41 #define FW_CFG_PATH "/machine/" FW_CFG_NAME 40 42 ··· 1058 1060 DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled, 1059 1061 true), 1060 1062 DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots, 1061 - FW_CFG_FILE_SLOTS_MIN), 1063 + FW_CFG_FILE_SLOTS_DFLT), 1062 1064 DEFINE_PROP_END_OF_LIST(), 1063 1065 }; 1064 1066 ··· 1110 1112 DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled, 1111 1113 true), 1112 1114 DEFINE_PROP_UINT16("x-file-slots", FWCfgMemState, parent_obj.file_slots, 1113 - FW_CFG_FILE_SLOTS_MIN), 1115 + FW_CFG_FILE_SLOTS_DFLT), 1114 1116 DEFINE_PROP_END_OF_LIST(), 1115 1117 }; 1116 1118
+9 -1
include/hw/compat.h
··· 2 2 #define HW_COMPAT_H 3 3 4 4 #define HW_COMPAT_2_8 \ 5 - /* empty */ 5 + {\ 6 + .driver = "fw_cfg_mem",\ 7 + .property = "x-file-slots",\ 8 + .value = stringify(0x10),\ 9 + },{\ 10 + .driver = "fw_cfg_io",\ 11 + .property = "x-file-slots",\ 12 + .value = stringify(0x10),\ 13 + }, 6 14 7 15 #define HW_COMPAT_2_7 \ 8 16 {\