From nobody Wed Nov 19 00:15:55 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1613438171; cv=none; d=zohomail.com; s=zohoarc; b=YFP98pKJ8euwAKGbBi58HdZ9VrXknmic7BgutMcpxac++tRwFPJkT+bySgMZIrg27jnY2dh1VjHehW4hmH6Dizo+awj5aqJKl+g/XpH/ukZp7l4+JEVrPU5vuZDGFxWSSXZf8LXAeLbXlekAvcSkImxF3fjMisbesfWPx3IuSZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613438171; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=pB14ev1FFKpSJOdbsMlbX7MDZ6J/W1OFrdD69jeA04I=; b=lMGTJRIsgCmJe9+dGm4EzwxyBKPeHGlHundiPHx9VWE04S+NtO4cYlXfH38HrrYxzfVMy+aOmfrPIEpuFsh+9f+Xt6nIxCPTsbqqEhoILqi2+sB/neoNwwpRL3nzJPCgU+VNbYUgrV2CK6ZS6Oh1p9853Hwi6F8USEdc2jqAfG8= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613438171224415.0201803970425; Mon, 15 Feb 2021 17:16:11 -0800 (PST) Received: from localhost ([::1]:39414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBoyI-0002s4-91 for importer@patchew.org; Mon, 15 Feb 2021 20:16:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBopS-0001xI-08 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 20:07:04 -0500 Received: from mga07.intel.com ([134.134.136.100]:13624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBopQ-0004kI-62 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 20:07:01 -0500 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2021 17:06:43 -0800 Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2021 17:06:43 -0800 IronPort-SDR: UDICC/reJ26878yK/50EjsSK7SoRM/uuPzB/IYzMn3Dy00MVYKZBMjiGh9UI+ixzksV/PvBtRN LOkdRe3ivZuw== X-IronPort-AV: E=McAfee;i="6000,8403,9896"; a="246849236" X-IronPort-AV: E=Sophos;i="5.81,182,1610438400"; d="scan'208";a="246849236" IronPort-SDR: Be+FgN3/n+jTaaZX9+fnTE6kDBd06SVUfrkxIbs4+8FNB5huhfEAtHN0UrA1C5gMDHrC2BYozA nAqJb+DnE6hg== X-IronPort-AV: E=Sophos;i="5.81,182,1610438400"; d="scan'208";a="591695481" From: isaku.yamahata@gmail.com To: qemu-devel@nongnu.org, imammedo@redhat.com, mst@redhat.com, marcel.apfelbaum@gmail.com Subject: [PATCH v4 03/10] ich9, piix4: add properoty, smm-compat, to keep compatibility of SMM Date: Mon, 15 Feb 2021 17:04:08 -0800 Message-Id: <0868535e8cc04534e2f2f95fbaca50afa18d0a0a.1613436967.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: 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=134.134.136.100; envelope-from=isaku.yamahata@intel.com; helo=mga07.intel.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Isaku Yamahata The following patch will introduce incompatible behavior of SMM. Introduce a property to keep the old behavior for compatibility. To enable smm compat, use "-global ICH9-LPC.smm-compat=3Don" or "-global PIIX4.smm-compat=3Don" Suggested-by: Igor Mammedov Signed-off-by: Isaku Yamahata --- hw/acpi/piix4.c | 2 ++ hw/core/machine.c | 5 ++++- hw/isa/lpc_ich9.c | 1 + include/hw/acpi/ich9.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 669be5bbf6..30dd9b2309 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -74,6 +74,7 @@ struct PIIX4PMState { qemu_irq irq; qemu_irq smi_irq; int smm_enabled; + bool smm_compat; Notifier machine_ready; Notifier powerdown_notifier; =20 @@ -642,6 +643,7 @@ static Property piix4_pm_properties[] =3D { use_acpi_root_pci_hotplug, true), DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState, acpi_memory_hotplug.is_enabled, true), + DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index de3b8f1b31..870c9201df 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -33,7 +33,10 @@ #include "migration/global_state.h" #include "migration/vmstate.h" =20 -GlobalProperty hw_compat_5_2[] =3D {}; +GlobalProperty hw_compat_5_2[] =3D { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +}; const size_t hw_compat_5_2_len =3D G_N_ELEMENTS(hw_compat_5_2); =20 GlobalProperty hw_compat_5_1[] =3D { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index d3145bf014..3963b73520 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -775,6 +775,7 @@ static const VMStateDescription vmstate_ich9_lpc =3D { =20 static Property ich9_lpc_properties[] =3D { DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true), + DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, ICH9_LPC_SMI_F_BROADCAST_BIT, true), DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features, diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 54571c77e0..df519e40b5 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -59,6 +59,7 @@ typedef struct ICH9LPCPMRegs { uint8_t disable_s4; uint8_t s4_val; uint8_t smm_enabled; + bool smm_compat; bool enable_tco; TCOIORegs tco_regs; } ICH9LPCPMRegs; --=20 2.17.1