From: Laszlo Ersek <lersek@redhat.com>
To: qemu devel list <qemu-devel@nongnu.org>
Cc: "Gabriel L. Somlo" <somlo@cmu.edu>,
"Michael S. Tsirkin" <mst@redhat.com>,
Alexander Graf <agraf@suse.de>,
Anthony Perard <anthony.perard@citrix.com>,
Artyom Tarasenko <atar4qemu@gmail.com>,
David Gibson <david@gibson.dropbear.id.au>,
Eduardo Habkost <ehabkost@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: [Qemu-devel] [PATCH v5 wave 1 4/4] fw-cfg: bump "file_slots" to 0x20 for 2.9+ machine types
Date: Wed, 11 Jan 2017 18:34:57 +0100 [thread overview]
Message-ID: <20170111173457.30455-5-lersek@redhat.com> (raw)
In-Reply-To: <20170111173457.30455-1-lersek@redhat.com>
More precisely, the "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 "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>
---
Notes:
v5:
- based on the previous patch from Eduardo, replace the following two
patches from v4 [Igor]:
* fw-cfg: expose "file_slots" parameter in fw_cfg_init_io_dma()
* hw/i386/pc: introduce 2.9 machine types with 0x20 fw_cfg file slots
docs/specs/fw_cfg.txt | 4 ++--
include/hw/compat.h | 10 +++++++++-
hw/nvram/fw_cfg.c | 6 ++++--
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
index 9373bbc64743..08c00bdf44a2 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/include/hw/compat.h b/include/hw/compat.h
index 4fe44d1c7a6c..a8f344aa738f 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 = "file_slots",\
+ .value = stringify(0x10),\
+ },{\
+ .driver = "fw_cfg_io",\
+ .property = "file_slots",\
+ .value = stringify(0x10),\
+ },
#define HW_COMPAT_2_7 \
{\
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 313d943ebd27..a2e5b69fb52a 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("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("file_slots", FWCfgMemState, parent_obj.file_slots,
- FW_CFG_FILE_SLOTS_MIN),
+ FW_CFG_FILE_SLOTS_DFLT),
DEFINE_PROP_END_OF_LIST(),
};
--
2.9.3
next prev parent reply other threads:[~2017-01-11 17:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 17:34 [Qemu-devel] [PATCH v5 wave 1 0/4] fw-cfg: support writeable blobs and more files Laszlo Ersek
2017-01-11 17:34 ` [Qemu-devel] [PATCH v5 wave 1 1/4] fw-cfg: support writeable blobs Laszlo Ersek
2017-01-11 17:34 ` [Qemu-devel] [PATCH v5 wave 1 2/4] fw-cfg: turn FW_CFG_FILE_SLOTS into a device property Laszlo Ersek
2017-01-12 13:10 ` Eduardo Habkost
2017-01-12 16:30 ` Laszlo Ersek
2017-01-12 16:45 ` Eduardo Habkost
2017-01-12 14:29 ` Michael S. Tsirkin
2017-01-12 16:34 ` Laszlo Ersek
2017-01-11 17:34 ` [Qemu-devel] [PATCH v5 wave 1 3/4] pc: Add 2.9 machine-types Laszlo Ersek
2017-01-11 17:34 ` Laszlo Ersek [this message]
2017-01-12 2:25 ` [Qemu-devel] [PATCH v5 wave 1 0/4] fw-cfg: support writeable blobs and more files Gabriel L. Somlo
2017-01-12 10:09 ` Laszlo Ersek
2017-01-12 14:30 ` Michael S. Tsirkin
2017-01-12 16:37 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170111173457.30455-5-lersek@redhat.com \
--to=lersek@redhat.com \
--cc=agraf@suse.de \
--cc=anthony.perard@citrix.com \
--cc=atar4qemu@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
--cc=sstabellini@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).