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: 1924162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=QN6TZe4H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJlv621P7z1yZC for ; Tue, 16 Apr 2024 23:56:18 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwjG2-0002HC-VE; 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-00026G-22 for qemu-ppc@nongnu.org; Tue, 16 Apr 2024 09:53:49 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwjFm-0001mx-F7 for qemu-ppc@nongnu.org; Tue, 16 Apr 2024 09:53:48 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-56e346224bdso3775930a12.1 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=Scvi6vCUzHuBVjvLGQFQbwHDsKgdFmIU1iofri2pYbKdm3ZOsfnxK/ECYyyjGWSEta djQbVFkWntqoowrTVX2Ufc21/Ur38pkF0ot1e0t+rOcf4zphHY3Eg8H/SRlFxd+ewSjC 7869l64ULZb9Y05YdHD/1eDeinV6moH7Xgias9jWbBkv9n0X7eYFmLTSAH0gDAQ0s5IB UkS6pN3lhSYOAMrPKJD2+SXZMKVD5VZPPr/0/9J279LUStnSduNrRQrY2jexwBaOcVND v/OerD/AKA913StW+OHllM+9amYDt7dT18HAbUOq3lfo8o8/OtVRdKBiEHB2KhQhsKLE D40Q== X-Forwarded-Encrypted: i=1; AJvYcCVnldTjF0K7bdibLuw8FTyEAApbo3tMf4272BknICGkongnfBTA77WML9QeE3nDaADMkfOOUU0ekNfzmr3hUFb4OeUG X-Gm-Message-State: AOJu0YzXHxqsT/C3DtgIKYO0h/B+5KKyOI/c/OTkM40cduohMSKtjhZz Axa2x210J8vCPmlFtglWsPt7GUbqWk55Vrw0Vyw5F5fvcXJCd4mohzTmU3BzBLE= X-Google-Smtp-Source: AGHT+IG9GwsBxEHqpinP3LonbLPk3v0mIRKVFaq5iYprwUBs67j0MD+3TJfLJxHXzfifNj6VDYrcSA== 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::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.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) {