From patchwork Mon Jan 28 11:05:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 156705 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3297640jaa; Mon, 28 Jan 2019 03:10:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN5AbeMUN4NVldj9r6eVH1LbAYBF7GOoyBm4qbK+bEBbe/+NQrpqj0zhcs2EU29xcc4bpl0/ X-Received: by 2002:a5d:68c3:: with SMTP id p3mr21808648wrw.34.1548673815968; Mon, 28 Jan 2019 03:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548673815; cv=none; d=google.com; s=arc-20160816; b=eO4OXYz/cylU9ae6VRsVAC2jh2OZPMFTb6053kiXRYvDJ8/yJkydXir4WcdEPoKkSL /02lBUO7WvVVHcqREfqbor3KvR1HkSgRRkeo4JiuVOBX4kJDfmVkcIkN658Q7zp2D61a IED5IV+SdJ86284cHGq0i6vup6ktN4u7gs1f7IdjhPwNyUNvswOFcoMRRXw8RAIioKOU /1SuqxTTGFvGbp2oNpx+jdeA08ZpOc0Qr7a1NoUMxbJDUF54CuuazhO7DfwWfpczQ4PJ kEYoS2UdmEKDRH4XoZre2GPbaEv/Igq1SNyI/Csy5DhFFNJhqygikEyVX1Rt1C+HjOrM t9wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version:references :in-reply-to:message-id:date:to:from; bh=Z9RCDKHTLl473egDrWKfRjaj4/RAn70tszqNv1yS6Iw=; b=c/tWaja3Luvcf2wMoJ7cWDKmbZZv7rCM5xbV20dDUx4TzC3H7UUtpbWFC/dSx9lKua wy4FPN5o+B5WPqMEk+8bH9yNE+59NLX2zqHmtFeDedNu81qWZ2A3HYfMrwPpqmdfymNI mu300/FX6yROUI45jqdbjBHiOaANay/I5wtr7dNbtAeikdE67Wy66DHyV5dq7rLIpbkw WHK9Mr76mLAi+7DnT+zsQ2o6yfGOKRXcO+JPB9Rf8wxL/iFvC4H3An3y1nC2KibTJdJ4 /IFkCv8V8+7d54c8G3729MoVMIQUdftj0WoPdnFSs4SifQB4oQ9rtoN6mUSd341FZ2Kn q3rA== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m25si45200001wmg.68.2019.01.28.03.10.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 03:10:15 -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; 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" Received: from localhost ([127.0.0.1]:57939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go4nu-00054k-Sz for patch@linaro.org; Mon, 28 Jan 2019 06:10:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go4kt-0003o0-77 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 06:07:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go4kq-00046f-Gd for qemu-devel@nongnu.org; Mon, 28 Jan 2019 06:07:06 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:33556 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1go4ki-00043q-Jg; Mon, 28 Jan 2019 06:06:58 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C1CA0769E03B966D799F; Mon, 28 Jan 2019 19:06:53 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.408.0; Mon, 28 Jan 2019 19:06:42 +0800 From: Shameer Kolothum To: , , , , , Date: Mon, 28 Jan 2019 11:05:43 +0000 Message-ID: <20190128110545.20644-2-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190128110545.20644-1-shameerali.kolothum.thodi@huawei.com> References: <20190128110545.20644-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.249.212.32 Subject: [Qemu-devel] [RFC PATCH 1/4] hw:acpi: Make ACPI IO address space configurable 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: linuxarm@huawei.com, xuwei5@huawei.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is in preparation for adding support for ARM64 platforms where it doesn't use port mapped IO for ACPI IO space. Also add a flag to identify hw reduced ACPI platforms as they might use GPIO hw for signaling ACPI platform events. Signed-off-by: Shameer Kolothum --- hw/acpi/memory_hotplug.c | 13 ++++++++----- hw/i386/acpi-build.c | 3 ++- include/hw/acpi/memory_hotplug.h | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 921cad2..05f1d45 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -34,7 +34,7 @@ #define MEMORY_HOTPLUG_IO_LEN 24 #define MEMORY_DEVICES_CONTAINER "\\_SB.MHPC" -static uint16_t memhp_io_base; +static hwaddr memhp_io_base; static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev) { @@ -208,7 +208,7 @@ static const MemoryRegionOps acpi_memory_hotplug_ops = { }; void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner, - MemHotplugState *state, uint16_t io_base) + MemHotplugState *state, hwaddr io_base) { MachineState *machine = MACHINE(qdev_get_machine()); @@ -279,7 +279,9 @@ void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem_st, mdev->is_enabled = true; if (dev->hotplugged) { mdev->is_inserting = true; - acpi_send_event(DEVICE(hotplug_dev), ACPI_MEMORY_HOTPLUG_STATUS); + if (!mem_st->hw_reduced_acpi) { + acpi_send_event(DEVICE(hotplug_dev), ACPI_MEMORY_HOTPLUG_STATUS); + } } } @@ -341,7 +343,8 @@ const VMStateDescription vmstate_memory_hotplug = { void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem, const char *res_root, - const char *event_handler_method) + const char *event_handler_method, + AmlRegionSpace rs) { int i; Aml *ifctx; @@ -371,7 +374,7 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem, aml_append(mem_ctrl_dev, aml_name_decl("_CRS", crs)); aml_append(mem_ctrl_dev, aml_operation_region( - MEMORY_HOTPLUG_IO_REGION, AML_SYSTEM_IO, + MEMORY_HOTPLUG_IO_REGION, rs, aml_int(memhp_io_base), MEMORY_HOTPLUG_IO_LEN) ); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2e21a31..b62c1a3 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1852,7 +1852,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02"); } - build_memory_hotplug_aml(dsdt, nr_mem, "\\_SB.PCI0", "\\_GPE._E03"); + build_memory_hotplug_aml(dsdt, nr_mem, "\\_SB.PCI0", + "\\_GPE._E03", AML_SYSTEM_IO); scope = aml_scope("_GPE"); { diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotplug.h index 77c6576..ec56579 100644 --- a/include/hw/acpi/memory_hotplug.h +++ b/include/hw/acpi/memory_hotplug.h @@ -26,10 +26,11 @@ typedef struct MemHotplugState { uint32_t selector; uint32_t dev_count; MemStatus *devs; + bool hw_reduced_acpi; /*true for hw reduced acpi platform */ } MemHotplugState; void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner, - MemHotplugState *state, uint16_t io_base); + MemHotplugState *state, hwaddr io_base); void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem_st, DeviceState *dev, Error **errp); @@ -48,5 +49,6 @@ void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list); void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem, const char *res_root, - const char *event_handler_method); + const char *event_handler_method, + AmlRegionSpace rs); #endif