[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 3/7] acpi-dsdt: Implement functions for memory ho
From: |
Hu Tao |
Subject: |
[Qemu-devel] [PATCH v5 3/7] acpi-dsdt: Implement functions for memory hotplug |
Date: |
Wed, 26 Jun 2013 17:15:01 +0800 |
From: Vasilis Liaskovitis <address@hidden>
Extend the DSDT to include methods for handling memory hot-add and hot-remove
notifications and memory device status requests. These functions are called
from the memory device SSDT methods.
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
src/acpi-dsdt-mem-hotplug.dsl | 57 +++++++++++++++++++++++++++++++++++++++++++
src/acpi-dsdt.dsl | 5 +++-
2 files changed, 61 insertions(+), 1 deletion(-)
create mode 100644 src/acpi-dsdt-mem-hotplug.dsl
diff --git a/src/acpi-dsdt-mem-hotplug.dsl b/src/acpi-dsdt-mem-hotplug.dsl
new file mode 100644
index 0000000..1d82532
--- /dev/null
+++ b/src/acpi-dsdt-mem-hotplug.dsl
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Memory hotplug
+ ****************************************************************/
+
+Scope(\_SB) {
+ /* Objects filled in by run-time generated SSDT */
+ External(MTFY, MethodObj)
+ External(MEON, PkgObj)
+
+ Method (CMST, 1, NotSerialized) {
+ // _STA method - return ON status of memdevice
+ // Local0 = MEON flag for this cpu
+ Store(DerefOf(Index(MEON, Arg0)), Local0)
+ If (Local0) { Return(0xF) } Else { Return(0x0) }
+ }
+
+ /* Memory hotplug notify array */
+ OperationRegion(MEST, SystemIO, 0xaf80, 32)
+ Field (MEST, ByteAcc, NoLock, Preserve)
+ {
+ MES, 256
+ }
+
+ Method(MESC, 0) {
+ // Local5 = active memdevice bitmap
+ Store (MES, Local5)
+ // Local2 = last read byte from bitmap
+ Store (Zero, Local2)
+ // Local0 = memory device iterator
+ Store (Zero, Local0)
+ While (LLess(Local0, SizeOf(MEON))) {
+ // Local1 = MEON flag for this memory device
+ Store(DerefOf(Index(MEON, Local0)), Local1)
+ If (And(Local0, 0x07)) {
+ // Shift down previously read bitmap byte
+ ShiftRight(Local2, 1, Local2)
+ } Else {
+ // Read next byte from memdevice bitmap
+ Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))),
Local2)
+ }
+ // Local3 = active state for this memory device
+ Store(And(Local2, 1), Local3)
+
+ If (LNotEqual(Local1, Local3)) {
+ // State change - update MEON with new state
+ Store(Local3, Index(MEON, Local0))
+ // Do MEM notify
+ If (LEqual(Local3, 1)) {
+ MTFY(Local0, 1)
+ }
+ }
+ Increment(Local0)
+ }
+ Return(One)
+ }
+
+}
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 158f6b4..98c9413 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -294,6 +294,7 @@ DefinitionBlock (
}
#include "acpi-dsdt-cpu-hotplug.dsl"
+#include "acpi-dsdt-mem-hotplug.dsl"
/****************************************************************
@@ -313,7 +314,9 @@ DefinitionBlock (
// CPU hotplug event
\_SB.PRSC()
}
- Method(_L03) {
+ Method(_E03) {
+ // Memory hotplug event
+ \_SB.MESC()
}
Method(_L04) {
}
--
1.8.3.1
- [Qemu-devel] [PATCH v5 13/14] balloon: update with hotplugged memory, (continued)
- [Qemu-devel] [PATCH v5 13/14] balloon: update with hotplugged memory, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 07/14] acpi_ich9 : Implement memory device hotplug registers, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 10/14] pc: Add dimm paravirt SRAT info, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 12/14] Implement "info memory" and "query-memory", Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 08/14] memory: record below_4g_mem_size, above_4g_mem_size, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 14/14] Implement dimm-info, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 0/7] support for ACPI memory hotplug, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 1/7] Add ACPI_EXTRACT_DEVICE* macros, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 2/7] Add SSDT memory device support, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 4/7] set psize to 0 when romfile_loadfile failed, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 3/7] acpi-dsdt: Implement functions for memory hotplug,
Hu Tao <=
- [Qemu-devel] [PATCH v5 6/7] q35: Add memory hotplug handler, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 7/7] pci: Use paravirt interface for pcimem_start and pcimem64_start, Hu Tao, 2013/06/26
- [Qemu-devel] [PATCH v5 5/7] acpi: generate hotplug memory devices, Hu Tao, 2013/06/26