From patchwork Tue Apr 16 13:52:36 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: 789218 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:dcf:b0:346:15ad:a2a with SMTP id dw15csp297067wrb; Tue, 16 Apr 2024 06:55:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4itFwcEIHzdMQ7WmIiIQc7v8EY3PMik1YQgex1IyH3eC3AWWzopyiYrB70GqjBTOglrJ6cgg5v3Wsr8kvzqPV X-Google-Smtp-Source: AGHT+IGOf3ph6P1YMYlaAbWcwC+X+0zunjOU0R/E/HZfF3OHZetzWYPdgpehSUWsIcDtO7gsYF8+ X-Received: by 2002:a0c:f88e:0:b0:69b:3c90:400f with SMTP id u14-20020a0cf88e000000b0069b3c90400fmr12787113qvn.32.1713275743660; Tue, 16 Apr 2024 06:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713275743; cv=none; d=google.com; s=arc-20160816; b=EEvedVUC/zlqL6n5J+ToHZErwXY82aq669vVCC/JOw/SyT0TE0qDGMpLnJaI0oBwR5 uW1jSQyvT3ArE/KeauLr179jHIz7JQsaDfSt4uWEBvrU08LEPv5B1w+PJrLgUr6EJd0I eycKHHm5VvYlx+/bzXOkLfQRvvX+4dzeJplQPMN12k3j0gPFvtxBY0muVvH1rJpY+3fK lI3Lpke77mkJAa0Cuo4q9f8A7AxJsDhkfAdM8b4b+3moDXJ/TGQDxowmsdEOK4Cj2dv4 1kAPBxBxl4V0Dt56C3Wxx+rcDztfD7oSQoJA221Zn5jG//qDxjFgooyZn9L2WwurMUk3 ps7Q== 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=4bGWK6aHmDUNMYAUChRjF6jGSZ31jg0glhkDhdFHxaE=; b=x0gceaWsnSWC+7IA7x3yWSgRIsNelXUC6duW/wWW6tUxZeiCCqfNYyuPIoJnkC/f5T HinPRgghOhNe77W6l5Myelx4NVddPSQFLgqChh6RbGiyphEprV6x21CNFQaVwD/PhJSR Y+kPMyr1p/xN6wHt10xM5K6ZaAZCczMACqI2RVMm2pzdWzepgMtkp7Ygj5GV0ez/htFL QqnGJDtuH7Bq33AL8ozU8BDE6krgjc+2dYP0UP/h+prdFqvGHjEX/8qK9wjhiyVnwCoj XUoNPyAee+L9utaGGwe3vSk0PtP2QqMAC/E0PdzBejGFKytR2CsG0C4zPYjMuzZMAGUo ey5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QN6TZe4H; 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 c14-20020a0cd60e000000b0069b40c7f96fsi12478738qvj.310.2024.04.16.06.55.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2024 06:55:43 -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=QN6TZe4H; 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 1rwjG3-0002Jf-QP; Tue, 16 Apr 2024 09:53:59 -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 1rwjFt-00026w-Ip for qemu-devel@nongnu.org; Tue, 16 Apr 2024 09:53:51 -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 1rwjFm-0001n0-M3 for qemu-devel@nongnu.org; Tue, 16 Apr 2024 09:53:49 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5700a9caee0so4083316a12.2 for ; Tue, 16 Apr 2024 06:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713275621; x=1713880421; 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=QN6TZe4Hi69s/Wjpnif8my+a9u1/mycfsRvLQ03ToLykSMJS4c3UZOnl/FBXmyky2l in3XIP4v29jyUprwEGFJziGnZWH92rrhN5K51/e92OwF9rwkxquZaCXdjv0SkAU+eu5t hYxZpf2ztOL0E4klNcJpuNUOHvOIgoa0IIRitJnVAEd9sskGx1ocrIz4v1ieFp1YQ+5c xZwqC5NmfX5Fm/lqc1TtlcOFbxnFjG6wI5xFCEbsiD18SfLCjDBTujN1JlGpKgSEfOjo 9gNMb2MMfHkW0MhNzyEHVDhkD9w9rrFk+HCHxswlRIq9TGDkypJ2VwjLUGTF3cBA9G5/ M1zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713275621; x=1713880421; 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=RRtmaRK7KfzuyuFrm+U46tMEDmWQXdHjDPpBChmX8oxHLJWI8+TNV0bGUJnVaVtYDe rwYA0SvpJmICMIM++EqyIIXgClPGMMJVqcqyqsy6+fzZi7oHYAOwKVX0NQJ/fH3Mzgqt MzLCpzdq0vJKG4wH5n62g45zMKCOhn5nqdnRp8OSfzHDcoNpY4Y0+5RKT9MxGY2llHty StQywIdjnJCqm/e025g9NTDZNoT2wjbEgZXvK6eofWTgVRMit8f5bFYXgIxS/nLE9WrB U6fh5vXJbeMivXqkiqdNgttdQfJM8q0b4eoMzN0pZIoJ054XcvMjlEvi4qiTjPF3eCx+ MG6g== X-Gm-Message-State: AOJu0YxVprtcDCgHAOlMcrraUCiQ+d4E8rEo5xtR7MEZ2L6v1swvHAqQ olqP0PnMKY9DFiMf9Yjbe3LWiI7ETib1kJSztBiCJ8MoQKkDVcyzie8RqfF7m+xn3K+a8C/50L4 f X-Received: by 2002:a17:906:ecac:b0:a52:6ba8:8bf1 with SMTP id qh12-20020a170906ecac00b00a526ba88bf1mr3357576ejb.77.1713275620894; Tue, 16 Apr 2024 06:53:40 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.61]) by smtp.gmail.com with ESMTPSA id ho41-20020a1709070ea900b00a524318c380sm4976387ejc.80.2024.04.16.06.53.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Apr 2024 06:53:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: Ani Sinha , qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Zhao Liu , David Hildenbrand , Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum Subject: [PATCH v3 07/22] hw/acpi/ich9: Remove dead code related to 'acpi_memory_hotplug' Date: Tue, 16 Apr 2024 15:52:36 +0200 Message-ID: <20240416135252.8384-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240416135252.8384-1-philmd@linaro.org> References: <20240416135252.8384-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 autolearn=unavailable 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 --- 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) {