From nobody Mon Feb 9 16:44:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619465760; cv=none; d=zohomail.com; s=zohoarc; b=l95YL/a7KwbBTObDliEw0hgK8CfVdxfHvgm1zw07tMvDz7neehOcWTdcNbqgP7Rg8cv+VdZQ7O5Lku6ijD/8gPdNVQQKjhKRgq6pgVD1bmeR9d/P8TgHI1wMusRWHBUH0FnA267JdAKx/MRYwPecNzW36ArQQUEntRA1UUcPaFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619465760; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=/SwK7FX3kH1UWtK3h3/1AavB3Zp9Tje3hQEQT9u6kU8=; b=jQKwqInEq9cjPodp1uFTPRa+ysuS4sacKOpwLb6rfLgCFpESirjhYWDXS5GAh3bQTIMMuGHS2aAH9ctdNuvXQ8Q8aQdmfSDljTXylxmzDQcHV+mC/xKYNJY0Pw8EKw3AaYHJgUeL4VaK6kpmCTeGeq8mPPtjNA0UN9gtwdtLJkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619465760814101.32820746211462; Mon, 26 Apr 2021 12:36:00 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-f0D_LdyXPU2xmYLOsLPSDA-1; Mon, 26 Apr 2021 15:35:57 -0400 Received: by mail-wr1-f70.google.com with SMTP id 60-20020adf85420000b0290109440de5e9so3794004wrh.10 for ; Mon, 26 Apr 2021 12:35:57 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id t63sm18527743wma.20.2021.04.26.12.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 12:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619465759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/SwK7FX3kH1UWtK3h3/1AavB3Zp9Tje3hQEQT9u6kU8=; b=bTcCzCsJoyopFVbLfDA4rtz0b5ErYzeocUXSq/yL3YKZMHA49TmXByoTd3+F082XVWWgzz aW2CYAcJ2QIcNg98NiGN7hkAlyemKIrCOuUdtwVjq6FRr/eFokb9Jjwq73cKwjOb8QcoN5 3aI66QRgD7o+iNNFqDzEgbFONmuin2Y= X-MC-Unique: f0D_LdyXPU2xmYLOsLPSDA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/SwK7FX3kH1UWtK3h3/1AavB3Zp9Tje3hQEQT9u6kU8=; b=dOa5p2t7+AUhILYZb5/D9/oZf5DTUUicQJ/wmr2ysf0TsZIxasAfbJdPTGOLIGNlyA XilhECTmyGkj8JPy7TRNuacVQhCW1NRhztjyMnc1ug7iAIgYuyzErJdrkzUEgPhhinKf 1wyWbe5QQ8FwoY6cLlkEnCtIKgHR7WQ0GNb/s8KKPmYwwVVXb8yzGWFBadASZIrql56P VzX6CUFDqH/r0tmF+iZcwke/AyALmrggHPNQOrIlhJUcJSEcFRKdVT2Te3Iyd5QXi3yQ gTeXdDruxfD6uVhWdsZM1IObCqhsE1LgqSY2Pr8pGC/eaFJFd3mJ8GLcsNnAR77rNv++ zdag== X-Gm-Message-State: AOAM5326U17K3RqrdVppDlGPy/orJzaf2uOsRaYqchX5bAK9zye7xn5g zNGWOysJsekw+g8e85hgTsovSgVZrDgVpHH7OclmjXt0sqdyDt9IuWPWFjme3dW1vhXOnE9bu56 MH1ppi7XTjwmaVA== X-Received: by 2002:a1c:c911:: with SMTP id f17mr21525715wmb.45.1619465756711; Mon, 26 Apr 2021 12:35:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCXFZJfuCsZD6GeozfGMj7nTkyuZ7WzQqPIkaCKCWCw6PWoyIT0Kn90gGXuY1yLPwpzSQBTQ== X-Received: by 2002:a1c:c911:: with SMTP id f17mr21525698wmb.45.1619465756518; Mon, 26 Apr 2021 12:35:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , qemu-riscv@nongnu.org, Laszlo Ersek , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required Date: Mon, 26 Apr 2021 21:35:20 +0200 Message-Id: <20210426193520.4115528-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210426193520.4115528-1-philmd@redhat.com> References: <20210426193520.4115528-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) If the Kconfig 'FW_CFG' symbol is not selected, it is pointless to build the fw_cfg device. Update the stubs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- hw/nvram/meson.build | 2 +- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/stubs/fw_cfg.c b/stubs/fw_cfg.c index bb1e3c8aa95..ac1e539c93f 100644 --- a/stubs/fw_cfg.c +++ b/stubs/fw_cfg.c @@ -1,7 +1,7 @@ /* * fw_cfg stubs * - * Copyright (c) 2019 Red Hat, Inc. + * Copyright (c) 2019,2021 Red Hat, Inc. * * Author: * Philippe Mathieu-Daud=C3=A9 @@ -13,9 +13,54 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/nvram/fw_cfg.h" =20 -const char *fw_cfg_arch_key_name(uint16_t key) +FWCfgState *fw_cfg_find(void) { return NULL; } + +bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename, + const char *gen_id, Error **errp) +{ + error_setg(errp, "fw-cfg device not built in"); + + return true; +} + +void fw_cfg_add_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, + FWCfgCallback select_cb, + FWCfgWriteCallback write_cb, + void *callback_opaque, + void *data, size_t len, bool read_only) +{ + g_assert_not_reached(); +} + +void *fw_cfg_modify_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_set_order_override(FWCfgState *s, int order) +{ + g_assert_not_reached(); +} + +void fw_cfg_reset_order_override(FWCfgState *s) +{ + g_assert_not_reached(); +} + +bool fw_cfg_dma_enabled(void *opaque) +{ + g_assert_not_reached(); +} diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build index fd2951a860f..99e12224483 100644 --- a/hw/nvram/meson.build +++ b/hw/nvram/meson.build @@ -1,7 +1,7 @@ # QOM interfaces must be available anytime QOM is used. qom_ss.add(files('fw_cfg-interface.c')) =20 -softmmu_ss.add(files('fw_cfg.c')) +softmmu_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c')) softmmu_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c')) softmmu_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c= ')) --=20 2.26.3