From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 18/19] pc: acpi: memhp: remove acpi-dsdt-mem-hotplug.dsl and move \_GPE._E03 into SSDT
Date: Fri, 23 Oct 2015 16:57:21 +0200 [thread overview]
Message-ID: <1445612242-79172-19-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1445612242-79172-1-git-send-email-imammedo@redhat.com>
in addition to moving exclude _E03 handler from SSDT
if memory hotplug is not enabled.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/acpi/memory_hotplug_acpi_table.c | 6 +++---
hw/i386/acpi-build.c | 8 ++++++++
hw/i386/acpi-dsdt-mem-hotplug.dsl | 16 ----------------
hw/i386/acpi-dsdt.dsl | 5 -----
hw/i386/q35-acpi-dsdt.dsl | 5 -----
include/hw/acpi/memory_hotplug.h | 5 +++++
include/hw/acpi/pc-hotplug.h | 2 --
7 files changed, 16 insertions(+), 31 deletions(-)
delete mode 100644 hw/i386/acpi-dsdt-mem-hotplug.dsl
diff --git a/hw/acpi/memory_hotplug_acpi_table.c b/hw/acpi/memory_hotplug_acpi_table.c
index ea308ab..e370233 100644
--- a/hw/acpi/memory_hotplug_acpi_table.c
+++ b/hw/acpi/memory_hotplug_acpi_table.c
@@ -22,7 +22,7 @@
#define MEMORY_SLOT_LOCK "MLCK"
#define MEMORY_SLOT_SLECTOR "MSEL"
-#define BASEPATH "\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE) "."
+#define BASEPATH "\\_SB.PCI0." MEMORY_HOTPLUG_DEVICE "."
void build_mhpt(GArray *table_data, GArray *linker, uint32_t nr_mem,
uint16_t io_base, uint16_t io_len)
@@ -36,7 +36,7 @@ void build_mhpt(GArray *table_data, GArray *linker, uint32_t nr_mem,
/* scope for memory hotplug controller device node */
assert(nr_mem <= ACPI_MAX_RAM_SLOTS);
- ctrl_dev = aml_device("\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE));
+ ctrl_dev = aml_device("\\_SB.PCI0." MEMORY_HOTPLUG_DEVICE);
{
Aml *crs, *field;
Aml *a_slot_arg = aml_arg(0);
@@ -98,7 +98,7 @@ void build_mhpt(GArray *table_data, GArray *linker, uint32_t nr_mem,
aml_append(ctrl_dev, aml_mutex(MEMORY_SLOT_LOCK, 0));
- method = aml_method(stringify(MEMORY_SLOT_SCAN_METHOD), 0);
+ method = aml_method(MEMORY_SLOT_SCAN_METHOD, 0);
{
Aml *a_idx = aml_local(0);
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c929540..1bdae78 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -935,6 +935,14 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(sb_scope, method);
aml_append(ssdt, sb_scope);
+ scope = aml_scope("\\_GPE");
+ if (nr_mem) {
+ method = aml_method("_E03", 0);
+ aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH));
+ aml_append(scope, method);
+ }
+ aml_append(ssdt, scope);
+
/* Extra PCI root buses are implemented only for i440fx */
bus = find_i440fx();
if (bus) {
diff --git a/hw/i386/acpi-dsdt-mem-hotplug.dsl b/hw/i386/acpi-dsdt-mem-hotplug.dsl
deleted file mode 100644
index 20c5ec1..0000000
--- a/hw/i386/acpi-dsdt-mem-hotplug.dsl
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD, MethodObj)
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index 6d46b36..203863f 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -250,7 +250,6 @@ DefinitionBlock (
#include "hw/acpi/pc-hotplug.h"
#define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
#include "acpi-dsdt-cpu-hotplug.dsl"
-#include "acpi-dsdt-mem-hotplug.dsl"
/****************************************************************
@@ -271,10 +270,6 @@ DefinitionBlock (
// CPU hotplug event
\_SB.PRSC()
}
- Method(_E03) {
- // Memory hotplug event
- \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()
- }
Method(_L04) {
}
Method(_L05) {
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index ecefdec..ca2d25d 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -387,7 +387,6 @@ DefinitionBlock (
#include "hw/acpi/pc-hotplug.h"
#define CPU_STATUS_BASE ICH9_CPU_HOTPLUG_IO_BASE
#include "acpi-dsdt-cpu-hotplug.dsl"
-#include "acpi-dsdt-mem-hotplug.dsl"
/****************************************************************
@@ -404,10 +403,6 @@ DefinitionBlock (
// CPU hotplug event
\_SB.PRSC()
}
- Method(_E03) {
- // Memory hotplug event
- \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()
- }
Method(_L04) {
}
Method(_L05) {
diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotplug.h
index 5fd2854..a107b9b 100644
--- a/include/hw/acpi/memory_hotplug.h
+++ b/include/hw/acpi/memory_hotplug.h
@@ -46,6 +46,11 @@ extern const VMStateDescription vmstate_memory_hotplug;
void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list);
+#define MEMORY_HOTPLUG_DEVICE "MHPD"
+#define MEMORY_SLOT_SCAN_METHOD "MSCN"
+#define MEMORY_HOTPLUG_HANDLER_PATH "\\_SB.PCI0." MEMORY_HOTPLUG_DEVICE "." \
+ MEMORY_SLOT_SCAN_METHOD
+
void build_mhpt(GArray *table_data, GArray *linker, uint32_t nr_mem,
uint16_t io_base, uint16_t io_len);
#endif
diff --git a/include/hw/acpi/pc-hotplug.h b/include/hw/acpi/pc-hotplug.h
index 29f0244..65e7d3b 100644
--- a/include/hw/acpi/pc-hotplug.h
+++ b/include/hw/acpi/pc-hotplug.h
@@ -32,8 +32,6 @@
#define ACPI_MEMORY_HOTPLUG_IO_LEN 24
#define ACPI_MEMORY_HOTPLUG_BASE 0x0a00
-#define MEMORY_HOTPLUG_DEVICE MHPD
#define MEMORY_HOTPLUG_IO_REGION HPMR
-#define MEMORY_SLOT_SCAN_METHOD MSCN
#endif
--
1.8.3.1
next prev parent reply other threads:[~2015-10-23 14:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 14:57 [Qemu-devel] [PATCH 00/19] pc: acpi: move memory hotplug out of DSDT/SSDT into custom table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 01/19] acpi: aml: add aml_lgreater_equal() and aml_load_table() Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 02/19] acpi: add aml_mutex(), aml_acquire(), aml_release() Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 03/19] acpi: aml: add aml_create_qword_field() Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 04/19] acpi: aml: add aml_decrement() and aml_subtract() Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 05/19] acpi: aml: add aml_call0() helper Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 06/19] pc: acpi: move SSDT part of memhp into a custom table Igor Mammedov
2015-10-24 17:41 ` Michael S. Tsirkin
2015-10-24 17:59 ` Michael S. Tsirkin
2015-10-25 13:33 ` Laszlo Ersek
2015-10-26 13:36 ` Igor Mammedov
2015-10-24 19:37 ` Michael S. Tsirkin
2015-10-23 14:57 ` [Qemu-devel] [PATCH 07/19] pc: acpi: memhp: move MHPD._STA method into MHPT table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 08/19] pc: acpi: memhp: move MHPD.MLCK mutex into NHPT table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 09/19] pc: acpi: memhp: move MHPD.MSCN method into MHPT table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 10/19] pc: acpi: make memory device's _UID integer Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 11/19] pc: acpi: memhp: move MHPD.MRST method into MHPT table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 12/19] pc: acpi: memhp: move MHPD.MPXM " Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 13/19] pc: acpi: memhp: move MHPD.MOST " Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 14/19] pc: acpi: memhp: move MHPD.MEJ0 " Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 15/19] pc: acpi: bump DSDT revision compliance to v2 Igor Mammedov
2015-10-24 19:40 ` Michael S. Tsirkin
2015-10-26 10:03 ` Igor Mammedov
2015-10-26 10:07 ` Michael S. Tsirkin
2015-10-26 11:06 ` Igor Mammedov
2015-10-26 11:17 ` Michael S. Tsirkin
2015-10-23 14:57 ` [Qemu-devel] [PATCH 16/19] pc: acpi: memhp: move MHPD.MCRS method into MHPT table Igor Mammedov
2015-10-23 14:57 ` [Qemu-devel] [PATCH 17/19] pc: acpi: memhp: move MHPD Device along with _UID/_HID " Igor Mammedov
2015-10-23 14:57 ` Igor Mammedov [this message]
2015-10-23 14:57 ` [Qemu-devel] [PATCH 19/19] pc: acpi: memhp: cleanup MEMORY_HOTPLUG_IO_REGION usage Igor Mammedov
2015-10-23 16:38 ` [Qemu-devel] [PATCH 00/19] pc: acpi: move memory hotplug out of DSDT/SSDT into custom table Laszlo Ersek
2015-10-24 17:39 ` Michael S. Tsirkin
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=1445612242-79172-19-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).