All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Cc: peter.maydell@linaro.org, sameo@linux.intel.com,
	shannon.zhaosl@gmail.com, qemu-devel@nongnu.org,
	xuwei5@hisilicon.com, linuxarm@huawei.com, eric.auger@redhat.com,
	qemu-arm@nongnu.org, sebastien.boeuf@intel.com
Subject: Re: [Qemu-arm] [PATCH v3 01/10] hw/acpi: Make ACPI IO address space configurable
Date: Mon, 1 Apr 2019 14:58:09 +0200	[thread overview]
Message-ID: <20190401145809.55643fc6@redhat.com> (raw)
In-Reply-To: <20190321104745.28068-2-shameerali.kolothum.thodi@huawei.com>

On Thu, 21 Mar 2019 10:47:36 +0000
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> wrote:

> This is in preparation for adding support for ARM64 platforms
> where it doesn't use port mapped IO for ACPI IO space.
> 
> Also move the MEMORY_SLOT_SCAN_METHOD/MEMORY_DEVICES_CONTAINER
> definitions to header so that other memory hotplug event
> signalling mechanisms (eg. Generic Event Device on HW-reduced
> acpi platforms) can use the same from their respective event
> handler aml code.
> 
> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/memory_hotplug.c         | 24 ++++++++++++++----------
>  hw/i386/acpi-build.c             |  3 ++-
>  include/hw/acpi/memory_hotplug.h |  8 ++++++--
>  3 files changed, 22 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> index 297812d..80e25f0 100644
> --- a/hw/acpi/memory_hotplug.c
> +++ b/hw/acpi/memory_hotplug.c
> @@ -29,12 +29,10 @@
>  #define MEMORY_SLOT_PROXIMITY_METHOD "MPXM"
>  #define MEMORY_SLOT_EJECT_METHOD     "MEJ0"
>  #define MEMORY_SLOT_NOTIFY_METHOD    "MTFY"
> -#define MEMORY_SLOT_SCAN_METHOD      "MSCN"
>  #define MEMORY_HOTPLUG_DEVICE        "MHPD"
>  #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)
>  {
> @@ -209,7 +207,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());
>  
> @@ -342,7 +340,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;
> @@ -365,14 +364,19 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem,
>              aml_name_decl("_UID", aml_string("Memory hotplug resources")));
>  
>          crs = aml_resource_template();
> -        aml_append(crs,
> -            aml_io(AML_DECODE16, memhp_io_base, memhp_io_base, 0,
> -                   MEMORY_HOTPLUG_IO_LEN)
> -        );
> +        if (rs == AML_SYSTEM_IO) {
> +            aml_append(crs,
> +                aml_io(AML_DECODE16, memhp_io_base, memhp_io_base, 0,
> +                       MEMORY_HOTPLUG_IO_LEN)
> +            );
> +        } else {
> +            aml_append(crs, aml_memory32_fixed(memhp_io_base,
> +                            MEMORY_HOTPLUG_IO_LEN, AML_READ_WRITE));
> +        }
>          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 416da31..6d6de44 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..f95aa1f 100644
> --- a/include/hw/acpi/memory_hotplug.h
> +++ b/include/hw/acpi/memory_hotplug.h
> @@ -5,6 +5,9 @@
>  #include "hw/acpi/acpi.h"
>  #include "hw/acpi/aml-build.h"
>  
> +#define MEMORY_SLOT_SCAN_METHOD      "MSCN"
> +#define MEMORY_DEVICES_CONTAINER     "\\_SB.MHPC"
> +
>  /**
>   * MemStatus:
>   * @is_removing: the memory device in slot has been requested to be ejected.
> @@ -29,7 +32,7 @@ typedef struct MemHotplugState {
>  } 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 +51,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


WARNING: multiple messages have this Message-ID (diff)
From: Igor Mammedov <imammedo@redhat.com>
To: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	eric.auger@redhat.com, peter.maydell@linaro.org,
	shannon.zhaosl@gmail.com, sameo@linux.intel.com,
	sebastien.boeuf@intel.com, linuxarm@huawei.com,
	xuwei5@hisilicon.com
Subject: Re: [Qemu-devel] [PATCH v3 01/10] hw/acpi: Make ACPI IO address space configurable
Date: Mon, 1 Apr 2019 14:58:09 +0200	[thread overview]
Message-ID: <20190401145809.55643fc6@redhat.com> (raw)
In-Reply-To: <20190321104745.28068-2-shameerali.kolothum.thodi@huawei.com>

On Thu, 21 Mar 2019 10:47:36 +0000
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> wrote:

> This is in preparation for adding support for ARM64 platforms
> where it doesn't use port mapped IO for ACPI IO space.
> 
> Also move the MEMORY_SLOT_SCAN_METHOD/MEMORY_DEVICES_CONTAINER
> definitions to header so that other memory hotplug event
> signalling mechanisms (eg. Generic Event Device on HW-reduced
> acpi platforms) can use the same from their respective event
> handler aml code.
> 
> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/memory_hotplug.c         | 24 ++++++++++++++----------
>  hw/i386/acpi-build.c             |  3 ++-
>  include/hw/acpi/memory_hotplug.h |  8 ++++++--
>  3 files changed, 22 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> index 297812d..80e25f0 100644
> --- a/hw/acpi/memory_hotplug.c
> +++ b/hw/acpi/memory_hotplug.c
> @@ -29,12 +29,10 @@
>  #define MEMORY_SLOT_PROXIMITY_METHOD "MPXM"
>  #define MEMORY_SLOT_EJECT_METHOD     "MEJ0"
>  #define MEMORY_SLOT_NOTIFY_METHOD    "MTFY"
> -#define MEMORY_SLOT_SCAN_METHOD      "MSCN"
>  #define MEMORY_HOTPLUG_DEVICE        "MHPD"
>  #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)
>  {
> @@ -209,7 +207,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());
>  
> @@ -342,7 +340,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;
> @@ -365,14 +364,19 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem,
>              aml_name_decl("_UID", aml_string("Memory hotplug resources")));
>  
>          crs = aml_resource_template();
> -        aml_append(crs,
> -            aml_io(AML_DECODE16, memhp_io_base, memhp_io_base, 0,
> -                   MEMORY_HOTPLUG_IO_LEN)
> -        );
> +        if (rs == AML_SYSTEM_IO) {
> +            aml_append(crs,
> +                aml_io(AML_DECODE16, memhp_io_base, memhp_io_base, 0,
> +                       MEMORY_HOTPLUG_IO_LEN)
> +            );
> +        } else {
> +            aml_append(crs, aml_memory32_fixed(memhp_io_base,
> +                            MEMORY_HOTPLUG_IO_LEN, AML_READ_WRITE));
> +        }
>          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 416da31..6d6de44 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..f95aa1f 100644
> --- a/include/hw/acpi/memory_hotplug.h
> +++ b/include/hw/acpi/memory_hotplug.h
> @@ -5,6 +5,9 @@
>  #include "hw/acpi/acpi.h"
>  #include "hw/acpi/aml-build.h"
>  
> +#define MEMORY_SLOT_SCAN_METHOD      "MSCN"
> +#define MEMORY_DEVICES_CONTAINER     "\\_SB.MHPC"
> +
>  /**
>   * MemStatus:
>   * @is_removing: the memory device in slot has been requested to be ejected.
> @@ -29,7 +32,7 @@ typedef struct MemHotplugState {
>  } 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 +51,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

  reply	other threads:[~2019-04-01 12:58 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 10:47 [Qemu-arm] [PATCH v3 00/10] ARM virt: ACPI memory hotplug support Shameer Kolothum
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 01/10] hw/acpi: Make ACPI IO address space configurable Shameer Kolothum
2019-04-01 12:58   ` Igor Mammedov [this message]
2019-04-01 12:58     ` Igor Mammedov
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 02/10] hw/acpi: Do not create memory hotplug method when handler is not defined Shameer Kolothum
2019-03-28 14:14   ` [Qemu-arm] " Auger Eric
2019-03-21 10:47 ` [Qemu-arm] [PATCH v3 03/10] hw/arm/virt: Add virtual ACPI device Shameer Kolothum
2019-03-28 14:14   ` Auger Eric
2019-03-29 11:22     ` Shameerali Kolothum Thodi
2019-04-01 13:08       ` [Qemu-arm] [Qemu-devel] " Igor Mammedov
2019-04-01 13:08         ` Igor Mammedov
2019-04-01 14:21         ` Shameerali Kolothum Thodi
2019-04-01 14:21           ` Shameerali Kolothum Thodi
2019-04-02  6:31           ` [Qemu-arm] " Igor Mammedov
2019-04-02  6:31             ` Igor Mammedov
2019-03-21 10:47 ` [Qemu-arm] [PATCH v3 04/10] hw/arm/virt: Add memory hotplug framework Shameer Kolothum
2019-03-28 15:37   ` Auger Eric
2019-03-29 12:03     ` Shameerali Kolothum Thodi
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 05/10] hw/arm/virt: Add ACPI support for device memory cold-plug Shameer Kolothum
2019-03-29  9:31   ` [Qemu-arm] " Auger Eric
2019-03-29 10:54     ` Shameerali Kolothum Thodi
2019-04-01 13:43     ` Igor Mammedov
2019-04-01 13:43       ` [Qemu-devel] " Igor Mammedov
2019-04-01 14:51       ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-01 14:51         ` [Qemu-devel] " Shameerali Kolothum Thodi
2019-04-02  7:19         ` [Qemu-arm] " Igor Mammedov
2019-04-02  7:19           ` Igor Mammedov
2019-04-01 14:59       ` [Qemu-arm] " Auger Eric
2019-04-01 14:59         ` Auger Eric
2019-04-01 13:34   ` [Qemu-arm] " Igor Mammedov
2019-04-01 13:34     ` [Qemu-devel] " Igor Mammedov
2019-04-01 16:24     ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-01 16:24       ` [Qemu-devel] " Shameerali Kolothum Thodi
2019-04-02  7:22       ` Igor Mammedov
2019-04-02  7:22         ` Igor Mammedov
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 06/10] hw/arm/virt-acpi-build: Add PC-DIMM in SRAT Shameer Kolothum
2019-03-21 10:47 ` [Qemu-arm] [PATCH v3 07/10] hw/arm/virt: Introduce opt-in feature "fdt" Shameer Kolothum
2019-03-29  9:31   ` Auger Eric
2019-03-29  9:41     ` Shameerali Kolothum Thodi
2019-03-29 13:41       ` Auger Eric
2019-03-29  9:59     ` Shameerali Kolothum Thodi
2019-03-29 13:12       ` Auger Eric
2019-03-29 13:14         ` Ard Biesheuvel
2019-03-29 13:56           ` [Qemu-arm] [Qemu-devel] " Auger Eric
2019-03-29 14:08             ` Shameerali Kolothum Thodi
2019-04-01 13:07             ` Laszlo Ersek
2019-04-01 13:07               ` Laszlo Ersek
2019-04-02  7:42               ` Igor Mammedov
2019-04-02  7:42                 ` Igor Mammedov
2019-04-02 10:33                 ` [Qemu-arm] " Laszlo Ersek
2019-04-02 10:33                   ` Laszlo Ersek
2019-04-02 15:42                   ` [Qemu-arm] " Auger Eric
2019-04-02 15:42                     ` Auger Eric
2019-04-02 15:52                     ` Laszlo Ersek
2019-04-02 15:52                       ` Laszlo Ersek
2019-04-02 15:56                       ` [Qemu-arm] " Laszlo Ersek
2019-04-02 15:56                         ` Laszlo Ersek
2019-04-02 16:07                       ` [Qemu-arm] " Auger Eric
2019-04-02 16:07                         ` Auger Eric
2019-04-02 14:26               ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-02 14:26                 ` Shameerali Kolothum Thodi
2019-04-02 15:29               ` [Qemu-arm] " Auger Eric
2019-04-02 15:29                 ` Auger Eric
2019-04-02 15:38                 ` Laszlo Ersek
2019-04-02 15:38                   ` Laszlo Ersek
2019-04-02 15:50                   ` Auger Eric
2019-04-02 15:50                     ` Auger Eric
2019-04-03  9:49                   ` [Qemu-arm] " Igor Mammedov
2019-04-03  9:49                     ` Igor Mammedov
2019-04-03 12:10                     ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-03 12:10                       ` Shameerali Kolothum Thodi
2019-04-03 13:29                       ` [Qemu-arm] " Laszlo Ersek
2019-04-03 13:29                         ` Laszlo Ersek
2019-04-03 16:25                         ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-03 16:25                           ` Shameerali Kolothum Thodi
2019-04-08  8:11                           ` [Qemu-arm] " Igor Mammedov
2019-04-08  8:11                             ` Igor Mammedov
2019-04-08  8:11                             ` Igor Mammedov
2019-04-09 10:43                             ` [Qemu-arm] " Shameerali Kolothum Thodi
2019-04-09 10:43                               ` Shameerali Kolothum Thodi
2019-04-09 10:43                               ` Shameerali Kolothum Thodi
2019-04-03 13:19                     ` [Qemu-arm] " Laszlo Ersek
2019-04-03 13:19                       ` Laszlo Ersek
2019-04-08  8:13                       ` [Qemu-arm] " Igor Mammedov
2019-04-08  8:13                         ` Igor Mammedov
2019-04-08  8:13                         ` Igor Mammedov
2019-04-02  8:39             ` [Qemu-arm] " Peter Maydell
2019-04-02  8:39               ` Peter Maydell
2019-03-21 10:47 ` [Qemu-arm] [PATCH v3 08/10] hw/arm/boot: Expose the PC-DIMM nodes in the DT Shameer Kolothum
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 09/10] hw/acpi: Add ACPI Generic Event Device Support Shameer Kolothum
2019-03-29 13:09   ` [Qemu-arm] " Auger Eric
2019-03-29 13:44     ` Shameerali Kolothum Thodi
2019-03-21 10:47 ` [Qemu-devel] [PATCH v3 10/10] hw/arm/virt: Init GED device and enable memory hotplug Shameer Kolothum
2019-03-29 14:16   ` [Qemu-arm] " Auger Eric
2019-03-21 11:06 ` [Qemu-arm] [Qemu-devel] [PATCH v3 00/10] ARM virt: ACPI memory hotplug support no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401145809.55643fc6@redhat.com \
    --to=imammedo@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=linuxarm@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sameo@linux.intel.com \
    --cc=sebastien.boeuf@intel.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shannon.zhaosl@gmail.com \
    --cc=xuwei5@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.