diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt index 9373bbc6474314faf79deeadec10edb8e43dfe91..08c00bdf44a2cca1064356470af2d5438d44e3c9 100644 --- a/docs/specs/fw_cfg.txt +++ b/docs/specs/fw_cfg.txt @@ -155,8 +155,8 @@ Selector Reg. Range Usage through the DMA interface in QEMU v2.9+) 0xc000 - 0xffff Arch. Specific (0x0000 - 0x3fff, RW, ignored in v2.4+) -In practice, the number of allowed firmware configuration items is given -by the value (FW_CFG_FILE_FIRST + FW_CFG_FILE_SLOTS_MIN) (see fw_cfg.h). +In practice, the number of allowed firmware configuration items depends on the +machine type/version. = Guest-side DMA Interface = diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index bf75ef71d57e23412fc81c70c82196d36c2c3e28..523d585dcfeda1faa7364567553a21c5b187fc6a 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -35,6 +35,8 @@ #include "qemu/cutils.h" #include "qapi/error.h" +#define FW_CFG_FILE_SLOTS_DFLT 0x20 + #define FW_CFG_NAME "fw_cfg" #define FW_CFG_PATH "/machine/" FW_CFG_NAME @@ -1058,7 +1060,7 @@ static Property fw_cfg_io_properties[] = { DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled, true), DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots, - FW_CFG_FILE_SLOTS_MIN), + FW_CFG_FILE_SLOTS_DFLT), DEFINE_PROP_END_OF_LIST(), }; @@ -1110,7 +1112,7 @@ static Property fw_cfg_mem_properties[] = { DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled, true), DEFINE_PROP_UINT16("x-file-slots", FWCfgMemState, parent_obj.file_slots, - FW_CFG_FILE_SLOTS_MIN), + FW_CFG_FILE_SLOTS_DFLT), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/compat.h b/include/hw/compat.h index 4fe44d1c7a6ce4f0c3fd6c24bca0974decaf5fac..34e9b4a660d0d926e9e8802637acc010443f269a 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -2,7 +2,15 @@ #define HW_COMPAT_H #define HW_COMPAT_2_8 \ - /* empty */ + {\ + .driver = "fw_cfg_mem",\ + .property = "x-file-slots",\ + .value = stringify(0x10),\ + },{\ + .driver = "fw_cfg_io",\ + .property = "x-file-slots",\ + .value = stringify(0x10),\ + }, #define HW_COMPAT_2_7 \ {\