From patchwork Wed May 29 05:15:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 799806 Delivered-To: patch@linaro.org Received: by 2002:adf:e110:0:b0:35b:5a80:51b4 with SMTP id t16csp566873wrz; Tue, 28 May 2024 22:17:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUp3h/fqlu6KgBvSRm0fFbKNPYs4+LZAnQGS6ZPRdsuEGZdJP531/VG06+bU24zAPbyvc8VbXRanrdD2VTfO4Ut X-Google-Smtp-Source: AGHT+IFj5hkHjY1vx6WBSHTEJpmNvR7M8sDX7SfM9LHo7bWTgO9j9edATDrvHK5cnoqCFklbuO0G X-Received: by 2002:a05:622a:612:b0:43a:b9c9:a25c with SMTP id d75a77b69052e-43fb0e80667mr181689751cf.38.1716959829843; Tue, 28 May 2024 22:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716959829; cv=none; d=google.com; s=arc-20160816; b=MbND4UKkNOALPOzWJaUZvYilYvD/LeELTxjNLehcnpzZPkCC3cHB8tq2MrV7Loi42z WEAu6IVtA/EdhFyhlnO3xAe9KsJY06Xrb1med1moG4n1C9wWnlSSZHD387z+xRuMbDPd b6JbIfADv7XQCCsOdLS/t/A90d4Nktymn9C5dmqQI0LUtYyNpEzLi+ZUzcSLOU94lq/q BZSmvXYeSMsT5Mel0T3rY907Bi7/e1d8DMUJiJ2KIdk9skCkwySxe6dQ3uUabSsT2kJB JQRBvm2Derb1sNkGGImj/dRwkx8UNyVStd6uU6p8pr97CwtGoXTd1LkAJQCjKpi6vx+M zwqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aDu2aZ9r50YKxf+dNaxDqKUjAn6DYpDYAzbmilk8iWY=; fh=oSujGHGU6kAtfrTPSJ+sLUg/jC0/xSWRKBD061WPWBw=; b=wcshBMCfDp9Eczrv8zg59YXmK50Zge4aF3CpfvhoclxUglym0RwaLLDCqSbbU+pPvK sL7ZCRc0gmcAGTsLA/+Yecq9/RxOt6bBIB5TRYyqatUdSkYWC4vY0227By/YKcpYYvqV nB+lsQn15Sn3F4B0xe2nFOLAuee/lmys/G/xBBcoUPrQqtX/ZLAsDb4UR78azleQrHNo igcty98fMyaiCmZY2huaOj8faR4IZNt4Knq68ZlcVSSPerrO5qLIuJgcWrTxV4RcALw0 +m6a46NNMAfOqbqEQlfgaSikTr1NEZ5rl/ynZW2LnxJxXridMf6ew0WoyMVH6tA1bQfM 1Sdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YVhMj/11"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-43fc8bc36f3si76387571cf.771.2024.05.28.22.17.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2024 22:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YVhMj/11"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCBfn-0000Qc-R3; Wed, 29 May 2024 01:16:27 -0400 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 1sCBfl-0000Pv-49 for qemu-devel@nongnu.org; Wed, 29 May 2024 01:16:25 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCBfh-0005Ry-C9 for qemu-devel@nongnu.org; Wed, 29 May 2024 01:16:23 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42120fc8cbfso10495475e9.2 for ; Tue, 28 May 2024 22:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716959779; x=1717564579; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aDu2aZ9r50YKxf+dNaxDqKUjAn6DYpDYAzbmilk8iWY=; b=YVhMj/11/Aq2ZQZV4XSJczqrjlikDGNak2hnwkj8uCY3nuFjWJp5NZAFpmsL/tW3xK X8OJva8aJ20dxK3TEvdPAV1+sy2jgg1LL+yYB4j5YRBDlfNclmU5gzenlKrzuTcicnsM aeDmGMgcl+jtScwer/3JiM7NlK4JwpuasqI5aEDrkbCQFNBK2GPDG2W30LMmI651Dqqm vJDwXIeoDBhCPAY9PgNsv4LcXdUu3UcYvvNvOjoxF4hK1Mb3d3i1HTN1HSboh7kHfKkv ErOX2aAPwu6ReuSAdMsszGMIdRKET9DfOyDUuoC+HzE3k+fG0TBq/7x4fH3TjiN10Ibk 6VeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716959779; x=1717564579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aDu2aZ9r50YKxf+dNaxDqKUjAn6DYpDYAzbmilk8iWY=; b=C7pEnqsgaFbPVWBr76XSGDNv/AaKTUjfGAraT46/na7jAci4UbiqxN0ceF1EgaR4kM SbuaSCKcZRZY+20HJAbHn2EDnyc2wsjCgr5DrHd4ErV30JUVHloUj4A/xzwSGmTDsA4J dGn5iQWD3br5SCUJyRFOPw8HVxprchcqpkA4p+icY2gqa8DiuvZZS/vwKcu1S+mWtXVk hkcR77HbcEVu+PnOb3KAHQVfys1/ELue/tsW8byI8LpoaodFuky0wNvxdkXRg++FOFL4 hdkFmINEjs5dRPC8vyc5/pJdJnP4dDi1osy+dy9XGdcUmvBkyac5CXbQm0OPr5zGH5Sb FPqw== X-Gm-Message-State: AOJu0YxCddLiFDLCHt+4JMoagpJRfMlCBpm8uVCHDUccFkQDyTwuw1Is cfG7VJPR2xCYl+gQOWmb73ezcfqtwSqoFPfdR0uNL5+3P5BxIIXGcumF+ckz8qw3j1WwLkMe3FG 6 X-Received: by 2002:a05:600c:56d5:b0:41f:ed4c:b8b6 with SMTP id 5b1f17b1804b1-42108a0cac4mr113189805e9.38.1716959779617; Tue, 28 May 2024 22:16:19 -0700 (PDT) Received: from m1x-phil.lan ([176.187.204.141]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3557a08cc1bsm13761937f8f.45.2024.05.28.22.16.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 May 2024 22:16:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PATCH v5 07/23] hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' Date: Wed, 29 May 2024 07:15:23 +0200 Message-ID: <20240529051539.71210-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240529051539.71210-1-philmd@linaro.org> References: <20240529051539.71210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org acpi_memory_hotplug::is_enabled is set to %true once via ich9_lpc_initfn() -> ich9_pm_add_properties(). No need to check it, so remove now dead code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov --- hw/acpi/ich9.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 9b605af21a..02d8546bd3 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -153,17 +153,10 @@ static int ich9_pm_post_load(void *opaque, int version_id) .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ } -static bool vmstate_test_use_memhp(void *opaque) -{ - ICH9LPCPMRegs *s = opaque; - return s->acpi_memory_hotplug.is_enabled; -} - static const VMStateDescription vmstate_memhp_state = { .name = "ich9_pm/memhp", .version_id = 1, .minimum_version_id = 1, - .needed = vmstate_test_use_memhp, .fields = (const VMStateField[]) { VMSTATE_MEMORY_HOTPLUG(acpi_memory_hotplug, ICH9LPCPMRegs), VMSTATE_END_OF_LIST() @@ -335,11 +328,9 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq) legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci), &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE); - if (pm->acpi_memory_hotplug.is_enabled) { - acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci), - &pm->acpi_memory_hotplug, - ACPI_MEMORY_HOTPLUG_BASE); - } + acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci), + &pm->acpi_memory_hotplug, + ACPI_MEMORY_HOTPLUG_BASE); } static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, const char *name, @@ -460,12 +451,7 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, return; } - if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) && - !lpc->pm.acpi_memory_hotplug.is_enabled) { - error_setg(errp, - "memory hotplug is not enabled: %s.memory-hotplug-support " - "is not set", object_get_typename(OBJECT(lpc))); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { + if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { uint64_t negotiated = lpc->smi_negotiated_features; if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) && @@ -509,8 +495,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, { ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev); - if (lpc->pm.acpi_memory_hotplug.is_enabled && - object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { acpi_memory_unplug_request_cb(hotplug_dev, &lpc->pm.acpi_memory_hotplug, dev, errp); @@ -545,8 +530,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, { ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev); - if (lpc->pm.acpi_memory_hotplug.is_enabled && - object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { acpi_memory_unplug_cb(&lpc->pm.acpi_memory_hotplug, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && !lpc->pm.cpu_hotplug_legacy) {