From patchwork Mon Jun 17 07:11:02 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: 804851 Delivered-To: patch@linaro.org Received: by 2002:adf:fb90:0:b0:360:93e7:1765 with SMTP id a16csp434402wrr; Mon, 17 Jun 2024 00:13:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUReol8u76V8ErgxyyozF4OGUKTd9jTMlfhRaUqtUtGu67qS2X7ZD9O5BXSFSFHuM8jNern595ht8+v2ln1K22g X-Google-Smtp-Source: AGHT+IEfdfjB9BmN1t405r+2aoDaoAYk3hJ8gUPpa4HckjWc//mdSMkvUANSbuM7V0iaknykJYty X-Received: by 2002:a05:622a:4b13:b0:444:93c3:78e8 with SMTP id d75a77b69052e-44493c37ae8mr11121461cf.68.1718608410693; Mon, 17 Jun 2024 00:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718608410; cv=none; d=google.com; s=arc-20160816; b=FZVdEMc8pKttIYLe7c1zwPuwR9/fTAh6gNvUKG27f4G1HB6YENKZCTGK8YFjmglg7j bafPPq1+1uj+wLWocJFe+JGu++DajCSNm/9R76jKYmhCr7e4m3RLFQQG3IOsgqt4Tmm9 jJ9gJJ8JqqnGQWhYKyBf8tOBBub/gpA92hZ0cxDDluby+pKg0egw/L4S9y/1sM/69fos nklC0jY+ORUAXWmUvwu6tHYcyIMGlf/4UfTLftXZSZUBOBqmGpUcEWtfUDkPPqjZXdBA gs15627BOR5g86HfstE5oCsv5nCLbA74ZFCQv5oStKuhWTR8vibZeUleumZR1f4EVgNS 1AyQ== 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=Fo4VTlbzmKiFjWTqqGA/K+jod2OTNQzIeBbnSnkCnAI=; fh=l8/n/W5i7z81h5FD9Kj1U/CuCFTc2BinYUZq3V7aXdQ=; b=RTZly4x4gW00lx1MVwi//16rlsJrQkA8ZVEn62TapOjB3G04FpTv3rRZIIigLLBNw8 opbmCRCFa51tZ4Aikly7Yr2Lzkn1Go1A6mnpR4c7pocx6v0LS2LP+sDMq56orb/ASelk CktRvH+188kYjFVXjxqPlPIEVfnpYpg2drr18HF+AqU3fT8f2NpjBhDMGmZ7IJDxh3ek Ctd6VdFA30hic4t0aRm59s0YYLYXMozqeiHPKlagXM47teKld3siuLTaFXIuZWq8gO4f QMR75TxtRqBx1OProZ8IH6q9Aw9LFqsiz5kx8qqOYJSG9prkzQs9PQvqgxF9pXxDySwB aXPg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zep3ty3n; 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-441f2fbc3a6si91523751cf.442.2024.06.17.00.13.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2024 00:13:30 -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=zep3ty3n; 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 1sJ6X8-0003vP-49; Mon, 17 Jun 2024 03:12:06 -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 1sJ6X5-0003v4-W0 for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:12:04 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJ6X4-0002Gc-9P for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:12:03 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a6ef8bf500dso440838966b.0 for ; Mon, 17 Jun 2024 00:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718608320; x=1719213120; 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=Fo4VTlbzmKiFjWTqqGA/K+jod2OTNQzIeBbnSnkCnAI=; b=zep3ty3n/NIlVtUWX6KP7fEdCfNKBZFMenLtmXtFsxir1ZgjIFMHxsWzqdB+1Wb+3D 514bM8kAQjJVw5QSLHCwFkyujIPT027YcmUxC5zvBKpCDwCF5teclFay84clZpZqkL/o aNJqyvUjgbS+bMK045/HheuB0491YtB3aq1Jw3U5F0aQuj91Q+4nqYM7ZS4PPmle+xPU sg+EXTM95FYPNkJiUjbGAca7YazhW1HzTu0IxHv3FCU966aBE6WtodXz/gAOhyIwfYes 4Mh1zGkQBVYn24IdfyrHILA8F3Kmv5hzmJkVtiNvjdGPf7GKeW9l8pyjIRne6v4jauKo 3i6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718608320; x=1719213120; 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=Fo4VTlbzmKiFjWTqqGA/K+jod2OTNQzIeBbnSnkCnAI=; b=sbON/GwISS8poc3ajZQuMKEdfe2x9zYwvBoj5XU7YxQbZq2Dvz0DA5T8J8Es95ZNsg Z+87VVKTB9geAr9/1Q01HmYdvygLXjqyo7xxHlA4lNHkdUbxZfVdxkUGxoTXMTL+Q4/a ZWp4IrmuOLq4L6pthQV09QtQWde4CSO2cWoa+nql7xHfjctl+jZMTyIhvdJq/UzNArnM /jdY6Zce+0nN7r0zLagynBt3iKU77QvCKUxOLlvibSSOotQ5yG6X8ED1fvqxhQkC36Ew /dTIKiwsZZx0Dch+IUAzzERwVoIISW89ADUHawmRxjSk9W4atldYgkqVLKC+jrmktW0+ 9dhg== X-Gm-Message-State: AOJu0Yz+sILqtjqBcZ1lrdtDhFlBG+yi4mo9N8wD02T2MZKnUx6Imy5P ToTVOp7MYnctw4Dh1Y2o+/yyfLqOHrdp/tVkayufBBYepvcgiTS6z/MqdT4/4S7A16azvHyZN+c 8ofo= X-Received: by 2002:a17:907:7f26:b0:a6f:50ae:e09 with SMTP id a640c23a62f3a-a6f60cefc4emr819615966b.4.1718608320319; Mon, 17 Jun 2024 00:12:00 -0700 (PDT) Received: from m1x-phil.lan ([176.176.169.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f88522f42sm85258866b.110.2024.06.17.00.11.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Jun 2024 00:11:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Zhao Liu Subject: [PATCH v6 07/23] hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' Date: Mon, 17 Jun 2024 09:11:02 +0200 Message-ID: <20240617071118.60464-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240617071118.60464-1-philmd@linaro.org> References: <20240617071118.60464-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.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) {