From patchwork Fri Feb 3 16:30:19 2023 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: 650086 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp917107pva; Fri, 3 Feb 2023 08:32:01 -0800 (PST) X-Google-Smtp-Source: AK7set/rudM1BNtUzMvUZx2Y+Du+TQcmlQO4P5NlWbFGQrlw0mP8ecJn+RSvkfjA9lEnzdABp4p/ X-Received: by 2002:a67:cc05:0:b0:3f3:2b63:3c4c with SMTP id q5-20020a67cc05000000b003f32b633c4cmr5602195vsl.27.1675441921353; Fri, 03 Feb 2023 08:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675441921; cv=none; d=google.com; s=arc-20160816; b=DEbW0ZSP/8t0i25jHX3GmPVC1rzYQbI22LQBebY+U/hF4mHZappjdB1QLfOG2TPJO4 FA+o9uVaOIJ8WsnmlF1g9ib0SciRN2GGOXzRHScNQ5HbQRfFsqmLpKOqA5hQhOnHwog7 +aW6yJg6OQYFYQJkV8zBFRj/ib4RbOAL3XfqPn61QUmJMY4A0zI1F0DnE4KDX6dPBO17 bhyOGyA5AC+KTj92v6ZH5RTs9lJbt+9IN9gw6XFGYEPadnUc2Ug+bnABI1GpSrlVJSEn NWH08BQIcACRsamtNMElvidgzm8tadcEhjynQDAfkHf9M3uo84g1araGE6mswGUsF2/S Glwg== 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=rI8YBskLtC8mMs+vacOa3C62UUOa+s+K2Ki5NU8X6dw=; b=VnSOe1YgBtMZIRjXcpUCyjAlvqAzfeYqrkgQ/8FbZ9PNvd8yJbaTyad5EvsDAqOVX8 FMQhpjcZIjTvcg0M07D5WAoJdkDH/1n5lgxSKfPKJZ/SNxqomZUY1CNmu9+hEiORMH8B YmaFzxLg/9KhL2VdhLCY2UMM16wepvwEzJSAukFqqoNvNVroSakvluyukG5W4Kx18Akd A4z+ZB7kooCml5byCFSL1gZ+AXtqUlEsm5O4e7zPoW/7HNpyNpN+16YDIPGco7eOfoxv 4ZlT8mOm5FePLpZ3YDP4LPJ2kRtrj8XaRMn05Rh34fdU6Mc657kk5/n9UQ/IPJ+3rwPo PZzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P4p9vMoY; 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 y9-20020ab05b89000000b0063a13373ebbsi1073081uae.47.2023.02.03.08.32.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 08:32:01 -0800 (PST) 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=P4p9vMoY; 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 1pNyxY-0001NG-8m; Fri, 03 Feb 2023 11:30:44 -0500 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 1pNyxU-0001KB-WC for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:41 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNyxP-0007mp-2R for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:37 -0500 Received: by mail-wr1-x433.google.com with SMTP id j25so1611952wrc.4 for ; Fri, 03 Feb 2023 08:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=rI8YBskLtC8mMs+vacOa3C62UUOa+s+K2Ki5NU8X6dw=; b=P4p9vMoYeGHLOtIRjTyP8rs+AoGOwUYjOPjdDUUL/ej3rquQ1e1WNMGK/jxuoBCZzj AlmuHpFIkyOalCcVkvOM+HAKiahel/q7gMqywE27avxsEzukSLkDyPvTw7YbzqV94ONu 3UznkYYheR4UG6HkuHIo/RIoeFRdcmtkrXNEE9xT+uQSD347Guc298I0WvIKMjTJrbl+ 8KGgl6Ga4EB5EtW4xh/rHnAmk99tD2mxNS8y9LtLKtRHhESYGogBDoH50WFdvd/8vvxY aePaUpqPKsV4rw3g0bGUhnGWrPgXN35/TTVSmFK1lksgGmORGqHPDrjfzDArzzJAX4X2 aqcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=rI8YBskLtC8mMs+vacOa3C62UUOa+s+K2Ki5NU8X6dw=; b=aFBPmYRuvQP1uGeHwcvDxWXx4nk8Jr7+DuHPMqwktuVgn77ASqgogbGu9WsukhyzYc VfKUcqSB+86y6aVI39ak5GbrtU3Hw++7zhmPOD2J2YoXfnad0+5QwajUaX9x925irlsp nOwjOmcmbmEGOEDhIWtRz8+b10Yr2O6Tmfi5J7TBvFpQ4yPDPc6OJvCwxy72Q7dPOKie fjC2ZXZRhf87jYZ6DnvTE5+7e5t1HSROkW/jBqGyKQt5abXB0z0UPb/7aBQ3qp4SV6Zf ECVSIJex6WwxBIYT3IgA9FNNd1R+P4Nv5VCWp9vJbVAN3lJdRMMLtTe+9yRcCEPL175N AYrQ== X-Gm-Message-State: AO0yUKXGVPxz80D/FH/yv1ut0lQ2OJ+lqPC/kuYZRyJKAKDEtfi8hth6 xXNE5xpdBo77yGl1WCj8uNzb1cMmiRfOQhVP X-Received: by 2002:a05:6000:1005:b0:2bf:b35d:2797 with SMTP id a5-20020a056000100500b002bfb35d2797mr9074032wrx.11.1675441829644; Fri, 03 Feb 2023 08:30:29 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z16-20020a5d4d10000000b002bbed1388a5sm2348052wrt.15.2023.02.03.08.30.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 08:30:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ani Sinha , "Michael S. Tsirkin" , Marcel Apfelbaum , Markus Armbruster , Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [PATCH 1/3] hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe Date: Fri, 3 Feb 2023 17:30:19 +0100 Message-Id: <20230203163021.35754-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203163021.35754-1-philmd@linaro.org> References: <20230203163021.35754-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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=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 Rename 'g' and 'gpe_cpu' variables as 'gpe' to simplify. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 6 ++--- hw/acpi/cpu_hotplug.c | 40 ++++++++++++++++----------------- hw/acpi/ich9.c | 8 +++---- hw/acpi/piix4.c | 6 ++--- include/hw/acpi/cpu_hotplug.h | 8 +++---- include/hw/acpi/ich9.h | 2 +- include/hw/acpi/piix4.h | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stub.c index 3fc4b14c26..b590ad57e1 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -6,7 +6,7 @@ /* Following stubs are all related to ACPI cpu hotplug */ const VMStateDescription vmstate_cpu_hotplug; -void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, +void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, CPUHotplugState *cpuhp_state, uint16_t io_port) { @@ -14,7 +14,7 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, } void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, - AcpiCpuHotplug *gpe_cpu, uint16_t base) + AcpiCpuHotplug *gpe, uint16_t base) { return; } @@ -31,7 +31,7 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, } void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, - AcpiCpuHotplug *g, DeviceState *dev, Error **errp) + AcpiCpuHotplug *gpe, DeviceState *dev, Error **errp) { return; } diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index ff14c3f410..3cfa4f45dc 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -26,8 +26,8 @@ static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size) { - AcpiCpuHotplug *cpus = opaque; - uint64_t val = cpus->sts[addr]; + AcpiCpuHotplug *gpe = opaque; + uint64_t val = gpe->sts[addr]; return val; } @@ -40,8 +40,8 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data, mode by writing 0 at the beginning of legacy CPU bitmap */ if (addr == 0 && data == 0) { - AcpiCpuHotplug *cpus = opaque; - object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false, + AcpiCpuHotplug *gpe = opaque; + object_property_set_bool(gpe->device, "cpu-hotplug-legacy", false, &error_abort); } } @@ -59,51 +59,51 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = { }, }; -static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu) +static void acpi_set_cpu_present_bit(AcpiCpuHotplug *gpe, CPUState *cpu) { CPUClass *k = CPU_GET_CLASS(cpu); int64_t cpu_id; cpu_id = k->get_arch_id(cpu); if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) { - object_property_set_bool(g->device, "cpu-hotplug-legacy", false, + object_property_set_bool(gpe->device, "cpu-hotplug-legacy", false, &error_abort); return; } - g->sts[cpu_id / 8] |= (1 << (cpu_id % 8)); + gpe->sts[cpu_id / 8] |= (1 << (cpu_id % 8)); } -void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, - AcpiCpuHotplug *g, DeviceState *dev, Error **errp) +void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, + DeviceState *dev, Error **errp) { - acpi_set_cpu_present_bit(g, CPU(dev)); + acpi_set_cpu_present_bit(gpe, CPU(dev)); acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS); } void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, - AcpiCpuHotplug *gpe_cpu, uint16_t base) + AcpiCpuHotplug *gpe, uint16_t base) { CPUState *cpu; - memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops, - gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN); - memory_region_add_subregion(parent, base, &gpe_cpu->io); - gpe_cpu->device = owner; + memory_region_init_io(&gpe->io, owner, &AcpiCpuHotplug_ops, + gpe, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN); + memory_region_add_subregion(parent, base, &gpe->io); + gpe->device = owner; CPU_FOREACH(cpu) { - acpi_set_cpu_present_bit(gpe_cpu, cpu); + acpi_set_cpu_present_bit(gpe, cpu); } } -void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, +void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, CPUHotplugState *cpuhp_state, uint16_t io_port) { - MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe_cpu->device)); + MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe->device)); - memory_region_del_subregion(parent, &gpe_cpu->io); - cpu_hotplug_hw_init(parent, gpe_cpu->device, cpuhp_state, io_port); + memory_region_del_subregion(parent, &gpe->io); + cpu_hotplug_hw_init(parent, gpe->device, cpuhp_state, io_port); } void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index a93c470e9d..4f8385b894 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -197,7 +197,7 @@ static bool vmstate_test_use_cpuhp(void *opaque) static int vmstate_cpuhp_pre_load(void *opaque) { ICH9LPCPMRegs *s = opaque; - Object *obj = OBJECT(s->gpe_cpu.device); + Object *obj = OBJECT(s->gpe.device); object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort); return 0; } @@ -338,7 +338,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_register_powerdown_notifier(&pm->powerdown_notifier); legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), - OBJECT(lpc_pci), &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE); + OBJECT(lpc_pci), &pm->gpe, 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), @@ -385,7 +385,7 @@ static void ich9_pm_set_cpu_hotplug_legacy(Object *obj, bool value, assert(!value); if (s->pm.cpu_hotplug_legacy && value == false) { - acpi_switch_to_modern_cphp(&s->pm.gpe_cpu, &s->pm.cpuhp_state, + acpi_switch_to_modern_cphp(&s->pm.gpe, &s->pm.cpuhp_state, ICH9_CPU_HOTPLUG_IO_BASE); } s->pm.cpu_hotplug_legacy = value; @@ -514,7 +514,7 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { if (lpc->pm.cpu_hotplug_legacy) { - legacy_acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.gpe_cpu, dev, errp); + legacy_acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.gpe, dev, errp); } else { acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 724294b378..c702d83f27 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -353,7 +353,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { if (s->cpu_hotplug_legacy) { - legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp); + legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe, dev, errp); } else { acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp); } @@ -549,7 +549,7 @@ static void piix4_set_cpu_hotplug_legacy(Object *obj, bool value, Error **errp) assert(!value); if (s->cpu_hotplug_legacy && value == false) { - acpi_switch_to_modern_cphp(&s->gpe_cpu, &s->cpuhp_state, + acpi_switch_to_modern_cphp(&s->gpe, &s->cpuhp_state, PIIX4_CPU_HOTPLUG_IO_BASE); } s->cpu_hotplug_legacy = value; @@ -571,7 +571,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy); - legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu, + legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe, PIIX4_CPU_HOTPLUG_IO_BASE); if (s->acpi_memory_hotplug.is_enabled) { diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 3b932abbbb..99c11b7151 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -25,13 +25,13 @@ typedef struct AcpiCpuHotplug { uint8_t sts[ACPI_GPE_PROC_LEN]; } AcpiCpuHotplug; -void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, - AcpiCpuHotplug *g, DeviceState *dev, Error **errp); +void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, + DeviceState *dev, Error **errp); void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, - AcpiCpuHotplug *gpe_cpu, uint16_t base); + AcpiCpuHotplug *gpe, uint16_t base); -void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu, +void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, CPUHotplugState *cpuhp_state, uint16_t io_port); diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index d41866a229..3ec706c0d7 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -53,7 +53,7 @@ typedef struct ICH9LPCPMRegs { Notifier powerdown_notifier; bool cpu_hotplug_legacy; - AcpiCpuHotplug gpe_cpu; + AcpiCpuHotplug gpe; CPUHotplugState cpuhp_state; bool keep_pci_slot_hpc; diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index be1f8ea80e..b88ef92455 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -66,7 +66,7 @@ struct PIIX4PMState { uint8_t s4_val; bool cpu_hotplug_legacy; - AcpiCpuHotplug gpe_cpu; + AcpiCpuHotplug gpe; CPUHotplugState cpuhp_state; MemHotplugState acpi_memory_hotplug; From patchwork Fri Feb 3 16:30:20 2023 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: 650085 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp917053pva; Fri, 3 Feb 2023 08:31:56 -0800 (PST) X-Google-Smtp-Source: AK7set+ix5ECU0gPbAVmgT8cYpmSTCZFxbuMWQ0LHVfu7Q15VFqNDeWQc/abxD7ZkW3EljD58iD3 X-Received: by 2002:a05:622a:413:b0:3b9:a4fe:e86c with SMTP id n19-20020a05622a041300b003b9a4fee86cmr20713657qtx.16.1675441916013; Fri, 03 Feb 2023 08:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675441916; cv=none; d=google.com; s=arc-20160816; b=ShYBGh32ddcp1rNY51Iu/Eh1YZUB5r0Q9nrcwOCxVwUaCiBac3vDorIkpQP3KnIF1s GTV1KO8cBzEcO5C6KX4IAEDmSPaxfe/mXAbRNeJlFXa0A+78HNpYo0z2e/pvGzUCbSIR zPAl4OtuExe56/CTXU/TOqqZNRSpXBqblkxTBuCc4o/LdHvV/xX/NEDQn1dRfDWvTAbN yBwTGrYe6B4UqJz4WjuHyqQh9kN2yTxvUq8v7u6EOj74MuISfBVLWvRRXEk9nWq1T7IU lezoVTj4OQl3/cZwd/oOflZ8i4V02CaSMrqp50TRD/uT3P4rcwC24PlAawklcupnw/H4 tPoQ== 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=ptROtNuE3lb04ckVNKyGxQMWre2p5gfgVUcEG2lqtgQ=; b=c7UrFa6prLuI22CyAKiUEQNXvxSnpqpUFt2ZUs7evO7DlZv/RaBNQk05IlEjITzcVo 8rbxMfs819gsobvFK/KlWQQBf6on4Cb8Po4/7V+TZbRC+5ejr5u9pa8DkPJD3B1H5n7d jdNyh9Kqrym8H0QijcZEamv7L7uLwALxnSHZZk8Ip2rFbmxFa+Cc831Z1dOaawBerx1f yHGLu78/XnKxeWOtKdzTqOpV5wQNpN/q3HIdGlpt45o9u299SvRYj4YkoYUdvjUSA5sV 2c/GwrS5DCqkACDK6HTfD24NiNwjFmXOPoUC6AQd+P9eA1AUSIgTAS/CMaM2TJzmqSMl yhKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VK5KjYlq; 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 j16-20020a05622a039000b003b63338abc6si2213823qtx.12.2023.02.03.08.31.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 08:31:55 -0800 (PST) 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=VK5KjYlq; 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 1pNyxY-0001NJ-Oa; Fri, 03 Feb 2023 11:30:44 -0500 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 1pNyxW-0001ML-Bp for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:43 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNyxT-0007qE-Gx for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:42 -0500 Received: by mail-wm1-x333.google.com with SMTP id hn2-20020a05600ca38200b003dc5cb96d46so6375590wmb.4 for ; Fri, 03 Feb 2023 08:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ptROtNuE3lb04ckVNKyGxQMWre2p5gfgVUcEG2lqtgQ=; b=VK5KjYlqlL6hd+FMx2A9gdVLSVw6j7WZvvGBxsn8DC4nfXGmtwSTP0U3ZmDaQO3jto Fc3XfItGxhpeHP8DoX542kSKvjlM+IVHKxxmO1OjflEE7fyOZPprND+iTTCpBAIibu5H 1LAGcf7n0BOA7WTh0gwhvczN2/FojUs03AUxmMs+tC9ElshNCD8uNZLDTpqmuaODbnfY FyL0OLWymZW4GQt3Qxzivan3OzpAhb3eL3u5a/7idA36vPPpCReC7lb1SWviIu3wVaIG SXzTLOARooNykVPXkXC0ypEHLk72/F753f9h0dAjaCWysS80HFSknlSlQ6qX1NCR8AeP wR2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ptROtNuE3lb04ckVNKyGxQMWre2p5gfgVUcEG2lqtgQ=; b=JhWMH9Zpuhd8YIN2jmp5DbInK1ZGdlgySPl7zROaihLWGncR6x8Q/7CZMS6LiEQMUl m+fUbkD8hXK/Ty8gW3bnw8Aukpt26sbv77Tnsy/z0pabDRuCMJ1eyiKUWXPMWHA/+05r S59eRctnIV2CNvmTTBYPXY3KrXO6nTGg9U4YRSEwZDIOblnO3aGT2xiO9zt6/BMjlhCi 73OIizKHEZj0fAMOP5MwXPey4wQurUkiqWljSGj2FJmpha1P0fvvxxYySia/4Gmbw10c /hh0il62EaYWDIJFFnsIo9FIZNZ8w2S/kSL2haZOq3RxNERLqhgA0/5s7sYaK9ULS0av jQpg== X-Gm-Message-State: AO0yUKWbxmLG0ylJ36LvEvN/P8+gZcTB2x/O+eCQGhYA0s9YziMnRM5C 2I3NSITT5DWXC/+H8RMbIxqqo+q/5qMm1IgZ X-Received: by 2002:a05:600c:601b:b0:3dc:557f:6129 with SMTP id az27-20020a05600c601b00b003dc557f6129mr9946409wmb.2.1675441835935; Fri, 03 Feb 2023 08:30:35 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m2-20020a05600c4f4200b003dc522dd25esm3439513wmq.30.2023.02.03.08.30.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 08:30:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ani Sinha , "Michael S. Tsirkin" , Marcel Apfelbaum , Markus Armbruster , Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [PATCH 2/3] hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container' Date: Fri, 3 Feb 2023 17:30:20 +0100 Message-Id: <20230203163021.35754-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203163021.35754-1-philmd@linaro.org> References: <20230203163021.35754-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=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 No logical change, rename for clarity. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 2 +- hw/acpi/cpu_hotplug.c | 10 +++++----- hw/acpi/piix4.c | 10 +++++----- include/hw/acpi/cpu_hotplug.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stub.c index b590ad57e1..cbd7a6ec00 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -13,7 +13,7 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, return; } -void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, AcpiCpuHotplug *gpe, uint16_t base) { return; diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 3cfa4f45dc..636e985c50 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -81,14 +81,14 @@ void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS); } -void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, AcpiCpuHotplug *gpe, uint16_t base) { CPUState *cpu; memory_region_init_io(&gpe->io, owner, &AcpiCpuHotplug_ops, gpe, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN); - memory_region_add_subregion(parent, base, &gpe->io); + memory_region_add_subregion(container, base, &gpe->io); gpe->device = owner; CPU_FOREACH(cpu) { @@ -100,10 +100,10 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, CPUHotplugState *cpuhp_state, uint16_t io_port) { - MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe->device)); + MemoryRegion *container = pci_address_space_io(PCI_DEVICE(gpe->device)); - memory_region_del_subregion(parent, &gpe->io); - cpu_hotplug_hw_init(parent, gpe->device, cpuhp_state, io_port); + memory_region_del_subregion(container, &gpe->io); + cpu_hotplug_hw_init(container, gpe->device, cpuhp_state, io_port); } void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index c702d83f27..5595fe5be5 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -555,15 +555,15 @@ static void piix4_set_cpu_hotplug_legacy(Object *obj, bool value, Error **errp) s->cpu_hotplug_legacy = value; } -static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, +static void piix4_acpi_system_hot_add_init(MemoryRegion *container, PCIBus *bus, PIIX4PMState *s) { memory_region_init_io(&s->io_gpe, OBJECT(s), &piix4_gpe_ops, s, "acpi-gpe0", GPE_LEN); - memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe); + memory_region_add_subregion(container, GPE_BASE, &s->io_gpe); if (s->use_acpi_hotplug_bridge || s->use_acpi_root_pci_hotplug) { - acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, + acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, container, s->use_acpi_hotplug_bridge, ACPI_PCIHP_ADDR_PIIX4); } @@ -571,11 +571,11 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy); - legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe, + legacy_acpi_cpu_hotplug_init(container, OBJECT(s), &s->gpe, PIIX4_CPU_HOTPLUG_IO_BASE); if (s->acpi_memory_hotplug.is_enabled) { - acpi_memory_hotplug_init(parent, OBJECT(s), &s->acpi_memory_hotplug, + acpi_memory_hotplug_init(container, OBJECT(s), &s->acpi_memory_hotplug, ACPI_MEMORY_HOTPLUG_BASE); } } diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 99c11b7151..5ff24ec417 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -28,7 +28,7 @@ typedef struct AcpiCpuHotplug { void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, DeviceState *dev, Error **errp); -void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, AcpiCpuHotplug *gpe, uint16_t base); void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, From patchwork Fri Feb 3 16:30:21 2023 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: 650084 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp916517pva; Fri, 3 Feb 2023 08:31:06 -0800 (PST) X-Google-Smtp-Source: AK7set9sQyBKXfLJmnPhitJBPQ72884hKbzA0cCTL9QRcqC1901m+zwpkRR1e4e1lZOv39vHhnnR X-Received: by 2002:a05:6870:d610:b0:163:26a3:1da5 with SMTP id a16-20020a056870d61000b0016326a31da5mr5855952oaq.10.1675441866390; Fri, 03 Feb 2023 08:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675441866; cv=none; d=google.com; s=arc-20160816; b=k9J+DjBBRahaNvOuwcLJd1Jzm8yJIPg1Oqkw8kEyPGCBL4aGANFyS1aoi4nAh3rLgq u2JSTT/yo9VZ2bu81fWdExng/xWYjLM0/GrPc3zv0AM2LCUqXeZVk3H4pQ9+NUL5QuPc 2Pfu8CjWL/eClHeRlbnA46MYHbV3Ftin5LevErfhgvHwiwyfYjgsymZM1lB3auat6ijB Q2EW2EzgTLBM1eqC8IocFse7DN1IF6DicaTxu6QfR71aEsg8o9jnNJlERNSDbODjY0ED V0ZQWCWEfDHlBAuzCa3alfnGwXhNY0rFcTMB1hYtQyiH0Igi31p2NgiaJ+j0lBOkcMR3 bkwA== 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=1wBCF9bWIkPB8j4jWU6kzH466hslSu/AUgLyaE+mSGQ=; b=dTythBxDc3MuJVSBjiPMtNZmKGsjnNnIAT1+4YCalhoIdqCDR+6WHG/8QFG9/2Yehx l5OtjAqqfcfr4GgCvMRWwY7muiOrLsfYdTv/qzjMV3tw3ctbxbg43LRg62gAM+YkIXrj dpGq3LV35eNiNEdqkytKfnlq4S2wZKS8f5Yku7CGxinj6isV6DJ/mG2lcd76eiwp2lOp YuUS3pGGShjQsHmYULu6Vdntolor+iN1J9wZWRfwZjIOKhkMKkIpLI9KMqFldWLBtChf axQndmw4VsWuTNJdEDyAEpvfY75/yuQZJ/dWcn8dn/CXiG67fbPq8osV95g3GuUecCQx zg3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QN9H+AW+; 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 d8-20020a376808000000b0072058b2c9d6si2217910qkc.219.2023.02.03.08.31.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 08:31:06 -0800 (PST) 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=QN9H+AW+; 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 1pNyxh-0001O7-NK; Fri, 03 Feb 2023 11:30:55 -0500 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 1pNyxa-0001Ns-S1 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:47 -0500 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 1pNyxY-0007rb-Gw for qemu-devel@nongnu.org; Fri, 03 Feb 2023 11:30:46 -0500 Received: by mail-wm1-x334.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso4269102wmq.5 for ; Fri, 03 Feb 2023 08:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=1wBCF9bWIkPB8j4jWU6kzH466hslSu/AUgLyaE+mSGQ=; b=QN9H+AW+vRzJxaF7JIpaCv1AhDLbjcDzscI6nE9ha05QCfQg94A+uqgSxnvzqsWcCj LYcauZVv4GYuLpCVQU1tonk1xE4zMh+OG2sp6nCvFscWOF92BxXWfZUaMLdc2PDApHq3 llJT3bGwyChXsyXkYVbA4BQWHg1NsHPo6BqcEDcrcnsMYo22K9opQFiYYIzg0PBKmwe+ MYCNG0zm+AbBvddg6UvXSF7n2j/GtIQ069RDpx8OiW6Uoz5Wkn8gaJ06NkB965yxAuCi 56ZCMM1y7wIEsECst76zfbiz0sOU5PjgAtY6/G5yYxYJEwnMb4l+yasCidUHlAWDo96l gKmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=1wBCF9bWIkPB8j4jWU6kzH466hslSu/AUgLyaE+mSGQ=; b=5gI3GAlxwuXTvXopqs0FV0LPvXFSchEDg2Y9qwR5QZa7m79n4QzBZ85kwkf7sQXg1J Yqk1L3PJMH7rhCzJkCD3wEnDTRgfJMHhu9J9DV0fxvlNWXn9STPapqQ7i/U1jzQ2EPEn BiMV3NBwv7Yc85taWe+ZiFhX1i+La2T6014iQUyfkAZYEXdlHyJjnihz5bCi0v85hAbU cBPJgKxfo8o0fzCCIs90vM6J+yCi5FSWHrl6zRTdqF/rrQuS3Aa2MsihgaQ6FxjDvs7Z 3YXpEfFOKnyZhrArxHyKhPwkZObLjlAENBP0YOeZrWexpBYMym2Qe6Xsz1MLH1gtLQih kt2w== X-Gm-Message-State: AO0yUKUtTCViinvwqmk3nS/J2cxi1tjDVMB/L56OU/MtyqmaSq9TCgYL 3BUp1p7rcFYXRbnad4SLEVUqrH44Fq12Pg0H X-Received: by 2002:a05:600c:1f0c:b0:3dd:97d6:8f2e with SMTP id bd12-20020a05600c1f0c00b003dd97d68f2emr10069500wmb.17.1675441842881; Fri, 03 Feb 2023 08:30:42 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k19-20020a05600c1c9300b003dc43a10fa5sm3469387wms.13.2023.02.03.08.30.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 08:30:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ani Sinha , "Michael S. Tsirkin" , Marcel Apfelbaum , Markus Armbruster , Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [PATCH 3/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent' Date: Fri, 3 Feb 2023 17:30:21 +0100 Message-Id: <20230203163021.35754-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203163021.35754-1-philmd@linaro.org> References: <20230203163021.35754-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 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 CPU hotplug parent can't be any QOM object, it must be a QDev. Convert AcpiCpuHotplug::device field as QDev to enforce this. Rename 'owner' and 'device' variables as 'parent'. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/acpi-cpu-hotplug-stub.c | 2 +- hw/acpi/cpu_hotplug.c | 18 +++++++++--------- hw/acpi/ich9.c | 5 +++-- hw/acpi/piix4.c | 2 +- include/hw/acpi/cpu_hotplug.h | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stub.c index cbd7a6ec00..0fcc1ec8ea 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -13,7 +13,7 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, return; } -void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, DeviceState *parent, AcpiCpuHotplug *gpe, uint16_t base) { return; diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 636e985c50..b8c9081738 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -41,8 +41,8 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data, */ if (addr == 0 && data == 0) { AcpiCpuHotplug *gpe = opaque; - object_property_set_bool(gpe->device, "cpu-hotplug-legacy", false, - &error_abort); + object_property_set_bool(OBJECT(gpe->parent), "cpu-hotplug-legacy", + false, &error_abort); } } @@ -66,8 +66,8 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *gpe, CPUState *cpu) cpu_id = k->get_arch_id(cpu); if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) { - object_property_set_bool(gpe->device, "cpu-hotplug-legacy", false, - &error_abort); + object_property_set_bool(OBJECT(gpe->parent), "cpu-hotplug-legacy", + false, &error_abort); return; } @@ -81,15 +81,15 @@ void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, acpi_send_event(DEVICE(hotplug_dev), ACPI_CPU_HOTPLUG_STATUS); } -void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, DeviceState *parent, AcpiCpuHotplug *gpe, uint16_t base) { CPUState *cpu; - memory_region_init_io(&gpe->io, owner, &AcpiCpuHotplug_ops, + memory_region_init_io(&gpe->io, OBJECT(parent), &AcpiCpuHotplug_ops, gpe, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN); memory_region_add_subregion(container, base, &gpe->io); - gpe->device = owner; + gpe->parent = parent; CPU_FOREACH(cpu) { acpi_set_cpu_present_bit(gpe, cpu); @@ -100,10 +100,10 @@ void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe, CPUHotplugState *cpuhp_state, uint16_t io_port) { - MemoryRegion *container = pci_address_space_io(PCI_DEVICE(gpe->device)); + MemoryRegion *container = pci_address_space_io(PCI_DEVICE(gpe->parent)); memory_region_del_subregion(container, &gpe->io); - cpu_hotplug_hw_init(container, gpe->device, cpuhp_state, io_port); + cpu_hotplug_hw_init(container, OBJECT(gpe->parent), cpuhp_state, io_port); } void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 4f8385b894..6c9a737479 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -197,7 +197,7 @@ static bool vmstate_test_use_cpuhp(void *opaque) static int vmstate_cpuhp_pre_load(void *opaque) { ICH9LPCPMRegs *s = opaque; - Object *obj = OBJECT(s->gpe.device); + Object *obj = OBJECT(s->gpe.parent); object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort); return 0; } @@ -338,7 +338,8 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_register_powerdown_notifier(&pm->powerdown_notifier); legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), - OBJECT(lpc_pci), &pm->gpe, ICH9_CPU_HOTPLUG_IO_BASE); + DEVICE(lpc_pci), &pm->gpe, + 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), diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 5595fe5be5..3a61d89f92 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -571,7 +571,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *container, object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy); - legacy_acpi_cpu_hotplug_init(container, OBJECT(s), &s->gpe, + legacy_acpi_cpu_hotplug_init(container, DEVICE(s), &s->gpe, PIIX4_CPU_HOTPLUG_IO_BASE); if (s->acpi_memory_hotplug.is_enabled) { diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 5ff24ec417..b2f990f0b8 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -20,7 +20,7 @@ #include "hw/acpi/cpu.h" typedef struct AcpiCpuHotplug { - Object *device; + DeviceState *parent; MemoryRegion io; uint8_t sts[ACPI_GPE_PROC_LEN]; } AcpiCpuHotplug; @@ -28,7 +28,7 @@ typedef struct AcpiCpuHotplug { void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *gpe, DeviceState *dev, Error **errp); -void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, Object *owner, +void legacy_acpi_cpu_hotplug_init(MemoryRegion *container, DeviceState *parent, AcpiCpuHotplug *gpe, uint16_t base); void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe,