All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
To: qemu-devel@nongnu.org, kvm@vger.kernel.org, seabios@seabios.org
Cc: gleb@redhat.com,
	Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	kevin@koconnor.net, avi@redhat.com, anthony@codemonkey.ws,
	imammedo@redhat.com
Subject: [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support
Date: Wed, 11 Jul 2012 12:31:47 +0200	[thread overview]
Message-ID: <1342002726-18258-3-git-send-email-vasilis.liaskovitis@profitbricks.com> (raw)
In-Reply-To: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com>

Define SSDT hotplug-able memory devices in _SB namespace. The dynamically
generated SSDT includes per memory device hotplug methods. These methods
just call methods defined in the DSDT. Also dynamically generate a MTFY
method and a MEON array of the online/available memory devices.  ACPI
extraction macros are used to place the AML code in variables later used by
src/acpi. The design is taken from SSDT cpu generation.

Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
---
 Makefile         |    2 +-
 src/ssdt-mem.dsl |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 src/ssdt-mem.dsl

diff --git a/Makefile b/Makefile
index fe974f7..299069e 100644
--- a/Makefile
+++ b/Makefile
@@ -228,7 +228,7 @@ $(OUT)%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.p
 	$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
-$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex
+$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-mem.hex
 
 ################ Kconfig rules
 
diff --git a/src/ssdt-mem.dsl b/src/ssdt-mem.dsl
new file mode 100644
index 0000000..ee322f0
--- /dev/null
+++ b/src/ssdt-mem.dsl
@@ -0,0 +1,65 @@
+/* This file is the basis for the ssdt_mem[] variable in src/acpi.c.
+ * It is similar in design to the ssdt_proc variable.
+ * It defines the contents of the per-cpu Processor() object.  At
+ * runtime, a dynamically generated SSDT will contain one copy of this
+ * AML snippet for every possible memory device in the system.  The
+ * objects will * be placed in the \_SB_ namespace.
+ *
+ * In addition to the aml code generated from this file, the
+ * src/acpi.c file creates a MEMNTFY method with an entry for each memdevice:
+ *     Method(MTFY, 2) {
+ *         If (LEqual(Arg0, 0x00)) { Notify(MP00, Arg1) }
+ *         If (LEqual(Arg0, 0x01)) { Notify(MP01, Arg1) }
+ *         ...
+ *     }
+ * and a MEON array with the list of active and inactive memory devices:
+ *     Name(MEON, Package() { One, One, ..., Zero, Zero, ... })
+ */
+ACPI_EXTRACT_ALL_CODE ssdm_mem_aml
+
+DefinitionBlock ("ssdt-mem.aml", "SSDT", 0x02, "BXPC", "CSSDT", 0x1)
+/*  v------------------ DO NOT EDIT ------------------v */
+{
+    ACPI_EXTRACT_DEVICE_START ssdt_mem_start
+    ACPI_EXTRACT_DEVICE_END ssdt_mem_end
+    ACPI_EXTRACT_DEVICE_STRING ssdt_mem_name
+    Device(MPAA) {
+        ACPI_EXTRACT_NAME_BYTE_CONST ssdt_mem_id
+        Name(ID, 0xAA)
+/*  ^------------------ DO NOT EDIT ------------------^
+ *
+ * The src/acpi.c code requires the above layout so that it can update
+ * MPAA and 0xAA with the appropriate MEMDEVICE id (see
+ * SD_OFFSET_MEMHEX/MEMID1/MEMID2).  Don't change the above without
+ * also updating the C code.
+ */
+        Name(_HID, EISAID("PNP0C80"))
+        Name(_PXM, 0xAA)
+
+        External(CMST, MethodObj)
+        External(MPEJ, MethodObj)
+
+        Name(_CRS, ResourceTemplate() {
+            QwordMemory(
+               ResourceConsumer,
+               ,
+               MinFixed,
+               MaxFixed,
+               Cacheable,
+               ReadWrite,
+               0x0,
+               0xDEADBEEF,
+               0xE6ADBEEE,
+               0x00000000,
+               0x08000000,
+               )
+        })
+        Method (_STA, 0) {
+            Return(CMST(ID))        
+        }    
+        Method (_EJ0, 1, NotSerialized) {
+            MPEJ(ID, Arg0)
+        }
+    }
+}    
+
-- 
1.7.9

WARNING: multiple messages have this Message-ID (diff)
From: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
To: qemu-devel@nongnu.org, kvm@vger.kernel.org, seabios@seabios.org
Cc: gleb@redhat.com,
	Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	kevin@koconnor.net, avi@redhat.com, anthony@codemonkey.ws,
	imammedo@redhat.com
Subject: [Qemu-devel] [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support
Date: Wed, 11 Jul 2012 12:31:47 +0200	[thread overview]
Message-ID: <1342002726-18258-3-git-send-email-vasilis.liaskovitis@profitbricks.com> (raw)
In-Reply-To: <1342002726-18258-1-git-send-email-vasilis.liaskovitis@profitbricks.com>

Define SSDT hotplug-able memory devices in _SB namespace. The dynamically
generated SSDT includes per memory device hotplug methods. These methods
just call methods defined in the DSDT. Also dynamically generate a MTFY
method and a MEON array of the online/available memory devices.  ACPI
extraction macros are used to place the AML code in variables later used by
src/acpi. The design is taken from SSDT cpu generation.

Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
---
 Makefile         |    2 +-
 src/ssdt-mem.dsl |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 src/ssdt-mem.dsl

diff --git a/Makefile b/Makefile
index fe974f7..299069e 100644
--- a/Makefile
+++ b/Makefile
@@ -228,7 +228,7 @@ $(OUT)%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.p
 	$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
-$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex
+$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-mem.hex
 
 ################ Kconfig rules
 
diff --git a/src/ssdt-mem.dsl b/src/ssdt-mem.dsl
new file mode 100644
index 0000000..ee322f0
--- /dev/null
+++ b/src/ssdt-mem.dsl
@@ -0,0 +1,65 @@
+/* This file is the basis for the ssdt_mem[] variable in src/acpi.c.
+ * It is similar in design to the ssdt_proc variable.
+ * It defines the contents of the per-cpu Processor() object.  At
+ * runtime, a dynamically generated SSDT will contain one copy of this
+ * AML snippet for every possible memory device in the system.  The
+ * objects will * be placed in the \_SB_ namespace.
+ *
+ * In addition to the aml code generated from this file, the
+ * src/acpi.c file creates a MEMNTFY method with an entry for each memdevice:
+ *     Method(MTFY, 2) {
+ *         If (LEqual(Arg0, 0x00)) { Notify(MP00, Arg1) }
+ *         If (LEqual(Arg0, 0x01)) { Notify(MP01, Arg1) }
+ *         ...
+ *     }
+ * and a MEON array with the list of active and inactive memory devices:
+ *     Name(MEON, Package() { One, One, ..., Zero, Zero, ... })
+ */
+ACPI_EXTRACT_ALL_CODE ssdm_mem_aml
+
+DefinitionBlock ("ssdt-mem.aml", "SSDT", 0x02, "BXPC", "CSSDT", 0x1)
+/*  v------------------ DO NOT EDIT ------------------v */
+{
+    ACPI_EXTRACT_DEVICE_START ssdt_mem_start
+    ACPI_EXTRACT_DEVICE_END ssdt_mem_end
+    ACPI_EXTRACT_DEVICE_STRING ssdt_mem_name
+    Device(MPAA) {
+        ACPI_EXTRACT_NAME_BYTE_CONST ssdt_mem_id
+        Name(ID, 0xAA)
+/*  ^------------------ DO NOT EDIT ------------------^
+ *
+ * The src/acpi.c code requires the above layout so that it can update
+ * MPAA and 0xAA with the appropriate MEMDEVICE id (see
+ * SD_OFFSET_MEMHEX/MEMID1/MEMID2).  Don't change the above without
+ * also updating the C code.
+ */
+        Name(_HID, EISAID("PNP0C80"))
+        Name(_PXM, 0xAA)
+
+        External(CMST, MethodObj)
+        External(MPEJ, MethodObj)
+
+        Name(_CRS, ResourceTemplate() {
+            QwordMemory(
+               ResourceConsumer,
+               ,
+               MinFixed,
+               MaxFixed,
+               Cacheable,
+               ReadWrite,
+               0x0,
+               0xDEADBEEF,
+               0xE6ADBEEE,
+               0x00000000,
+               0x08000000,
+               )
+        })
+        Method (_STA, 0) {
+            Return(CMST(ID))        
+        }    
+        Method (_EJ0, 1, NotSerialized) {
+            MPEJ(ID, Arg0)
+        }
+    }
+}    
+
-- 
1.7.9

  parent reply	other threads:[~2012-07-11 10:31 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 10:31 [RFC PATCH v2 00/21] ACPI memory hotplug Vasilis Liaskovitis
2012-07-11 10:31 ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 01/21][SeaBIOS] Add ACPI_EXTRACT_DEVICE* macros Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` Vasilis Liaskovitis [this message]
2012-07-11 10:31   ` [Qemu-devel] [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 03/21][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-17  7:23   ` Wen Congyang
2012-07-17  7:23     ` [Qemu-devel] " Wen Congyang
2012-07-20  8:48     ` Vasilis Liaskovitis
2012-07-20  8:48       ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 04/21][SeaBIOS] acpi: generate hotplug memory devices Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:48   ` Wen Congyang
2012-07-11 10:48     ` [Qemu-devel] " Wen Congyang
2012-07-11 16:39     ` Vasilis Liaskovitis
2012-07-11 16:39       ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 05/21][SeaBIOS] pciinit: Fix pcimem_start value Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 11:56   ` Gerd Hoffmann
2012-07-11 11:56     ` [Qemu-devel] " Gerd Hoffmann
2012-07-11 16:45     ` Vasilis Liaskovitis
2012-07-11 16:45       ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-12  7:22       ` Gerd Hoffmann
2012-07-12  7:22         ` [Qemu-devel] " Gerd Hoffmann
2012-07-12  9:09         ` Vasilis Liaskovitis
2012-07-12  9:09           ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 06/21] dimm: Implement memory device abstraction Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-12 19:55   ` Blue Swirl
2012-07-12 19:55     ` [Qemu-devel] " Blue Swirl
2012-07-13 17:39     ` Vasilis Liaskovitis
2012-07-13 17:39       ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 07/21] acpi_piix4: Implement memory device hotplug registers Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 08/21] pc: calculate dimm physical addresses and adjust memory map Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 09/21] pc: Add dimm paravirt SRAT info Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-12 19:48   ` Blue Swirl
2012-07-12 19:48     ` [Qemu-devel] " Blue Swirl
2012-07-13 17:40     ` Vasilis Liaskovitis
2012-07-13 17:40       ` Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 10/21] Implement "-dimm" command line option Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qmp commands Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 12/21] fix live-migration when "populated=on" is missing Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 13/21] Implement memory hotplug notification lists Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 14:59   ` Eric Blake
2012-07-11 14:59     ` Eric Blake
2012-07-11 16:47     ` Vasilis Liaskovitis
2012-07-11 16:47       ` Vasilis Liaskovitis
2012-07-11 10:31 ` [RFC PATCH v2 14/21][SeaBIOS] acpi_dsdt: Support _OST dimm method Vasilis Liaskovitis
2012-07-11 10:31   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 15/21] acpi_piix4: _OST dimm support Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM reboot Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 17/21][SeaBIOS] acpi_dsdt: Revert internal dimm state on _OST failure Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 18/21] acpi_piix4: Update dimm bitmap state on hot-remove fail Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 19/21] Implement "info memtotal" and "query-memtotal" Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 15:14   ` Eric Blake
2012-07-11 15:14     ` [Qemu-devel] " Eric Blake
2012-07-11 16:55     ` Vasilis Liaskovitis
2012-07-11 16:55       ` Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 20/21] Implement -dimms, -dimmspop command line options Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 14:55   ` Avi Kivity
2012-07-11 14:55     ` [Qemu-devel] " Avi Kivity
2012-07-11 16:57     ` Vasilis Liaskovitis
2012-07-11 16:57       ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-11 10:32 ` [RFC PATCH v2 21/21] Implement mem_increase, mem_decrease hmp/qmp commands Vasilis Liaskovitis
2012-07-11 10:32   ` [Qemu-devel] " Vasilis Liaskovitis
2012-07-12 20:04 ` [Qemu-devel] [RFC PATCH v2 00/21] ACPI memory hotplug Blue Swirl
2012-07-12 20:04   ` Blue Swirl
2012-07-13 17:49   ` Vasilis Liaskovitis
2012-07-13 17:49     ` Vasilis Liaskovitis
2012-07-14  9:08     ` Blue Swirl
2012-07-14  9:08       ` [Qemu-devel] " Blue Swirl

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=1342002726-18258-3-git-send-email-vasilis.liaskovitis@profitbricks.com \
    --to=vasilis.liaskovitis@profitbricks.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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 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.