From patchwork Sun Jun 5 13:21:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 9155553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F110D60574 for ; Sun, 5 Jun 2016 13:26:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1BB127D07 for ; Sun, 5 Jun 2016 13:26:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D567B281D2; Sun, 5 Jun 2016 13:26:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A0EE27D07 for ; Sun, 5 Jun 2016 13:26:11 +0000 (UTC) Received: from localhost ([::1]:37120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9Y4A-0006lh-IQ for patchwork-qemu-devel@patchwork.kernel.org; Sun, 05 Jun 2016 09:26:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9Xzc-0002fc-1x for qemu-devel@nongnu.org; Sun, 05 Jun 2016 09:21:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9XzZ-0004w4-VZ for qemu-devel@nongnu.org; Sun, 05 Jun 2016 09:21:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9XzZ-0004vx-Nj for qemu-devel@nongnu.org; Sun, 05 Jun 2016 09:21:25 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6127FC04D2A0; Sun, 5 Jun 2016 13:21:25 +0000 (UTC) Received: from redhat.com (vpn1-7-180.ams2.redhat.com [10.36.7.180]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u55DLMxs014951; Sun, 5 Jun 2016 09:21:23 -0400 Date: Sun, 5 Jun 2016 16:21:22 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1465132825-14242-11-git-send-email-mst@redhat.com> References: <1465132825-14242-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1465132825-14242-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 05 Jun 2016 13:21:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/25] pc: acpi: simplify build_legacy_cpu_hotplug_aml() signature X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Igor Mammedov , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mammedov since IO block used by CPU hotplug is fixed size and initialized it the same file as build_legacy_cpu_hotplug_aml() just use ACPI_GPE_PROC_LEN directly instead of passing it around in several files. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Marcel Apfelbaum --- include/hw/acpi/cpu_hotplug.h | 2 +- hw/acpi/cpu_hotplug.c | 6 +++--- hw/i386/acpi-build.c | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 241b50f..6d729d8 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -28,5 +28,5 @@ void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, AcpiCpuHotplug *gpe_cpu, uint16_t base); void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, - uint16_t io_base, uint16_t io_len); + uint16_t io_base); #endif diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 2d4e034..36ea6c2 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -87,7 +87,7 @@ void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, } void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, - uint16_t io_base, uint16_t io_len) + uint16_t io_base) { Aml *dev; Aml *crs; @@ -226,13 +226,13 @@ void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); crs = aml_resource_template(); aml_append(crs, - aml_io(AML_DECODE16, io_base, io_base, 1, io_len) + aml_io(AML_DECODE16, io_base, io_base, 1, ACPI_GPE_PROC_LEN) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(sb_scope, dev); /* declare CPU hotplug MMIO region and PRS field to access it */ aml_append(sb_scope, aml_operation_region( - "PRST", AML_SYSTEM_IO, aml_int(io_base), io_len)); + "PRST", AML_SYSTEM_IO, aml_int(io_base), ACPI_GPE_PROC_LEN)); field = aml_field("PRST", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); aml_append(field, aml_named_field("PRS", 256)); aml_append(sb_scope, field); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2f6de43..b33fec9 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -94,7 +94,6 @@ typedef struct AcpiPmInfo { uint32_t gpe0_blk_len; uint32_t io_base; uint16_t cpu_hp_io_base; - uint16_t cpu_hp_io_len; uint16_t mem_hp_io_base; uint16_t mem_hp_io_len; uint16_t pcihp_io_base; @@ -142,7 +141,6 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) } assert(obj); - pm->cpu_hp_io_len = ACPI_GPE_PROC_LEN; pm->mem_hp_io_base = ACPI_MEMORY_HOTPLUG_BASE; pm->mem_hp_io_len = ACPI_MEMORY_HOTPLUG_IO_LEN; @@ -1935,8 +1933,7 @@ build_dsdt(GArray *table_data, GArray *linker, build_q35_pci0_int(dsdt); } - build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base, - pm->cpu_hp_io_len); + build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); build_memory_hotplug_aml(dsdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);