From patchwork Tue Jun 18 15:59:29 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: 805214 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp271403wrx; Tue, 18 Jun 2024 09:03:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXdwHEWr/SXlSRP6fQWjlHjNEx2s7BEzMd0Ti0rNeR3LOt9mJ1Yf74iHulQIVXHmvUF/F0WRR25rsPAffexyKgu X-Google-Smtp-Source: AGHT+IExpvGqzGzOeBvxXrW9bj/m/SlVVZ423+EBxhy1zGQPEgVQx2GLx3vaXEuz1MTzzk8rilqg X-Received: by 2002:a05:620a:2681:b0:795:5d6f:8bbd with SMTP id af79cd13be357-79bb3ee352emr10168685a.73.1718726629230; Tue, 18 Jun 2024 09:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718726629; cv=none; d=google.com; s=arc-20160816; b=X+/Ti9sv5PUZxG8iDhpehFsvyNF6mnlgaL/0aOqDaqlDh3/uSqHlQY5OuPs9TaCuJF 4+lXG0+PCvUZiFahUJ+qN4Uk4jv9/TOlvbf3VcfUZa7MjEfqsqVuv2aIWwqFuGB0Y/3r KuZQGayvtTWha+hzpSbJ2hE2jJRMUXZI2cKBLnFiwGs7N6sbQTutG6Q+8qTlao9V5xnG kaNkX/HXGUkcZ8oW0UZ9M1kxxe5eRxYHnzLmdGVj1K1HijIkCf8p2/6VeifQa3O1AXPP 0izHrNU4UFLaX4WsEEpEg/C/IhEg/uIZKxO/HbHU//H8YtCMMvy2R9SJbxv0QlVltIny RVXg== 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=wZClkhebefv0pxqdA8l3mJykMlig1mw3XzgkSFFa0iE=; fh=qIwwf5yzYdGUjWHfLdZ1pY/abUtmNziDEAnYJGhPICo=; b=QnSzntHsyrgyDuC4rEwW4g2YaUjEACCVxiUxhsW1mFWbf52x/wP72ft+5Mb7d4+ALd ULBUifhot7wZvDy0ZleB6nblXvTL4FiRXv073r+tzxv92ZGpG+oGIFW+7yGNP83wYVJg RL/tJG5gHLH3iHKNwLKbqdcs4kI35rieW8UYE7vREVHNYOn6km8vmpeu5X41565jEkBT uWX2u82WJIp28r/6AM3G6AXXd6ohX7krZ+d0EU/X4zRGAIcqlr8Ygus20bTWFNa2Y6Wz V/8+MKpBWffvU37kQ+woQnup6/kqbi2vmsXQHN05TE5jwQduntTlzgLpQwG/3EIrXL9/ Z4EA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u/m3GJYZ"; 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 af79cd13be357-79bb1a3fac1si51623185a.354.2024.06.18.09.03.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:03:49 -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="u/m3GJYZ"; 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 1sJbHH-0003xi-8A; Tue, 18 Jun 2024 12:01:48 -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 1sJbGz-0003dE-B8 for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:01:31 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbGw-0006lu-C4 for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:01:28 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-57c83100c5fso6174655a12.3 for ; Tue, 18 Jun 2024 09:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726483; x=1719331283; 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=wZClkhebefv0pxqdA8l3mJykMlig1mw3XzgkSFFa0iE=; b=u/m3GJYZeEtuf2iSxdVZ5xlgRgW7qcz2lyRSDrwHmE7TrcS9JAOIFEaaCaTwKVOCNy 8AxN8rc2XKc2mWQAj623yk+YJzQB5HLUklAk6eUjNwvysdvFAWcEwVlaOiNBOCo+t58L dF8I7G2V0wF9kpy+FNM2nnuEdn12NAkNkfoclkbNdXFckR1zF0CsGFpYjvoQLTDp2YoT TGvPAIvQ5nN5LO7WRXxBJPLNxY9TTIGtKp6Esf6iu5LJc3zluOOF/+hjEPlQy4CUGtzF 1BxbL4b//fqP/5DevU/Krf73+DV179F84xvXTS0mP/Wc90q2eeVd3YFJuhKnR2qgMY04 bD/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726483; x=1719331283; 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=wZClkhebefv0pxqdA8l3mJykMlig1mw3XzgkSFFa0iE=; b=cAudWue8BUmfnase5CVtfrFXVI5kU9o5lJU8jCO1qwdQwviM6Q8eZTrtredTWxOrd5 xZ/mu/QQ/s4Y2Uz0rxqofX6yVR/nyHD5fc0vpO+7Gi/Jlcl8ObtiZl+bBnfh7FI65mNG rwAP5OMIYx0bNDhFeSq1NSw7SOT6DPgq/lzyMX9QxGnXsuEAiNcTGI9z87a1XNDQHU4/ MQVOk7Wsjp52BNVkdieu21J7SAuTw9glf1iXwmSjQTRPO2sQci1ujUcsd7qiD+j8k4Nw Ve6lXdrJWKjFv6mZ48WzPQkdXC54IIzyM6fnMY4EFgVVV7S4T5ZjQ34QXW+HR+zxs4OU LDUQ== X-Gm-Message-State: AOJu0YwrEMPinKVqlna+mwUOtXZWUGC++PxoZJ7w405tywxqaJ92viyL Ie0ndQONaN9exe1uvEWXPbtfyAq8O3LSlaNYj1UN0D1QwHjRHeJv7xenMD3UxUXVcvE0yiN7PW4 f X-Received: by 2002:a50:ab1d:0:b0:57c:6463:9960 with SMTP id 4fb4d7f45d1cf-57cbd8e7abemr7728683a12.37.1718726483157; Tue, 18 Jun 2024 09:01:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72e9515sm7906127a12.41.2024.06.18.09.01.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:01:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Igor Mammedov Subject: [PULL 07/76] hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' Date: Tue, 18 Jun 2024 17:59:29 +0200 Message-ID: <20240618160039.36108-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.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 Message-Id: <20240617071118.60464-8-philmd@linaro.org> --- 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) {