From nobody Thu Jan 23 03:31:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1737466969; cv=none; d=zohomail.com; s=zohoarc; b=jqw2+lxX7VKE7FlanQqm7wxIvd0dnC7iSsRlYwM6AWA6AIHwJP8bqu7pp/zzWSTP5hwuP/kjp51UxhIlkeCs1Voq5xygyeM/vom00hk5xbbqHWy3a+Iw+pV8H/l2rD3yS07VsTjojOd49JJQrxtUGfBjp/pVdLWijpaeJUtGCy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737466969; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8e2eYuYtEgPEV9zxQhU1yHd1yHupFmV1bM4Rw1e06so=; b=EL8PbyngLH594qGJusxmYyrCVV7kXLgXhsEoEWrS7sSpTkn0dEMJC4ajVCEFHagkX+6wQ+TzrOYXJcKclMy9E+AK6mSpsCXX1DAf9qNA5iVkfEDuFaiLqTXOeeAOkR4vKycxX1bHvYs2XvdoVAYZ120qk0f/B0XUZFHF6yLUxJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737466969316959.8826595998961; Tue, 21 Jan 2025 05:42:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taEWP-0007Nm-JG; Tue, 21 Jan 2025 08:42:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taEWF-0007My-HF for qemu-devel@nongnu.org; Tue, 21 Jan 2025 08:42:16 -0500 Received: from mgamail.intel.com ([192.198.163.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taEWD-0005Sf-O9 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 08:42:15 -0500 Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2025 05:42:09 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa009.fm.intel.com with ESMTP; 21 Jan 2025 05:42:07 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737466933; x=1769002933; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MZB7qv2zEFLJ0rFzdkMC19zKNxW1JIUku/QSmxpL4G8=; b=JAF1spCyI+nLA9IbtKRs5FAF/R4t0wl9FIiDudGj9In5X9RszxQ085Kk S1gs/CVFDA9w8brWy3X3Y0zqHdqFLtxQM6ZrjsR+7L4ISotOz68GFMMn3 UaCtKqcCgvx5uucacMIe3VqoNo7Ux20LFNBUi3MO0vOMs5hOrjmO22kuL KvepYXqMcbCyS0a6NNZdXo4hVL6MTDJR4aRD9EHsb/m/iDvim6AUxJyt+ 4+ZgvT0wwUlknzVXnQrJJT7Q7HWZFT8C9XWn5s92jrO94xqjOWNXKUyvv 9bQt4veLqdXQvePMi6y/Mrb9vr1Z+hl0qzCXrF+Yr5m4N1dyNC0IFsDRO g==; X-CSE-ConnectionGUID: MWpiQKV8Te2tnCPvfOTUHw== X-CSE-MsgGUID: neA9OuKDRlCbY4LEAZzcuA== X-IronPort-AV: E=McAfee;i="6700,10204,11322"; a="37793650" X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="37793650" X-CSE-ConnectionGUID: JJYT/Lc4TqKe6/oAZdKrgQ== X-CSE-MsgGUID: Jk93buC+RlaJe0oR5arLFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="107411954" From: Zhao Liu To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S . Tsirkin" , Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=83?= Cc: qemu-devel@nongnu.org, Zhao Liu Subject: [PATCH RESEND] i386: Only configure HPET firmware info when HPET is enabled Date: Tue, 21 Jan 2025 22:01:21 +0800 Message-Id: <20250121140121.84550-1-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.198.163.17; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1737466970456019000 Content-Type: text/plain; charset="utf-8" At present, the hpet_cfg is written unconditionally since 40ac17cd56eb ("pass info about hpets to seabios.]"), because it concerns ACPI HPET is created unconditionally. But that fact has changed since 51124bbfd2ea ("i386: acpi: Don't build HPET ACPI entry if HPET is disabled") and ACPI checks if HPET device exists in (hw/i386/acpi-build.c). Therefore, configure HPET firmware information if and only if HPET is enabled. Signed-off-by: Zhao Liu --- Resend: * Resend the patch since it was missed on https://lore.kernel.org/qemu-dev= el/. --- hw/i386/fw_cfg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 91bf1df0f2e4..d2cb08715a21 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -149,7 +149,14 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, #endif fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1); =20 - fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_cfg, sizeof(hpet_cfg)); +#ifdef CONFIG_HPET + PCMachineState *pcms =3D + (PCMachineState *)object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE); + if (pcms && pcms->hpet_enabled) { + fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_cfg, sizeof(hpet_cfg)); + } +#endif + /* allocate memory for the NUMA channel: one (64bit) word for the numb= er * of nodes, one word for each VCPU->node and one word for each node to * hold the amount of memory. --=20 2.34.1