From patchwork Wed Jan 11 17:34:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 90979 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1259838qgi; Wed, 11 Jan 2017 10:38:15 -0800 (PST) X-Received: by 10.200.36.46 with SMTP id c43mr8695744qtc.260.1484159895760; Wed, 11 Jan 2017 10:38:15 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 8si4356184qkb.112.2017.01.11.10.38.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 11 Jan 2017 10:38:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:56101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNmp-0000YJ-8U for patch@linaro.org; Wed, 11 Jan 2017 13:38:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRMnw-0005Lo-9N for qemu-devel@nongnu.org; Wed, 11 Jan 2017 12:35:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRMnt-0007uK-5b for qemu-devel@nongnu.org; Wed, 11 Jan 2017 12:35:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRMns-0007u4-U4 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 12:35:17 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E13F1C057FA7; Wed, 11 Jan 2017 17:35:16 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-80.phx2.redhat.com [10.3.116.80]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0BHZ1rZ004547; Wed, 11 Jan 2017 12:35:13 -0500 From: Laszlo Ersek To: qemu devel list Date: Wed, 11 Jan 2017 18:34:57 +0100 Message-Id: <20170111173457.30455-5-lersek@redhat.com> In-Reply-To: <20170111173457.30455-1-lersek@redhat.com> References: <20170111173457.30455-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 11 Jan 2017 17:35:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 wave 1 4/4] fw-cfg: bump "file_slots" to 0x20 for 2.9+ machine types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefano Stabellini , Eduardo Habkost , "Michael S. Tsirkin" , "Gabriel L. Somlo" , Mark Cave-Ayland , Alexander Graf , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , Igor Mammedov , Artyom Tarasenko , David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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" Cc: "Michael S. Tsirkin" Cc: Alexander Graf Cc: Anthony Perard Cc: Artyom Tarasenko Cc: David Gibson Cc: Eduardo Habkost Cc: Gerd Hoffmann Cc: Igor Mammedov Cc: Mark Cave-Ayland Cc: Paolo Bonzini Cc: Peter Maydell Cc: Stefano Stabellini Signed-off-by: Laszlo Ersek --- 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(-) -- 2.9.3 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(), };