acpi dsdt rework, misc fixes
[Qemu-devel] [PULL 04/59] tests: acpi: print ASL diff in verbose mode
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
print ASL difference if there is any when executing 'make V=1 check'.
Use 'DIFF' environment variable to determine which diff utility to use and if it's not set notify user by printing warning that DIFF is not set if run in verbose mode and there is difference in ASL.
--- tests/bios-tables-test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tests/bios-tables-test.c +16 -0
@@ -580,6 +580,22 @@ static void test_acpi_asl(test_data *data) (gchar *)&signature, sdt->asl_file, sdt->aml_file, exp_sdt->asl_file, exp_sdt->aml_file); +if (getenv ("V" )) { +const char *diff_cmd =getenv ("DIFF" ); +if (diff_cmd) { + int ret G_GNUC_UNUSED; +char *diff =g_strdup_printf ("%s %s %s" , diff_cmd, + exp_sdt->asl_file, sdt->asl_file); + ret =system (diff) ; +g_free (diff); + }else { +fprintf (stderr,"acpi-test: Warning. not showing " +"difference since no diff utility is specified. " +"Set 'DIFF' environment variable to a preferred " +"diff utility and run 'make V=1 check' again to " +"see ASL difference." ); + } + } } }g_string_free (asl, true);
Signature · 1 line
MST
[Qemu-devel] [PULL 05/59] pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/memory_hotplug.h | 4 ++++ hw/acpi/memory_hotplug_acpi_table.c | 30 ++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 3 +++ hw/acpi/Makefile.objs | 2 +- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 hw/acpi/memory_hotplug_acpi_table.c
include/hw/acpi/memory_hotplug.h +4 -0
@@ -4,6 +4,7 @@#include "hw/qdev-core.h" #include "hw/acpi/acpi.h" #include "migration/vmstate.h" +#include "hw/acpi/aml-build.h" /** * MemStatus:
@@ -45,4 +46,7 @@ extern const VMStateDescription vmstate_memory_hotplug; vmstate_memory_hotplug, MemHotplugState)void acpi_memory_ospm_status (MemHotplugState *mem_st,ACPIOSTInfoList ***list); + +void build_memory_hotplug_aml (Aml *ctx,uint32_t nr_mem, +uint16_t io_base,uint16_t io_len);#endif
hw/acpi/memory_hotplug_acpi_table.c new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Memory hotplug AML code of DSDT ACPI table +* +* Copyright (C) 2015 Red Hat Inc +* +* Author: Igor Mammedov <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <stdbool.h> +#include "hw/acpi/memory_hotplug.h" +#include "include/hw/acpi/pc-hotplug.h" +#include "hw/boards.h" + +void build_memory_hotplug_aml (Aml *ctx,uint32_t nr_mem, +uint16_t io_base,uint16_t io_len) +{ +Aml *pci_scope; +Aml *mem_ctrl_dev; + +/* scope for memory hotplug controller device node */ + pci_scope =aml_scope ("_SB.PCI0" ); + mem_ctrl_dev =aml_scope (stringify (MEMORY_HOTPLUG_DEVICE )); + { + } +aml_append (pci_scope, mem_ctrl_dev); +aml_append (ctx, pci_scope); +}
hw/i386/acpi-build.c +3 -0
@@ -956,6 +956,9 @@ build_ssdt(GArray *table_data, GArray *linker,/* Reserve space for header */ acpi_data_push (ssdt->buf,sizeof (AcpiTableHeader)); +build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, + pm->mem_hp_io_len); + bus =PC_MACHINE (machine)->bus;if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) {
hw/acpi/Makefile.objs +1 -1
@@ -1,7 +1,7 @@ common-obj-$(CONFIG_ACPI_X86) += core.o piix4.o pcihp.o common-obj-$(CONFIG_ACPI_X86_ICH) += ich9.o tco.o common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu_hotplug.o -common-obj-$(CONFIG_ACPI_MEMORY_HOTPLUG) += memory_hotplug.o +common-obj-$(CONFIG_ACPI_MEMORY_HOTPLUG) += memory_hotplug.o memory_hotplug_acpi_table.o common-obj-$(CONFIG_ACPI_NVDIMM) += nvdimm.o common-obj-$(CONFIG_ACPI) += acpi_interface.o common-obj-$(CONFIG_ACPI) += bios-linker-loader.o
Signature · 1 line
MST
[Qemu-devel] [PULL 06/59] pc: acpi: memhp: move MHPD._STA method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 14 ++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 8 -------- 2 files changed, 14 insertions(+), 8 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +14 -0
@@ -17,6 +17,8 @@void build_memory_hotplug_aml (Aml *ctx,uint32_t nr_mem,uint16_t io_base,uint16_t io_len) { +Aml *ifctx; +Aml *method;Aml *pci_scope;Aml *mem_ctrl_dev;
@@ -24,6 +26,18 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem, pci_scope =aml_scope ("_SB.PCI0" ); mem_ctrl_dev =aml_scope (stringify (MEMORY_HOTPLUG_DEVICE )); { +Aml *zero =aml_int (0 ); +Aml *slots_nr =aml_name (stringify (MEMORY_SLOTS_NUMBER )); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); + ifctx =aml_if (aml_equal (slots_nr, zero)); + { +aml_append (ifctx,aml_return (zero)); + } +aml_append (method, ifctx); +/* present, functioning, decoding, not shown in UI */ +aml_append (method,aml_return (aml_int (0xB ))); +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -8
@@ -35,14 +35,6 @@ External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only - Method(_STA, 0) { - If (LEqual(MEMORY_SLOTS_NUMBER, Zero)) { - Return(0x0) - } - /* present, functioning, decoding, not shown in UI */ - Return(0xB) - } - Mutex (MEMORY_SLOT_LOCK, 0) Method(MEMORY_SLOT_SCAN_METHOD, 0) {
Signature · 1 line
MST
[Qemu-devel] [PULL 07/59] pc: acpi: memhp: move MHPD.MLCK mutex into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 2 ++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +2 -0
@@ -38,6 +38,8 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,/* present, functioning, decoding, not shown in UI */ aml_append (method,aml_return (aml_int (0xB )));aml_append (mem_ctrl_dev, method); + +aml_append (mem_ctrl_dev,aml_mutex (stringify (MEMORY_SLOT_LOCK ),0 )); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +1 -2
@@ -34,8 +34,7 @@ External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only - - Mutex (MEMORY_SLOT_LOCK, 0) + External(MEMORY_SLOT_LOCK, MutexObj) Method(MEMORY_SLOT_SCAN_METHOD, 0) { If (LEqual(MEMORY_SLOTS_NUMBER, Zero)) {
Signature · 1 line
MST
[Qemu-devel] [PULL 08/59] pc: acpi: memhp: move MHPD.MSCN method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 60 +++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 27 +---------------- 2 files changed, 61 insertions(+), 26 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +60 -0
@@ -26,8 +26,11 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem, pci_scope =aml_scope ("_SB.PCI0" ); mem_ctrl_dev =aml_scope (stringify (MEMORY_HOTPLUG_DEVICE )); { +Aml *one =aml_int (1 );Aml *zero =aml_int (0 );Aml *slots_nr =aml_name (stringify (MEMORY_SLOTS_NUMBER )); +Aml *ctrl_lock =aml_name (stringify (MEMORY_SLOT_LOCK )); +Aml *slot_selector =aml_name (stringify (MEMORY_SLOT_SLECTOR )); method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); ifctx =aml_if (aml_equal (slots_nr, zero));
@@ -40,6 +43,63 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (mem_ctrl_dev, method);aml_append (mem_ctrl_dev,aml_mutex (stringify (MEMORY_SLOT_LOCK ),0 )); + + method =aml_method (stringify (MEMORY_SLOT_SCAN_METHOD ),0 , +AML_NOTSERIALIZED ); + { +Aml *else_ctx; +Aml *while_ctx; +Aml *idx =aml_local (0 ); +Aml *eject_req =aml_int (3 ); +Aml *dev_chk =aml_int (1 ); + + ifctx =aml_if (aml_equal (slots_nr, zero)); + { +aml_append (ifctx,aml_return (zero)); + } +aml_append (method, ifctx); + +aml_append (method,aml_store (zero, idx)); +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +/* build AML that: +* loops over all slots and Notifies DIMMs with +* Device Check or Eject Request notifications if +* slot has corresponding status bit set and clears +* slot status. +*/ + while_ctx =aml_while (aml_lless (idx, slots_nr)); + { +Aml *ins_evt =aml_name (stringify (MEMORY_SLOT_INSERT_EVENT )); +Aml *rm_evt =aml_name (stringify (MEMORY_SLOT_REMOVE_EVENT )); + +aml_append (while_ctx,aml_store (idx, slot_selector)); + ifctx =aml_if (aml_equal (ins_evt, one)); + { +aml_append (ifctx, +aml_call2 (stringify (MEMORY_SLOT_NOTIFY_METHOD ), + idx, dev_chk)); +aml_append (ifctx,aml_store (one, ins_evt)); + } +aml_append (while_ctx, ifctx); + + else_ctx =aml_else (); + ifctx =aml_if (aml_equal (rm_evt, one)); + { +aml_append (ifctx, +aml_call2 (stringify (MEMORY_SLOT_NOTIFY_METHOD ), + idx, eject_req)); +aml_append (ifctx,aml_store (one, rm_evt)); + } +aml_append (else_ctx, ifctx); +aml_append (while_ctx, else_ctx); + +aml_append (while_ctx,aml_add (idx, one, idx)); + } +aml_append (method, while_ctx); +aml_append (method,aml_release (ctrl_lock)); +aml_append (method,aml_return (one)); + } +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +1 -26
@@ -13,13 +13,12 @@ * with this program; if not, see <http://www.gnu.org/licenses/>. */ - External(MEMORY_SLOT_NOTIFY_METHOD, MethodObj) + External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD, MethodObj) Scope(\_SB.PCI0) { Device(MEMORY_HOTPLUG_DEVICE) { Name(_HID, "PNP0A06") Name(_UID, "Memory hotplug resources") - External(MEMORY_SLOTS_NUMBER, IntObj) /* Memory hotplug IO registers */ External(MEMORY_SLOT_ADDR_LOW, FieldUnitObj) // read only
@@ -28,36 +27,12 @@ External(MEMORY_SLOT_SIZE_HIGH, FieldUnitObj) // read only External(MEMORY_SLOT_PROXIMITY, FieldUnitObj) // read only External(MEMORY_SLOT_ENABLED, FieldUnitObj) // 1 if enabled, read only - External(MEMORY_SLOT_INSERT_EVENT, FieldUnitObj) // (read) 1 if has a insert event. (write) 1 to clear event - External(MEMORY_SLOT_REMOVE_EVENT, FieldUnitObj) // (read) 1 if has a remove event. (write) 1 to clear event External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only External(MEMORY_SLOT_LOCK, MutexObj) - Method(MEMORY_SLOT_SCAN_METHOD, 0) { - If (LEqual(MEMORY_SLOTS_NUMBER, Zero)) { - Return(Zero) - } - - Store(Zero, Local0) // Mem devs iterrator - Acquire(MEMORY_SLOT_LOCK, 0xFFFF) - while (LLess(Local0, MEMORY_SLOTS_NUMBER)) { - Store(Local0, MEMORY_SLOT_SLECTOR) // select Local0 DIMM - If (LEqual(MEMORY_SLOT_INSERT_EVENT, One)) { // Memory device needs check - MEMORY_SLOT_NOTIFY_METHOD(Local0, 1) - Store(1, MEMORY_SLOT_INSERT_EVENT) - } Elseif (LEqual(MEMORY_SLOT_REMOVE_EVENT, One)) { // Ejection request - MEMORY_SLOT_NOTIFY_METHOD(Local0, 3) - Store(1, MEMORY_SLOT_REMOVE_EVENT) - } - Add(Local0, One, Local0) // goto next DIMM - } - Release(MEMORY_SLOT_LOCK) - Return(One) - } - Method(MEMORY_SLOT_STATUS_METHOD, 1) { Store(Zero, Local0)
Signature · 1 line
MST
[Qemu-devel] [PULL 09/59] pc: acpi: memhp: move MHPD.MRST method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 23 +++++++++++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 15 --------------- 2 files changed, 23 insertions(+), 15 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +23 -0
@@ -28,6 +28,8 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem, {Aml *one =aml_int (1 );Aml *zero =aml_int (0 ); +Aml *ret_val =aml_local (0 ); +Aml *slot_arg0 =aml_arg (0 );Aml *slots_nr =aml_name (stringify (MEMORY_SLOTS_NUMBER ));Aml *ctrl_lock =aml_name (stringify (MEMORY_SLOT_LOCK ));Aml *slot_selector =aml_name (stringify (MEMORY_SLOT_SLECTOR ));
@@ -100,6 +102,27 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (method,aml_return (one)); }aml_append (mem_ctrl_dev, method); + + method =aml_method (stringify (MEMORY_SLOT_STATUS_METHOD ),1 , +AML_NOTSERIALIZED ); + { +Aml *slot_enabled =aml_name (stringify (MEMORY_SLOT_ENABLED )); + +aml_append (method,aml_store (zero, ret_val)); +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +aml_append (method, +aml_store (aml_to_integer (slot_arg0), slot_selector)); + + ifctx =aml_if (aml_equal (slot_enabled, one)); + { +aml_append (ifctx,aml_store (aml_int (0xF ), ret_val)); + } +aml_append (method, ifctx); + +aml_append (method,aml_release (ctrl_lock)); +aml_append (method,aml_return (ret_val)); + } +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -15
@@ -26,27 +26,12 @@ External(MEMORY_SLOT_SIZE_LOW, FieldUnitObj) // read only External(MEMORY_SLOT_SIZE_HIGH, FieldUnitObj) // read only External(MEMORY_SLOT_PROXIMITY, FieldUnitObj) // read only - External(MEMORY_SLOT_ENABLED, FieldUnitObj) // 1 if enabled, read only External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only External(MEMORY_SLOT_LOCK, MutexObj) - Method(MEMORY_SLOT_STATUS_METHOD, 1) { - Store(Zero, Local0) - - Acquire(MEMORY_SLOT_LOCK, 0xFFFF) - Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM - - If (LEqual(MEMORY_SLOT_ENABLED, One)) { - Store(0xF, Local0) - } - - Release(MEMORY_SLOT_LOCK) - Return(Local0) - } - Method(MEMORY_SLOT_CRS_METHOD, 1, Serialized) { Acquire(MEMORY_SLOT_LOCK, 0xFFFF) Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM
Signature · 1 line
MST
[Qemu-devel] [PULL 10/59] pc: acpi: memhp: move MHPD.MPXM method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 14 ++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 9 --------- 2 files changed, 14 insertions(+), 9 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +14 -0
@@ -123,6 +123,20 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (method,aml_return (ret_val)); }aml_append (mem_ctrl_dev, method); + + method =aml_method (stringify (MEMORY_SLOT_PROXIMITY_METHOD ),1 , +AML_NOTSERIALIZED ); + { +Aml *proximity =aml_name (stringify (MEMORY_SLOT_PROXIMITY )); + +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +aml_append (method,aml_store (aml_to_integer (slot_arg0), + slot_selector)); +aml_append (method,aml_store (proximity, ret_val)); +aml_append (method,aml_release (ctrl_lock)); +aml_append (method,aml_return (ret_val)); + } +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -9
@@ -25,7 +25,6 @@ External(MEMORY_SLOT_ADDR_HIGH, FieldUnitObj) // read only External(MEMORY_SLOT_SIZE_LOW, FieldUnitObj) // read only External(MEMORY_SLOT_SIZE_HIGH, FieldUnitObj) // read only - External(MEMORY_SLOT_PROXIMITY, FieldUnitObj) // read only External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only
@@ -96,14 +95,6 @@ Return(MR64) } - Method(MEMORY_SLOT_PROXIMITY_METHOD, 1) { - Acquire(MEMORY_SLOT_LOCK, 0xFFFF) - Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM - Store(MEMORY_SLOT_PROXIMITY, Local0) - Release(MEMORY_SLOT_LOCK) - Return(Local0) - } - Method(MEMORY_SLOT_OST_METHOD, 4) { Acquire(MEMORY_SLOT_LOCK, 0xFFFF) Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM
Signature · 1 line
MST
[Qemu-devel] [PULL 11/59] pc: acpi: memhp: move MHPD.MOST method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 15 +++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +15 -0
@@ -137,6 +137,21 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (method,aml_return (ret_val)); }aml_append (mem_ctrl_dev, method); + + method =aml_method (stringify (MEMORY_SLOT_OST_METHOD ),4 , +AML_NOTSERIALIZED ); + { +Aml *ost_evt =aml_name (stringify (MEMORY_SLOT_OST_EVENT )); +Aml *ost_status =aml_name (stringify (MEMORY_SLOT_OST_STATUS )); + +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +aml_append (method,aml_store (aml_to_integer (slot_arg0), + slot_selector)); +aml_append (method,aml_store (aml_arg (1 ), ost_evt)); +aml_append (method,aml_store (aml_arg (2 ), ost_status)); +aml_append (method,aml_release (ctrl_lock)); + } +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -10
@@ -27,8 +27,6 @@ External(MEMORY_SLOT_SIZE_HIGH, FieldUnitObj) // read only External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only - External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only - External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only External(MEMORY_SLOT_LOCK, MutexObj) Method(MEMORY_SLOT_CRS_METHOD, 1, Serialized) {
@@ -95,14 +93,6 @@ Return(MR64) } - Method(MEMORY_SLOT_OST_METHOD, 4) { - Acquire(MEMORY_SLOT_LOCK, 0xFFFF) - Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM - Store(Arg1, MEMORY_SLOT_OST_EVENT) - Store(Arg2, MEMORY_SLOT_OST_STATUS) - Release(MEMORY_SLOT_LOCK) - } - Method(MEMORY_SLOT_EJECT_METHOD, 2) { Acquire(MEMORY_SLOT_LOCK, 0xFFFF) Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM
Signature · 1 line
MST
[Qemu-devel] [PULL 12/59] pc: acpi: memhp: move MHPD.MEJ0 method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 13 +++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +13 -0
@@ -152,6 +152,19 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (method,aml_release (ctrl_lock)); }aml_append (mem_ctrl_dev, method); + + method =aml_method (stringify (MEMORY_SLOT_EJECT_METHOD ),2 , +AML_NOTSERIALIZED ); + { +Aml *eject =aml_name (stringify (MEMORY_SLOT_EJECT )); + +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +aml_append (method,aml_store (aml_to_integer (slot_arg0), + slot_selector)); +aml_append (method,aml_store (one, eject)); +aml_append (method,aml_release (ctrl_lock)); + } +aml_append (mem_ctrl_dev, method); }aml_append (pci_scope, mem_ctrl_dev);aml_append (ctx, pci_scope);
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -8
@@ -25,7 +25,6 @@ External(MEMORY_SLOT_ADDR_HIGH, FieldUnitObj) // read only External(MEMORY_SLOT_SIZE_LOW, FieldUnitObj) // read only External(MEMORY_SLOT_SIZE_HIGH, FieldUnitObj) // read only - External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only External(MEMORY_SLOT_LOCK, MutexObj)
@@ -92,12 +91,5 @@ Release(MEMORY_SLOT_LOCK) Return(MR64) } - - Method(MEMORY_SLOT_EJECT_METHOD, 2) { - Acquire(MEMORY_SLOT_LOCK, 0xFFFF) - Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM - Store(1, MEMORY_SLOT_EJECT) - Release(MEMORY_SLOT_LOCK) - } } // Device() } // Scope()
Signature · 1 line
MST
[Qemu-devel] [PULL 13/59] pc: acpi: memhp: move MHPD.MCRS method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/acpi/memory_hotplug_acpi_table.c | 92 +++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 72 ----------------------------- 2 files changed, 92 insertions(+), 72 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +92 -0
@@ -124,6 +124,98 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem, }aml_append (mem_ctrl_dev, method); + method =aml_method (stringify (MEMORY_SLOT_CRS_METHOD ),1 , +AML_SERIALIZED ); + { +Aml *mr64 =aml_name ("MR64" ); +Aml *mr32 =aml_name ("MR32" ); +Aml *crs_tmpl =aml_resource_template (); +Aml *minl =aml_name ("MINL" ); +Aml *minh =aml_name ("MINH" ); +Aml *maxl =aml_name ("MAXL" ); +Aml *maxh =aml_name ("MAXH" ); +Aml *lenl =aml_name ("LENL" ); +Aml *lenh =aml_name ("LENH" ); + +aml_append (method,aml_acquire (ctrl_lock,0xFFFF )); +aml_append (method,aml_store (aml_to_integer (slot_arg0), + slot_selector)); + +aml_append (crs_tmpl, +aml_qword_memory (AML_POS_DECODE ,AML_MIN_FIXED ,AML_MAX_FIXED , +AML_CACHEABLE ,AML_READ_WRITE , +0 ,0x0 ,0xFFFFFFFFFFFFFFFE ,0 , +0xFFFFFFFFFFFFFFFF )); +aml_append (method,aml_name_decl ("MR64" , crs_tmpl)); +aml_append (method, +aml_create_dword_field (mr64,aml_int (14 ),"MINL" )); +aml_append (method, +aml_create_dword_field (mr64,aml_int (18 ),"MINH" )); +aml_append (method, +aml_create_dword_field (mr64,aml_int (38 ),"LENL" )); +aml_append (method, +aml_create_dword_field (mr64,aml_int (42 ),"LENH" )); +aml_append (method, +aml_create_dword_field (mr64,aml_int (22 ),"MAXL" )); +aml_append (method, +aml_create_dword_field (mr64,aml_int (26 ),"MAXH" )); + +aml_append (method, +aml_store (aml_name (stringify (MEMORY_SLOT_ADDR_HIGH )), minh)); +aml_append (method, +aml_store (aml_name (stringify (MEMORY_SLOT_ADDR_LOW )), minl)); +aml_append (method, +aml_store (aml_name (stringify (MEMORY_SLOT_SIZE_HIGH )), lenh)); +aml_append (method, +aml_store (aml_name (stringify (MEMORY_SLOT_SIZE_LOW )), lenl)); + +/* 64-bit math: MAX = MIN + LEN - 1 */ +aml_append (method,aml_add (minl, lenl, maxl)); +aml_append (method,aml_add (minh, lenh, maxh)); + ifctx =aml_if (aml_lless (maxl, minl)); + { +aml_append (ifctx,aml_add (maxh, one, maxh)); + } +aml_append (method, ifctx); + ifctx =aml_if (aml_lless (maxl, one)); + { +aml_append (ifctx,aml_subtract (maxh, one, maxh)); + } +aml_append (method, ifctx); +aml_append (method,aml_subtract (maxl, one, maxl)); + +/* return 32-bit _CRS if addr/size is in low mem */ +/* TODO: remove it since all hotplugged DIMMs are in high mem */ + ifctx =aml_if (aml_equal (maxh, zero)); + { + crs_tmpl =aml_resource_template (); +aml_append (crs_tmpl, +aml_dword_memory (AML_POS_DECODE ,AML_MIN_FIXED , +AML_MAX_FIXED ,AML_CACHEABLE , +AML_READ_WRITE , +0 ,0x0 ,0xFFFFFFFE ,0 , +0xFFFFFFFF )); +aml_append (ifctx,aml_name_decl ("MR32" , crs_tmpl)); +aml_append (ifctx, +aml_create_dword_field (mr32,aml_int (10 ),"MIN" )); +aml_append (ifctx, +aml_create_dword_field (mr32,aml_int (14 ),"MAX" )); +aml_append (ifctx, +aml_create_dword_field (mr32,aml_int (22 ),"LEN" )); +aml_append (ifctx,aml_store (minl,aml_name ("MIN" ))); +aml_append (ifctx,aml_store (maxl,aml_name ("MAX" ))); +aml_append (ifctx,aml_store (lenl,aml_name ("LEN" ))); + +aml_append (ifctx,aml_release (ctrl_lock)); +aml_append (ifctx,aml_return (mr32)); + } +aml_append (method, ifctx); + +aml_append (method,aml_release (ctrl_lock)); +aml_append (method,aml_return (mr64)); + } +aml_append (mem_ctrl_dev, method); + method =aml_method (stringify (MEMORY_SLOT_PROXIMITY_METHOD ),1 ,AML_NOTSERIALIZED ); {
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -72
77 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 14/59] pc: acpi: memhp: move MHPD Device into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
move remnants of MHPD device from DSDT into SSDT.
i.e. Device(MHPD), _UID, _HID
--- hw/acpi/memory_hotplug_acpi_table.c | 6 +++++- hw/i386/acpi-dsdt-mem-hotplug.dsl | 7 ------- 2 files changed, 5 insertions(+), 8 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +5 -1
@@ -24,7 +24,7 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,/* scope for memory hotplug controller device node */ pci_scope =aml_scope ("_SB.PCI0" ); - mem_ctrl_dev =aml_scope (stringify (MEMORY_HOTPLUG_DEVICE )); + mem_ctrl_dev =aml_device (stringify (MEMORY_HOTPLUG_DEVICE )); {Aml *one =aml_int (1 );Aml *zero =aml_int (0 );
@@ -34,6 +34,10 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,Aml *ctrl_lock =aml_name (stringify (MEMORY_SLOT_LOCK ));Aml *slot_selector =aml_name (stringify (MEMORY_SLOT_SLECTOR )); +aml_append (mem_ctrl_dev,aml_name_decl ("_HID" ,aml_string ("PNP0A06" ))); +aml_append (mem_ctrl_dev, +aml_name_decl ("_UID" ,aml_string ("Memory hotplug resources" ))); + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); ifctx =aml_if (aml_equal (slots_nr, zero)); {
hw/i386/acpi-dsdt-mem-hotplug.dsl +0 -7
@@ -14,10 +14,3 @@ */ External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD, MethodObj) - - Scope(\_SB.PCI0) { - Device(MEMORY_HOTPLUG_DEVICE) { - Name(_HID, "PNP0A06") - Name(_UID, "Memory hotplug resources") - } // Device() - } // Scope()
Signature · 1 line
MST
[Qemu-devel] [PULL 16/59] pc: acpi: memhp: move \_GPE._E03 into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
in addition remove no longer needed acpi-dsdt-mem-hotplug.dsl.
--- include/hw/acpi/memory_hotplug.h | 5 +++++ include/hw/acpi/pc-hotplug.h | 2 -- hw/i386/acpi-build.c | 6 ++++++ hw/i386/acpi-dsdt-mem-hotplug.dsl | 16 ---------------- hw/i386/acpi-dsdt.dsl | 5 ----- hw/i386/q35-acpi-dsdt.dsl | 5 ----- 6 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-mem-hotplug.dsl
include/hw/acpi/memory_hotplug.h +5 -0
@@ -47,6 +47,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." \ + stringify(MEMORY_HOTPLUG_DEVICE) "." stringify(MEMORY_SLOT_SCAN_METHOD) +void build_memory_hotplug_aml (Aml *ctx,uint32_t nr_mem,uint16_t io_base,uint16_t io_len);#endif
include/hw/acpi/pc-hotplug.h +0 -2
@@ -32,7 +32,6 @@#define ACPI_MEMORY_HOTPLUG_IO_LEN 24#define ACPI_MEMORY_HOTPLUG_BASE 0x0a00 -#define MEMORY_HOTPLUG_DEVICE MHPD#define MEMORY_SLOTS_NUMBER MDNR#define MEMORY_HOTPLUG_IO_REGION HPMR#define MEMORY_SLOT_ADDR_LOW MRBL
@@ -54,6 +53,5 @@#define MEMORY_SLOT_PROXIMITY_METHOD MPXM#define MEMORY_SLOT_EJECT_METHOD MEJ0#define MEMORY_SLOT_NOTIFY_METHOD MTFY -#define MEMORY_SLOT_SCAN_METHOD MSCN#endif
hw/i386/acpi-build.c +6 -0
@@ -1083,6 +1083,12 @@ build_ssdt(GArray *table_data, GArray *linker,build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len); + scope =aml_scope ("\\_GPE" ); + method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH )); +aml_append (scope, method); +aml_append (ssdt, scope); + bus =PC_MACHINE (machine)->bus;if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) {
hw/i386/acpi-dsdt-mem-hotplug.dsl deleted +0 -16
@@ -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)
hw/i386/acpi-dsdt.dsl +0 -5
@@ -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) {
hw/i386/q35-acpi-dsdt.dsl +0 -5
@@ -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) {
Signature · 1 line
MST
[Qemu-devel] [PULL 15/59] pc: acpi: factor out memhp code from build_ssdt() into separate function
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
before consolidating memhp code in memory_hotplug_acpi_table.c and for simplifying review, first factor out memhp code into new function build_memory_devices() in i386/acpi-build.c
----
PS:
no functional change, only code movement.
--- hw/i386/acpi-build.c | 239 +++++++++++++++++++++++++++------------------------ 1 file changed, 126 insertions(+), 113 deletions(-)
hw/i386/acpi-build.c +126 -113
@@ -931,6 +931,130 @@ static Aml *build_crs(PCIHostState *host,return crs; } +static void build_memory_devices (Aml *sb_scope,int nr_mem, +uint16_t io_base,uint16_t io_len) +{ +int i; +Aml *scope; +Aml *crs; +Aml *field; +Aml *dev; +Aml *method; +Aml *ifctx; + +/* build memory devices */ +assert (nr_mem <=ACPI_MAX_RAM_SLOTS ); + scope =aml_scope ("\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE )); +aml_append (scope, +aml_name_decl (stringify (MEMORY_SLOTS_NUMBER ),aml_int (nr_mem)) + ); + + crs =aml_resource_template (); +aml_append (crs, +aml_io (AML_DECODE16 , io_base, io_base,0 , io_len) + ); +aml_append (scope,aml_name_decl ("_CRS" , crs)); + +aml_append (scope,aml_operation_region ( +stringify (MEMORY_HOTPLUG_IO_REGION ),AML_SYSTEM_IO , + io_base, io_len) + ); + + field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_DWORD_ACC , +AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,/* read only */ +aml_named_field (stringify (MEMORY_SLOT_ADDR_LOW ),32 )); +aml_append (field,/* read only */ +aml_named_field (stringify (MEMORY_SLOT_ADDR_HIGH ),32 )); +aml_append (field,/* read only */ +aml_named_field (stringify (MEMORY_SLOT_SIZE_LOW ),32 )); +aml_append (field,/* read only */ +aml_named_field (stringify (MEMORY_SLOT_SIZE_HIGH ),32 )); +aml_append (field,/* read only */ +aml_named_field (stringify (MEMORY_SLOT_PROXIMITY ),32 )); +aml_append (scope, field); + + field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_BYTE_ACC , +AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_reserved_field (160 /* bits, Offset(20) */ )); +aml_append (field,/* 1 if enabled, read only */ +aml_named_field (stringify (MEMORY_SLOT_ENABLED ),1 )); +aml_append (field, +/*(read) 1 if has a insert event. (write) 1 to clear event */ +aml_named_field (stringify (MEMORY_SLOT_INSERT_EVENT ),1 )); +aml_append (field, +/* (read) 1 if has a remove event. (write) 1 to clear event */ +aml_named_field (stringify (MEMORY_SLOT_REMOVE_EVENT ),1 )); +aml_append (field, +/* initiates device eject, write only */ +aml_named_field (stringify (MEMORY_SLOT_EJECT ),1 )); +aml_append (scope, field); + + field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_DWORD_ACC , +AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,/* DIMM selector, write only */ +aml_named_field (stringify (MEMORY_SLOT_SLECTOR ),32 )); +aml_append (field,/* _OST event code, write only */ +aml_named_field (stringify (MEMORY_SLOT_OST_EVENT ),32 )); +aml_append (field,/* _OST status code, write only */ +aml_named_field (stringify (MEMORY_SLOT_OST_STATUS ),32 )); +aml_append (scope, field); +aml_append (sb_scope, scope); + +for (i =0 ; i < nr_mem; i++) { +#define BASEPATH "\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE) "." +const char *s; + + dev =aml_device ("MP%02X" , i); +aml_append (dev,aml_name_decl ("_UID" ,aml_string ("0x%02X" , i))); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C80" ))); + + method =aml_method ("_CRS" ,0 ,AML_NOTSERIALIZED ); + s = BASEPATH stringify(MEMORY_SLOT_CRS_METHOD); +aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); +aml_append (dev, method); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); + s = BASEPATH stringify(MEMORY_SLOT_STATUS_METHOD); +aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); +aml_append (dev, method); + + method =aml_method ("_PXM" ,0 ,AML_NOTSERIALIZED ); + s = BASEPATH stringify(MEMORY_SLOT_PROXIMITY_METHOD); +aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); +aml_append (dev, method); + + method =aml_method ("_OST" ,3 ,AML_NOTSERIALIZED ); + s = BASEPATH stringify(MEMORY_SLOT_OST_METHOD); +aml_append (method,aml_return (aml_call4 ( + s,aml_name ("_UID" ),aml_arg (0 ),aml_arg (1 ),aml_arg (2 ) + ))); +aml_append (dev, method); + + method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED ); + s = BASEPATH stringify(MEMORY_SLOT_EJECT_METHOD); +aml_append (method,aml_return (aml_call2 ( + s,aml_name ("_UID" ),aml_arg (0 )))); +aml_append (dev, method); + +aml_append (sb_scope, dev); + } + +/* build Method(MEMORY_SLOT_NOTIFY_METHOD, 2) { +* If (LEqual(Arg0, 0x00)) {Notify(MP00, Arg1)} ... } +*/ + method =aml_method (stringify (MEMORY_SLOT_NOTIFY_METHOD ),2 , +AML_NOTSERIALIZED ); +for (i =0 ; i < nr_mem; i++) { + ifctx =aml_if (aml_equal (aml_arg (0 ),aml_int (i))); +aml_append (ifctx, +aml_notify (aml_name ("MP%.02X" , i),aml_arg (1 )) + ); +aml_append (method, ifctx); + } +aml_append (sb_scope, method); +} + static void build_ssdt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -1233,119 +1357,8 @@ build_ssdt(GArray *table_data, GArray *linker, }aml_append (sb_scope,aml_name_decl ("CPON" , pkg)); -/* build memory devices */ -assert (nr_mem <=ACPI_MAX_RAM_SLOTS ); - scope =aml_scope ("\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE )); -aml_append (scope, -aml_name_decl (stringify (MEMORY_SLOTS_NUMBER ),aml_int (nr_mem)) - ); - - crs =aml_resource_template (); -aml_append (crs, -aml_io (AML_DECODE16 , pm->mem_hp_io_base, pm->mem_hp_io_base,0 , - pm->mem_hp_io_len) - ); -aml_append (scope,aml_name_decl ("_CRS" , crs)); - -aml_append (scope,aml_operation_region ( -stringify (MEMORY_HOTPLUG_IO_REGION ),AML_SYSTEM_IO , - pm->mem_hp_io_base, pm->mem_hp_io_len) - ); - - field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_DWORD_ACC , -AML_NOLOCK ,AML_PRESERVE ); -aml_append (field,/* read only */ -aml_named_field (stringify (MEMORY_SLOT_ADDR_LOW ),32 )); -aml_append (field,/* read only */ -aml_named_field (stringify (MEMORY_SLOT_ADDR_HIGH ),32 )); -aml_append (field,/* read only */ -aml_named_field (stringify (MEMORY_SLOT_SIZE_LOW ),32 )); -aml_append (field,/* read only */ -aml_named_field (stringify (MEMORY_SLOT_SIZE_HIGH ),32 )); -aml_append (field,/* read only */ -aml_named_field (stringify (MEMORY_SLOT_PROXIMITY ),32 )); -aml_append (scope, field); - - field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_BYTE_ACC , -AML_NOLOCK ,AML_WRITE_AS_ZEROS ); -aml_append (field,aml_reserved_field (160 /* bits, Offset(20) */ )); -aml_append (field,/* 1 if enabled, read only */ -aml_named_field (stringify (MEMORY_SLOT_ENABLED ),1 )); -aml_append (field, -/*(read) 1 if has a insert event. (write) 1 to clear event */ -aml_named_field (stringify (MEMORY_SLOT_INSERT_EVENT ),1 )); -aml_append (field, -/* (read) 1 if has a remove event. (write) 1 to clear event */ -aml_named_field (stringify (MEMORY_SLOT_REMOVE_EVENT ),1 )); -aml_append (field, -/* initiates device eject, write only */ -aml_named_field (stringify (MEMORY_SLOT_EJECT ),1 )); -aml_append (scope, field); - - field =aml_field (stringify (MEMORY_HOTPLUG_IO_REGION ),AML_DWORD_ACC , -AML_NOLOCK ,AML_PRESERVE ); -aml_append (field,/* DIMM selector, write only */ -aml_named_field (stringify (MEMORY_SLOT_SLECTOR ),32 )); -aml_append (field,/* _OST event code, write only */ -aml_named_field (stringify (MEMORY_SLOT_OST_EVENT ),32 )); -aml_append (field,/* _OST status code, write only */ -aml_named_field (stringify (MEMORY_SLOT_OST_STATUS ),32 )); -aml_append (scope, field); - -aml_append (sb_scope, scope); - -for (i =0 ; i < nr_mem; i++) { -#define BASEPATH "\\_SB.PCI0." stringify(MEMORY_HOTPLUG_DEVICE) "." -const char *s; - - dev =aml_device ("MP%02X" , i); -aml_append (dev,aml_name_decl ("_UID" ,aml_string ("0x%02X" , i))); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C80" ))); - - method =aml_method ("_CRS" ,0 ,AML_NOTSERIALIZED ); - s = BASEPATH stringify(MEMORY_SLOT_CRS_METHOD); -aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); -aml_append (dev, method); - - method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); - s = BASEPATH stringify(MEMORY_SLOT_STATUS_METHOD); -aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); -aml_append (dev, method); - - method =aml_method ("_PXM" ,0 ,AML_NOTSERIALIZED ); - s = BASEPATH stringify(MEMORY_SLOT_PROXIMITY_METHOD); -aml_append (method,aml_return (aml_call1 (s,aml_name ("_UID" )))); -aml_append (dev, method); - - method =aml_method ("_OST" ,3 ,AML_NOTSERIALIZED ); - s = BASEPATH stringify(MEMORY_SLOT_OST_METHOD); -aml_append (method,aml_return (aml_call4 ( - s,aml_name ("_UID" ),aml_arg (0 ),aml_arg (1 ),aml_arg (2 ) - ))); -aml_append (dev, method); - - method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED ); - s = BASEPATH stringify(MEMORY_SLOT_EJECT_METHOD); -aml_append (method,aml_return (aml_call2 ( - s,aml_name ("_UID" ),aml_arg (0 )))); -aml_append (dev, method); - -aml_append (sb_scope, dev); - } - -/* build Method(MEMORY_SLOT_NOTIFY_METHOD, 2) { -* If (LEqual(Arg0, 0x00)) {Notify(MP00, Arg1)} ... } -*/ - method =aml_method (stringify (MEMORY_SLOT_NOTIFY_METHOD ),2 , -AML_NOTSERIALIZED ); -for (i =0 ; i < nr_mem; i++) { - ifctx =aml_if (aml_equal (aml_arg (0 ),aml_int (i))); -aml_append (ifctx, -aml_notify (aml_name ("MP%.02X" , i),aml_arg (1 )) - ); -aml_append (method, ifctx); - } -aml_append (sb_scope, method); +build_memory_devices (sb_scope, nr_mem, pm->mem_hp_io_base, + pm->mem_hp_io_len); {Object *pci_host;
Signature · 1 line
MST
[Qemu-devel] [PULL 18/59] pc: acpi: drop unused CPU_STATUS_LEN from DSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 1 - 1 file changed, 1 deletion(-)
hw/i386/acpi-dsdt-cpu-hotplug.dsl +0 -1
@@ -53,7 +53,6 @@ Scope(\_SB) { Sleep(200) } -#define CPU_STATUS_LEN ACPI_GPE_PROC_LEN Method(PRSC, 0) { // Local5 = active cpu bitmap Store(PRS, Local5)
Signature · 1 line
MST
[Qemu-devel] [PULL 17/59] pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
most of MEMORY_foo defines are not shared with ASL anymore and are used only inside of memory_hotplug_acpi_table.c, so move them there and make them strings. As result we can replace stringify(MEMORY_foo) with just MEMORY_foo, which makes code a bit cleaner.
No AML change introduced by this patch.
--- include/hw/acpi/memory_hotplug.h | 6 ++--- include/hw/acpi/pc-hotplug.h | 42 ++++++++++++++--------------- hw/acpi/memory_hotplug_acpi_table.c | 53 +++++++++++++++++-------------------- hw/i386/acpi-build.c | 52 ++++++++++++++++++------------------ 4 files changed, 74 insertions(+), 79 deletions(-)
include/hw/acpi/memory_hotplug.h +3 -3
@@ -47,10 +47,10 @@ 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_DEVICE "MHPD" +#define MEMORY_SLOT_SCAN_METHOD "MSCN"#define MEMORY_HOTPLUG_HANDLER_PATH "\\_SB.PCI0." \ - stringify(MEMORY_HOTPLUG_DEVICE) "." stringify(MEMORY_SLOT_SCAN_METHOD) + MEMORY_HOTPLUG_DEVICE "." MEMORY_SLOT_SCAN_METHODvoid build_memory_hotplug_aml (Aml *ctx,uint32_t nr_mem,uint16_t io_base,uint16_t io_len);
include/hw/acpi/pc-hotplug.h +21 -21
47 lines not on this page · raw message
hw/acpi/memory_hotplug_acpi_table.c +24 -29
132 lines not on this page · raw message
hw/i386/acpi-build.c +26 -26
125 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 19/59] pc: acpi: cpuhp: move CPEJ() method to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/cpu_hotplug.h | 5 +++++ hw/acpi/cpu_hotplug_acpi_table.c | 28 ++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 3 ++- hw/acpi/Makefile.objs | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 4 ---- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 hw/acpi/cpu_hotplug_acpi_table.c
include/hw/acpi/cpu_hotplug.h +5 -0
@@ -14,6 +14,7 @@#include "hw/acpi/acpi.h" #include "hw/acpi/pc-hotplug.h" +#include "hw/acpi/aml-build.h" typedef struct AcpiCpuHotplug { MemoryRegion io;
@@ -25,4 +26,8 @@ void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,void acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner,AcpiCpuHotplug *gpe_cpu,uint16_t base); + +#define CPU_EJECT_METHOD "CPEJ" + +void build_cpu_hotplug_aml (Aml *ctx);#endif
hw/acpi/cpu_hotplug_acpi_table.c new file +28 -0
@@ -0,0 +1,28 @@ +/* +* 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/>. +*/ + +#include "hw/acpi/cpu_hotplug.h" + +void build_cpu_hotplug_aml (Aml *ctx) +{ +Aml *method; +Aml *sb_scope =aml_scope ("_SB" ); + + method =aml_method (CPU_EJECT_METHOD ,2 ,AML_NOTSERIALIZED ); +aml_append (method,aml_sleep (200 )); +aml_append (sb_scope, method); + +aml_append (ctx, sb_scope); +}
hw/i386/acpi-build.c +2 -1
@@ -1080,6 +1080,7 @@ build_ssdt(GArray *table_data, GArray *linker,/* Reserve space for header */ acpi_data_push (ssdt->buf,sizeof (AcpiTableHeader)); +build_cpu_hotplug_aml (ssdt);build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);
@@ -1326,7 +1327,7 @@ build_ssdt(GArray *table_data, GArray *linker, method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED );aml_append (method, -aml_return (aml_call2 ("CPEJ" ,aml_int (i),aml_arg (0 ))) +aml_return (aml_call2 (CPU_EJECT_METHOD ,aml_int (i),aml_arg (0 ))) );aml_append (dev, method);
hw/acpi/Makefile.objs +1 -1
@@ -1,6 +1,6 @@ common-obj-$(CONFIG_ACPI_X86) += core.o piix4.o pcihp.o common-obj-$(CONFIG_ACPI_X86_ICH) += ich9.o tco.o -common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu_hotplug.o +common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu_hotplug.o cpu_hotplug_acpi_table.o common-obj-$(CONFIG_ACPI_MEMORY_HOTPLUG) += memory_hotplug.o memory_hotplug_acpi_table.o common-obj-$(CONFIG_ACPI_NVDIMM) += nvdimm.o common-obj-$(CONFIG_ACPI) += acpi_interface.o
hw/i386/acpi-dsdt-cpu-hotplug.dsl +0 -4
@@ -48,10 +48,6 @@ Scope(\_SB) { Return (0x0) } } - Method(CPEJ, 2, NotSerialized) { - // _EJ0 method - eject callback - Sleep(200) - } Method(PRSC, 0) { // Local5 = active cpu bitmap
Signature · 1 line
MST
[Qemu-devel] [PULL 20/59] pc: acpi: cpuhp: move CPMA() method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/cpu_hotplug.h | 2 ++ hw/acpi/cpu_hotplug_acpi_table.c | 23 +++++++++++++++++++++++ hw/i386/acpi-build.c | 5 +++-- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 13 ------------- 4 files changed, 28 insertions(+), 15 deletions(-)
include/hw/acpi/cpu_hotplug.h +2 -0
@@ -28,6 +28,8 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, AcpiCpuHotplug *gpe_cpu, uint16_t base);#define CPU_EJECT_METHOD "CPEJ" +#define CPU_MAT_METHOD "CPMA" +#define CPU_ON_BITMAP "CPON"void build_cpu_hotplug_aml (Aml *ctx);#endif
hw/acpi/cpu_hotplug_acpi_table.c +23 -0
@@ -19,6 +19,29 @@ void build_cpu_hotplug_aml(Aml *ctx) {Aml *method;Aml *sb_scope =aml_scope ("_SB" ); +uint8_t madt_tmpl[8 ] = {0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0 ,0 ,0 }; +Aml *cpu_id =aml_arg (0 ); +Aml *cpu_on =aml_local (0 ); +Aml *madt =aml_local (1 ); +Aml *cpus_map =aml_name (CPU_ON_BITMAP ); + +/* +* _MAT method - creates an madt apic buffer +* cpu_id = Arg0 = Processor ID = Local APIC ID +* cpu_on = Local0 = CPON flag for this cpu +* madt = Local1 = Buffer (in madt apic form) to return +*/ + method =aml_method (CPU_MAT_METHOD ,1 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_store (aml_derefof (aml_index (cpus_map, cpu_id)), cpu_on)); +aml_append (method, +aml_store (aml_buffer (sizeof (madt_tmpl), madt_tmpl), madt)); +/* Update the processor id, lapic id, and enable/disable status */ +aml_append (method,aml_store (cpu_id,aml_index (madt,aml_int (2 )))); +aml_append (method,aml_store (cpu_id,aml_index (madt,aml_int (3 )))); +aml_append (method,aml_store (cpu_on,aml_index (madt,aml_int (4 )))); +aml_append (method,aml_return (madt)); +aml_append (sb_scope, method); method =aml_method (CPU_EJECT_METHOD ,2 ,AML_NOTSERIALIZED );aml_append (method,aml_sleep (200 ));
hw/i386/acpi-build.c +3 -2
@@ -1318,7 +1318,8 @@ build_ssdt(GArray *table_data, GArray *linker, dev =aml_processor (i,0 ,0 ,"CP%.02X" , i); method =aml_method ("_MAT" ,0 ,AML_NOTSERIALIZED ); -aml_append (method,aml_return (aml_call1 ("CPMA" ,aml_int (i)))); +aml_append (method, +aml_return (aml_call1 (CPU_MAT_METHOD ,aml_int (i))));aml_append (dev, method); method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED );
@@ -1362,7 +1363,7 @@ build_ssdt(GArray *table_data, GArray *linker,uint8_t b =test_bit (i, cpu->found_cpus) ?0x01 :0x00 ;aml_append (pkg,aml_int (b)); } -aml_append (sb_scope,aml_name_decl ("CPON" , pkg)); +aml_append (sb_scope,aml_name_decl (CPU_ON_BITMAP , pkg));build_memory_devices (sb_scope, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);
hw/i386/acpi-dsdt-cpu-hotplug.dsl +0 -13
@@ -24,19 +24,6 @@ Scope(\_SB) { External(PRS, FieldUnitObj) /* Methods called by run-time generated SSDT Processor objects */ - Method(CPMA, 1, NotSerialized) { - // _MAT method - create an madt apic buffer - // Arg0 = Processor ID = Local APIC ID - // Local0 = CPON flag for this cpu - Store(DerefOf(Index(CPON, Arg0)), Local0) - // Local1 = Buffer (in madt apic form) to return - Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1) - // Update the processor id, lapic id, and enable/disable status - Store(Arg0, Index(Local1, 2)) - Store(Arg0, Index(Local1, 3)) - Store(Local0, Index(Local1, 4)) - Return (Local1) - } Method(CPST, 1, NotSerialized) { // _STA method - return ON status of cpu // Arg0 = Processor ID = Local APIC ID
Signature · 1 line
MST
[Qemu-devel] [PULL 21/59] pc: acpi: cpuhp: move CPST() method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/cpu_hotplug.h | 1 + hw/acpi/cpu_hotplug_acpi_table.c | 22 ++++++++++++++++++++++ hw/i386/acpi-build.c | 3 ++- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 12 ------------ 4 files changed, 25 insertions(+), 13 deletions(-)
include/hw/acpi/cpu_hotplug.h +1 -0
@@ -30,6 +30,7 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,#define CPU_EJECT_METHOD "CPEJ"#define CPU_MAT_METHOD "CPMA"#define CPU_ON_BITMAP "CPON" +#define CPU_STATUS_METHOD "CPST"void build_cpu_hotplug_aml (Aml *ctx);#endif
hw/acpi/cpu_hotplug_acpi_table.c +22 -0
@@ -18,6 +18,8 @@void build_cpu_hotplug_aml (Aml *ctx) {Aml *method; +Aml *if_ctx; +Aml *else_ctx;Aml *sb_scope =aml_scope ("_SB" );uint8_t madt_tmpl[8 ] = {0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0 ,0 ,0 };Aml *cpu_id =aml_arg (0 );
@@ -43,6 +45,26 @@ void build_cpu_hotplug_aml(Aml *ctx)aml_append (method,aml_return (madt));aml_append (sb_scope, method); +/* +* _STA method - return ON status of cpu +* cpu_id = Arg0 = Processor ID = Local APIC ID +* cpu_on = Local0 = CPON flag for this cpu +*/ + method =aml_method (CPU_STATUS_METHOD ,1 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_store (aml_derefof (aml_index (cpus_map, cpu_id)), cpu_on)); + if_ctx =aml_if (cpu_on); + { +aml_append (if_ctx,aml_return (aml_int (0xF ))); + } +aml_append (method, if_ctx); + else_ctx =aml_else (); + { +aml_append (else_ctx,aml_return (aml_int (0x0 ))); + } +aml_append (method, else_ctx); +aml_append (sb_scope, method); + method =aml_method (CPU_EJECT_METHOD ,2 ,AML_NOTSERIALIZED );aml_append (method,aml_sleep (200 ));aml_append (sb_scope, method);
hw/i386/acpi-build.c +2 -1
@@ -1323,7 +1323,8 @@ build_ssdt(GArray *table_data, GArray *linker,aml_append (dev, method); method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); -aml_append (method,aml_return (aml_call1 ("CPST" ,aml_int (i)))); +aml_append (method, +aml_return (aml_call1 (CPU_STATUS_METHOD ,aml_int (i))));aml_append (dev, method); method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED );
hw/i386/acpi-dsdt-cpu-hotplug.dsl +0 -12
@@ -24,18 +24,6 @@ Scope(\_SB) { External(PRS, FieldUnitObj) /* Methods called by run-time generated SSDT Processor objects */ - Method(CPST, 1, NotSerialized) { - // _STA method - return ON status of cpu - // Arg0 = Processor ID = Local APIC ID - // Local0 = CPON flag for this cpu - Store(DerefOf(Index(CPON, Arg0)), Local0) - If (Local0) { - Return (0xF) - } Else { - Return (0x0) - } - } - Method(PRSC, 0) { // Local5 = active cpu bitmap Store(PRS, Local5)
Signature · 1 line
MST
[Qemu-devel] [PULL 22/59] pc: acpi: cpuhp: move PRSC() method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/aml-build.h | 2 ++ include/hw/acpi/cpu_hotplug.h | 1 + include/hw/acpi/pc-hotplug.h | 1 + hw/acpi/cpu_hotplug_acpi_table.c | 64 ++++++++++++++++++++++++++++++++++++++- hw/i386/acpi-build.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 39 +----------------------- hw/i386/acpi-dsdt.dsl | 2 +- hw/i386/q35-acpi-dsdt.dsl | 2 +- 8 files changed, 71 insertions(+), 42 deletions(-)
include/hw/acpi/aml-build.h +2 -0
@@ -16,6 +16,8 @@#define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp"#define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log" +#define AML_NOTIFY_METHOD "NTFY" + typedef enum { AML_NO_OPCODE = 0,/* has only data */ AML_OPCODE, /* has opcode optionally followed by data */
include/hw/acpi/cpu_hotplug.h +1 -0
@@ -31,6 +31,7 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,#define CPU_MAT_METHOD "CPMA"#define CPU_ON_BITMAP "CPON"#define CPU_STATUS_METHOD "CPST" +#define CPU_STATUS_MAP "PRS"void build_cpu_hotplug_aml (Aml *ctx);#endif
include/hw/acpi/pc-hotplug.h +1 -0
@@ -28,6 +28,7 @@#define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8#define PIIX4_CPU_HOTPLUG_IO_BASE 0xaf00#define CPU_HOTPLUG_RESOURCE_DEVICE PRES +#define CPU_SCAN_METHOD PRSC#define ACPI_MEMORY_HOTPLUG_IO_LEN 24#define ACPI_MEMORY_HOTPLUG_BASE 0x0a00
hw/acpi/cpu_hotplug_acpi_table.c +63 -1
81 lines not on this page · raw message
hw/i386/acpi-build.c +1 -1
@@ -1340,7 +1340,7 @@ build_ssdt(GArray *table_data, GArray *linker,* Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...} */ /* Arg0 = Processor ID = APIC ID */ - method =aml_method ("NTFY" ,2 ,AML_NOTSERIALIZED ); + method =aml_method (AML_NOTIFY_METHOD ,2 ,AML_NOTSERIALIZED );for (i =0 ; i < acpi_cpus; i++) { ifctx =aml_if (aml_equal (aml_arg (0 ),aml_int (i))); aml_append(ifctx,
hw/i386/acpi-dsdt-cpu-hotplug.dsl +1 -38
@@ -19,42 +19,5 @@ Scope(\_SB) { /* Objects filled in by run-time generated SSDT */ - External(NTFY, MethodObj) - External(CPON, PkgObj) - External(PRS, FieldUnitObj) - - /* Methods called by run-time generated SSDT Processor objects */ - Method(PRSC, 0) { - // Local5 = active cpu bitmap - Store(PRS, Local5) - // Local2 = last read byte from bitmap - Store(Zero, Local2) - // Local0 = Processor ID / APIC ID iterator - Store(Zero, Local0) - While (LLess(Local0, SizeOf(CPON))) { - // Local1 = CPON flag for this cpu - Store(DerefOf(Index(CPON, Local0)), Local1) - If (And(Local0, 0x07)) { - // Shift down previously read bitmap byte - ShiftRight(Local2, 1, Local2) - } Else { - // Read next byte from cpu bitmap - Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2) - } - // Local3 = active state for this cpu - Store(And(Local2, 1), Local3) - - If (LNotEqual(Local1, Local3)) { - // State change - update CPON with new state - Store(Local3, Index(CPON, Local0)) - // Do CPU notify - If (LEqual(Local3, 1)) { - NTFY(Local0, 1) - } Else { - NTFY(Local0, 3) - } - } - Increment(Local0) - } - } + External(CPU_SCAN_METHOD, MethodObj) }
hw/i386/acpi-dsdt.dsl +1 -1
@@ -268,7 +268,7 @@ DefinitionBlock ( } Method(_E02) { // CPU hotplug event - \_SB.PRSC() + \_SB.CPU_SCAN_METHOD() } Method(_L04) { }
hw/i386/q35-acpi-dsdt.dsl +1 -1
@@ -401,7 +401,7 @@ DefinitionBlock ( } Method(_E02) { // CPU hotplug event - \_SB.PRSC() + \_SB.CPU_SCAN_METHOD() } Method(_L04) { }
Signature · 1 line
MST
[Qemu-devel] [PULL 23/59] pc: acpi: cpuhp: move \_GPE._E02() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/acpi/cpu_hotplug.h | 1 + include/hw/acpi/pc-hotplug.h | 1 - hw/acpi/cpu_hotplug_acpi_table.c | 2 +- hw/i386/acpi-build.c | 12 +++++++++--- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 23 ----------------------- hw/i386/acpi-dsdt.dsl | 9 --------- hw/i386/q35-acpi-dsdt.dsl | 9 --------- 7 files changed, 11 insertions(+), 46 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-cpu-hotplug.dsl
include/hw/acpi/cpu_hotplug.h +1 -0
@@ -32,6 +32,7 @@ void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,#define CPU_ON_BITMAP "CPON"#define CPU_STATUS_METHOD "CPST"#define CPU_STATUS_MAP "PRS" +#define CPU_SCAN_METHOD "PRSC"void build_cpu_hotplug_aml (Aml *ctx);#endif
include/hw/acpi/pc-hotplug.h +0 -1
@@ -28,7 +28,6 @@#define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8#define PIIX4_CPU_HOTPLUG_IO_BASE 0xaf00#define CPU_HOTPLUG_RESOURCE_DEVICE PRES -#define CPU_SCAN_METHOD PRSC#define ACPI_MEMORY_HOTPLUG_IO_LEN 24#define ACPI_MEMORY_HOTPLUG_BASE 0x0a00
hw/acpi/cpu_hotplug_acpi_table.c +1 -1
@@ -71,7 +71,7 @@ void build_cpu_hotplug_aml(Aml *ctx)aml_append (method,aml_sleep (200 ));aml_append (sb_scope, method); - method =aml_method (stringify (CPU_SCAN_METHOD ),0 ,AML_NOTSERIALIZED ); + method =aml_method (CPU_SCAN_METHOD ,0 ,AML_NOTSERIALIZED ); {Aml *while_ctx, *if_ctx2, *else_ctx2;Aml *bus_check_evt =aml_int (1 );
hw/i386/acpi-build.c +9 -3
@@ -1085,9 +1085,15 @@ build_ssdt(GArray *table_data, GArray *linker, pm->mem_hp_io_len); scope =aml_scope ("\\_GPE" ); - method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED ); -aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH )); -aml_append (scope, method); + { + method =aml_method ("_E02" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_call0 ("\\_SB." CPU_SCAN_METHOD )); +aml_append (scope, method); + + method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH )); +aml_append (scope, method); + }aml_append (ssdt, scope); bus =PC_MACHINE (machine)->bus;
hw/i386/acpi-dsdt-cpu-hotplug.dsl deleted +0 -23
@@ -1,23 +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/>. - */ - -/**************************************************************** - * CPU hotplug - ****************************************************************/ - -Scope(\_SB) { - /* Objects filled in by run-time generated SSDT */ - External(CPU_SCAN_METHOD, MethodObj) -}
hw/i386/acpi-dsdt.dsl +0 -9
@@ -247,11 +247,6 @@ DefinitionBlock ( } } -#include "hw/acpi/pc-hotplug.h" -#define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE -#include "acpi-dsdt-cpu-hotplug.dsl" - - /**************************************************************** * General purpose events ****************************************************************/
@@ -266,10 +261,6 @@ DefinitionBlock ( \_SB.PCI0.PCNT() Release(\_SB.PCI0.BLCK) } - Method(_E02) { - // CPU hotplug event - \_SB.CPU_SCAN_METHOD() - } Method(_L04) { } Method(_L05) {
hw/i386/q35-acpi-dsdt.dsl +0 -9
@@ -384,11 +384,6 @@ DefinitionBlock ( define_gsi_link(GSIH, 0, 0x17) } -#include "hw/acpi/pc-hotplug.h" -#define CPU_STATUS_BASE ICH9_CPU_HOTPLUG_IO_BASE -#include "acpi-dsdt-cpu-hotplug.dsl" - - /**************************************************************** * General purpose events ****************************************************************/
@@ -399,10 +394,6 @@ DefinitionBlock ( } Method(_L01) { } - Method(_E02) { - // CPU hotplug event - \_SB.CPU_SCAN_METHOD() - } Method(_L04) { } Method(_L05) {
Signature · 1 line
MST
[Qemu-devel] [PULL 24/59] pc: acpi: factor out cpu hotplug code from build_ssdt() into separate function
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 174 ++++++++++++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 80 deletions(-)
hw/i386/acpi-build.c +94 -80
@@ -931,6 +931,98 @@ static Aml *build_crs(PCIHostState *host,return crs; } +static void build_processor_devices (Aml *sb_scope,unsigned acpi_cpus, +AcpiCpuInfo *cpu,AcpiPmInfo *pm) +{ +int i; +Aml *dev; +Aml *crs; +Aml *pkg; +Aml *field; +Aml *ifctx; +Aml *method; + +/* The current AML generator can cover the APIC ID range [0..255], +* inclusive, for VCPU hotplug. */ +QEMU_BUILD_BUG_ON (ACPI_CPU_HOTPLUG_ID_LIMIT >256 ); +g_assert (acpi_cpus <=ACPI_CPU_HOTPLUG_ID_LIMIT ); + +/* create PCI0.PRES device and its _CRS to reserve CPU hotplug MMIO */ + dev =aml_device ("PCI0." stringify(CPU_HOTPLUG_RESOURCE_DEVICE )); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A06" ))); +aml_append (dev, +aml_name_decl ("_UID" ,aml_string ("CPU Hotplug resources" )) + ); +/* device present, functioning, decoding, not shown in UI */ +aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xB ))); + crs =aml_resource_template (); +aml_append (crs, +aml_io (AML_DECODE16 , pm->cpu_hp_io_base, pm->cpu_hp_io_base,1 , + pm->cpu_hp_io_len) + ); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (sb_scope, dev); +/* declare CPU hotplug MMIO region and PRS field to access it */ +aml_append (sb_scope,aml_operation_region ( +"PRST" ,AML_SYSTEM_IO , pm->cpu_hp_io_base, pm->cpu_hp_io_len)); + field =aml_field ("PRST" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,aml_named_field ("PRS" ,256 )); +aml_append (sb_scope, field); + +/* build Processor object for each processor */ +for (i =0 ; i < acpi_cpus; i++) { + dev =aml_processor (i,0 ,0 ,"CP%.02X" , i); + + method =aml_method ("_MAT" ,0 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_return (aml_call1 (CPU_MAT_METHOD ,aml_int (i)))); +aml_append (dev, method); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_return (aml_call1 (CPU_STATUS_METHOD ,aml_int (i)))); +aml_append (dev, method); + + method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_return (aml_call2 (CPU_EJECT_METHOD ,aml_int (i),aml_arg (0 ))) + ); +aml_append (dev, method); + +aml_append (sb_scope, dev); + } + +/* build this code: +* Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...} +*/ +/* Arg0 = Processor ID = APIC ID */ + method =aml_method (AML_NOTIFY_METHOD ,2 ,AML_NOTSERIALIZED ); +for (i =0 ; i < acpi_cpus; i++) { + ifctx =aml_if (aml_equal (aml_arg (0 ),aml_int (i))); +aml_append (ifctx, +aml_notify (aml_name ("CP%.02X" , i),aml_arg (1 )) + ); +aml_append (method, ifctx); + } +aml_append (sb_scope, method); + +/* build "Name(CPON, Package() { One, One, ..., Zero, Zero, ... })" +* +* Note: The ability to create variable-sized packages was first +* introduced in ACPI 2.0. ACPI 1.0 only allowed fixed-size packages +* ith up to 255 elements. Windows guests up to win2k8 fail when +* VarPackageOp is used. +*/ + pkg = acpi_cpus <=255 ?aml_package (acpi_cpus) : +aml_varpackage (acpi_cpus); + +for (i =0 ; i < acpi_cpus; i++) { +uint8_t b =test_bit (i, cpu->found_cpus) ?0x01 :0x00 ; +aml_append (pkg,aml_int (b)); + } +aml_append (sb_scope,aml_name_decl (CPU_ON_BITMAP , pkg)); +} +static void build_memory_devices (Aml *sb_scope,int nr_mem,uint16_t io_base,uint16_t io_len) {
@@ -1062,8 +1154,7 @@ build_ssdt(GArray *table_data, GArray *linker, {MachineState *machine =MACHINE (qdev_get_machine ());uint32_t nr_mem = machine->ram_slots; -unsigned acpi_cpus = guest_info->apic_id_limit; -Aml *ssdt, *sb_scope, *scope, *pkg, *dev, *method, *crs, *field, *ifctx; +Aml *ssdt, *sb_scope, *scope, *pkg, *dev, *method, *crs, *field;PCIBus *bus =NULL ;GPtrArray *io_ranges =g_ptr_array_new_with_free_func (crs_range_free);GPtrArray *mem_ranges =g_ptr_array_new_with_free_func (crs_range_free);
@@ -1072,10 +1163,6 @@ build_ssdt(GArray *table_data, GArray *linker,int i; ssdt =init_aml_allocator (); -/* The current AML generator can cover the APIC ID range [0..255], -* inclusive, for VCPU hotplug. */ -QEMU_BUILD_BUG_ON (ACPI_CPU_HOTPLUG_ID_LIMIT >256 ); -g_assert (acpi_cpus <=ACPI_CPU_HOTPLUG_ID_LIMIT );/* Reserve space for header */ acpi_data_push (ssdt->buf,sizeof (AcpiTableHeader));
@@ -1297,80 +1384,7 @@ build_ssdt(GArray *table_data, GArray *linker, sb_scope =aml_scope ("\\_SB" ); { -/* create PCI0.PRES device and its _CRS to reserve CPU hotplug MMIO */ - dev =aml_device ("PCI0." stringify(CPU_HOTPLUG_RESOURCE_DEVICE )); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A06" ))); -aml_append (dev, -aml_name_decl ("_UID" ,aml_string ("CPU Hotplug resources" )) - ); -/* device present, functioning, decoding, not shown in UI */ -aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xB ))); - crs =aml_resource_template (); -aml_append (crs, -aml_io (AML_DECODE16 , pm->cpu_hp_io_base, pm->cpu_hp_io_base,1 , - pm->cpu_hp_io_len) - ); -aml_append (dev,aml_name_decl ("_CRS" , crs)); -aml_append (sb_scope, dev); -/* declare CPU hotplug MMIO region and PRS field to access it */ -aml_append (sb_scope,aml_operation_region ( -"PRST" ,AML_SYSTEM_IO , pm->cpu_hp_io_base, pm->cpu_hp_io_len)); - field =aml_field ("PRST" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); -aml_append (field,aml_named_field ("PRS" ,256 )); -aml_append (sb_scope, field); - -/* build Processor object for each processor */ -for (i =0 ; i < acpi_cpus; i++) { - dev =aml_processor (i,0 ,0 ,"CP%.02X" , i); - - method =aml_method ("_MAT" ,0 ,AML_NOTSERIALIZED ); -aml_append (method, -aml_return (aml_call1 (CPU_MAT_METHOD ,aml_int (i)))); -aml_append (dev, method); - - method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); -aml_append (method, -aml_return (aml_call1 (CPU_STATUS_METHOD ,aml_int (i)))); -aml_append (dev, method); - - method =aml_method ("_EJ0" ,1 ,AML_NOTSERIALIZED ); -aml_append (method, -aml_return (aml_call2 (CPU_EJECT_METHOD ,aml_int (i),aml_arg (0 ))) - ); -aml_append (dev, method); - -aml_append (sb_scope, dev); - } - -/* build this code: -* Method(NTFY, 2) {If (LEqual(Arg0, 0x00)) {Notify(CP00, Arg1)} ...} -*/ -/* Arg0 = Processor ID = APIC ID */ - method =aml_method (AML_NOTIFY_METHOD ,2 ,AML_NOTSERIALIZED ); -for (i =0 ; i < acpi_cpus; i++) { - ifctx =aml_if (aml_equal (aml_arg (0 ),aml_int (i))); -aml_append (ifctx, -aml_notify (aml_name ("CP%.02X" , i),aml_arg (1 )) - ); -aml_append (method, ifctx); - } -aml_append (sb_scope, method); - -/* build "Name(CPON, Package() { One, One, ..., Zero, Zero, ... })" -* -* Note: The ability to create variable-sized packages was first -* introduced in ACPI 2.0. ACPI 1.0 only allowed fixed-size packages -* ith up to 255 elements. Windows guests up to win2k8 fail when -* VarPackageOp is used. -*/ - pkg = acpi_cpus <=255 ?aml_package (acpi_cpus) : -aml_varpackage (acpi_cpus); - -for (i =0 ; i < acpi_cpus; i++) { -uint8_t b =test_bit (i, cpu->found_cpus) ?0x01 :0x00 ; -aml_append (pkg,aml_int (b)); - } -aml_append (sb_scope,aml_name_decl (CPU_ON_BITMAP , pkg)); +build_processor_devices (sb_scope, guest_info->apic_id_limit, cpu, pm);build_memory_devices (sb_scope, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);
Signature · 1 line
MST
[Qemu-devel] [PULL 25/59] pc: acpi: move HPET from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- include/hw/timer/hpet.h | 1 + hw/i386/acpi-build.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ hw/timer/hpet.c | 2 +- hw/i386/acpi-dsdt-hpet.dsl | 48 ----------------------------------------- hw/i386/acpi-dsdt.dsl | 2 -- hw/i386/q35-acpi-dsdt.dsl | 3 --- 6 files changed, 55 insertions(+), 54 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-hpet.dsl
include/hw/timer/hpet.h +1 -0
@@ -16,6 +16,7 @@#include "qom/object.h" #define HPET_BASE 0xfed00000 +#define HPET_LEN 0x400#define HPET_CLK_PERIOD 10/* 10 ns*/ #define FS_PER_NS 1000000/* 1000000 femtoseconds == 1 ns */
hw/i386/acpi-build.c +53 -0
71 lines not on this page · raw message
hw/timer/hpet.c +1 -1
@@ -713,7 +713,7 @@ static void hpet_init(Object *obj)HPETState *s =HPET (obj);/* HPET Area */ -memory_region_init_io (&s->iomem, obj, &hpet_ram_ops, s,"hpet" ,0x400 ); +memory_region_init_io (&s->iomem, obj, &hpet_ram_ops, s,"hpet" ,HPET_LEN );sysbus_init_mmio (sbd, &s->iomem); }
hw/i386/acpi-dsdt-hpet.dsl deleted +0 -48
48 lines not on this page · raw message
hw/i386/acpi-dsdt.dsl +0 -2
@@ -41,8 +41,6 @@ DefinitionBlock ( } } -#include "acpi-dsdt-hpet.dsl" - /**************************************************************** * PIIX4 PM ****************************************************************/
hw/i386/q35-acpi-dsdt.dsl +0 -3
@@ -115,9 +115,6 @@ DefinitionBlock ( } } -#include "acpi-dsdt-hpet.dsl" - - /**************************************************************** * LPC ISA bridge ****************************************************************/
Signature · 1 line
MST
[Qemu-devel] [PULL 26/59] pc: acpi: move DBUG() from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 36 ++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-dbug.dsl | 41 ----------------------------------------- hw/i386/acpi-dsdt.dsl | 2 -- hw/i386/q35-acpi-dsdt.dsl | 2 -- 4 files changed, 36 insertions(+), 45 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-dbug.dsl
hw/i386/acpi-build.c +36 -0
@@ -1199,6 +1199,41 @@ static void build_hpet_aml(Aml *table)aml_append (table, scope); } +static void build_dbg_aml (Aml *table) +{ +Aml *field; +Aml *method; +Aml *while_ctx; +Aml *scope =aml_scope ("\\" ); +Aml *buf =aml_local (0 ); +Aml *len =aml_local (1 ); +Aml *idx =aml_local (2 ); + +aml_append (scope, +aml_operation_region ("DBG" ,AML_SYSTEM_IO ,0x0402 ,0x01 )); + field =aml_field ("DBG" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,aml_named_field ("DBGB" ,8 )); +aml_append (scope, field); + + method =aml_method ("DBUG" ,1 ,AML_NOTSERIALIZED ); + +aml_append (method,aml_to_hexstring (aml_arg (0 ), buf)); +aml_append (method,aml_to_buffer (buf, buf)); +aml_append (method,aml_subtract (aml_sizeof (buf),aml_int (1 ), len)); +aml_append (method,aml_store (aml_int (0 ), idx)); + + while_ctx =aml_while (aml_lless (idx, len)); +aml_append (while_ctx, +aml_store (aml_derefof (aml_index (buf, idx)),aml_name ("DBGB" ))); +aml_append (while_ctx,aml_increment (idx)); +aml_append (method, while_ctx); + +aml_append (method,aml_store (aml_int (0x0A ),aml_name ("DBGB" ))); +aml_append (scope, method); + +aml_append (table, scope); +} + static void build_ssdt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -1219,6 +1254,7 @@ build_ssdt(GArray *table_data, GArray *linker,/* Reserve space for header */ acpi_data_push (ssdt->buf,sizeof (AcpiTableHeader)); +build_dbg_aml (ssdt);build_hpet_aml (ssdt);build_cpu_hotplug_aml (ssdt); build_memory_hotplug_aml(ssdt, nr_mem, pm->mem_hp_io_base,
hw/i386/acpi-dsdt-dbug.dsl deleted +0 -41
41 lines not on this page · raw message
hw/i386/acpi-dsdt.dsl +0 -2
@@ -29,8 +29,6 @@ DefinitionBlock ( ) { -#include "acpi-dsdt-dbug.dsl" - Scope(\_SB) { Device(PCI0) { Name(_HID, EisaId("PNP0A03"))
hw/i386/q35-acpi-dsdt.dsl +0 -2
@@ -35,8 +35,6 @@ DefinitionBlock ( ) { -#include "acpi-dsdt-dbug.dsl" - Scope(\_SB) { OperationRegion(PCST, SystemIO, 0xae00, 0x0c) OperationRegion(PCSB, SystemIO, 0xae0c, 0x01)
Signature · 1 line
MST
[Qemu-devel] [PULL 27/59] pc: acpi: move RTC device from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 26 ++++++++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 9 --------- 2 files changed, 26 insertions(+), 9 deletions(-)
hw/i386/acpi-build.c +26 -0
@@ -1199,6 +1199,31 @@ static void build_hpet_aml(Aml *table)aml_append (table, scope); } +static Aml *build_rtc_device_aml (void ) +{ +Aml *dev; +Aml *crs; + + dev =aml_device ("RTC" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0B00" ))); + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x0070 ,0x0070 ,0x10 ,0x02 )); +aml_append (crs,aml_irq_no_flags (8 )); +aml_append (crs,aml_io (AML_DECODE16 ,0x0072 ,0x0072 ,0x02 ,0x06 )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +return dev; +} + +static void build_isa_devices_aml (Aml *table) +{ +Aml *scope =aml_scope ("_SB.PCI0.ISA" ); + +aml_append (scope,build_rtc_device_aml ()); + +aml_append (table, scope); +} +static void build_dbg_aml (Aml *table) {Aml *field;
@@ -1256,6 +1281,7 @@ build_ssdt(GArray *table_data, GArray *linker,build_dbg_aml (ssdt);build_hpet_aml (ssdt); +build_isa_devices_aml (ssdt);build_cpu_hotplug_aml (ssdt);build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);
hw/i386/acpi-dsdt-isa.dsl +0 -9
@@ -16,15 +16,6 @@ /* Common legacy ISA style devices. */ Scope(\_SB.PCI0.ISA) { - Device(RTC) { - Name(_HID, EisaId("PNP0B00")) - Name(_CRS, ResourceTemplate() { - IO(Decode16, 0x0070, 0x0070, 0x10, 0x02) - IRQNoFlags() { 8 } - IO(Decode16, 0x0072, 0x0072, 0x02, 0x06) - }) - } - Device(KBD) { Name(_HID, EisaId("PNP0303")) Method(_STA, 0, NotSerialized) {
Signature · 1 line
MST
[Qemu-devel] [PULL 28/59] pc: acpi: move KBD device from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 22 ++++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 12 ------------ 2 files changed, 22 insertions(+), 12 deletions(-)
hw/i386/acpi-build.c +22 -0
@@ -1210,6 +1210,27 @@ static Aml *build_rtc_device_aml(void)aml_append (crs,aml_io (AML_DECODE16 ,0x0070 ,0x0070 ,0x10 ,0x02 ));aml_append (crs,aml_irq_no_flags (8 ));aml_append (crs,aml_io (AML_DECODE16 ,0x0072 ,0x0072 ,0x02 ,0x06 )); + +return dev; +} + +static Aml *build_kbd_device_aml (void ) +{ +Aml *dev; +Aml *crs; +Aml *method; + + dev =aml_device ("KBD" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0303" ))); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_int (0x0f ))); +aml_append (dev, method); + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x0060 ,0x0060 ,0x01 ,0x01 )); +aml_append (crs,aml_io (AML_DECODE16 ,0x0064 ,0x0064 ,0x01 ,0x01 )); +aml_append (crs,aml_irq_no_flags (1 ));aml_append (dev,aml_name_decl ("_CRS" , crs));return dev;
@@ -1220,6 +1241,7 @@ static void build_isa_devices_aml(Aml *table)Aml *scope =aml_scope ("_SB.PCI0.ISA" );aml_append (scope,build_rtc_device_aml ()); +aml_append (scope,build_kbd_device_aml ());aml_append (table, scope); }
hw/i386/acpi-dsdt-isa.dsl +0 -12
@@ -16,18 +16,6 @@ /* Common legacy ISA style devices. */ Scope(\_SB.PCI0.ISA) { - Device(KBD) { - Name(_HID, EisaId("PNP0303")) - Method(_STA, 0, NotSerialized) { - Return (0x0f) - } - Name(_CRS, ResourceTemplate() { - IO(Decode16, 0x0060, 0x0060, 0x01, 0x01) - IO(Decode16, 0x0064, 0x0064, 0x01, 0x01) - IRQNoFlags() { 1 } - }) - } - Device(MOU) { Name(_HID, EisaId("PNP0F13")) Method(_STA, 0, NotSerialized) {
Signature · 1 line
MST
[Qemu-devel] [PULL 29/59] pc: acpi: move MOU device from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 21 +++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 10 ---------- 2 files changed, 21 insertions(+), 10 deletions(-)
hw/i386/acpi-build.c +21 -0
@@ -1236,12 +1236,33 @@ static Aml *build_kbd_device_aml(void)return dev; } +static Aml *build_mouse_device_aml (void ) +{ +Aml *dev; +Aml *crs; +Aml *method; + + dev =aml_device ("MOU" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0F13" ))); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_int (0x0f ))); +aml_append (dev, method); + + crs =aml_resource_template (); +aml_append (crs,aml_irq_no_flags (12 )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +return dev; +} +static void build_isa_devices_aml (Aml *table) {Aml *scope =aml_scope ("_SB.PCI0.ISA" );aml_append (scope,build_rtc_device_aml ());aml_append (scope,build_kbd_device_aml ()); +aml_append (scope,build_mouse_device_aml ());aml_append (table, scope); }
hw/i386/acpi-dsdt-isa.dsl +0 -10
@@ -16,16 +16,6 @@ /* Common legacy ISA style devices. */ Scope(\_SB.PCI0.ISA) { - Device(MOU) { - Name(_HID, EisaId("PNP0F13")) - Method(_STA, 0, NotSerialized) { - Return (0x0f) - } - Name(_CRS, ResourceTemplate() { - IRQNoFlags() { 12 } - }) - } - Device(FDC0) { Name(_HID, EisaId("PNP0700")) Method(_STA, 0, NotSerialized) {
Signature · 1 line
MST
[Qemu-devel] [PULL 30/59] pc: acpi: move FDC0 device from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 40 ++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 18 ------------------ 2 files changed, 40 insertions(+), 18 deletions(-)
hw/i386/acpi-build.c +40 -0
@@ -1199,6 +1199,44 @@ static void build_hpet_aml(Aml *table)aml_append (table, scope); } +static Aml *build_fdc_device_aml (void ) +{ +Aml *dev; +Aml *crs; +Aml *method; +Aml *if_ctx; +Aml *else_ctx; +Aml *zero =aml_int (0 ); +Aml *is_present =aml_local (0 ); + + dev =aml_device ("FDC0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0700" ))); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_store (aml_name ("FDEN" ), is_present)); + if_ctx =aml_if (aml_equal (is_present, zero)); + { +aml_append (if_ctx,aml_return (aml_int (0x00 ))); + } +aml_append (method, if_ctx); + else_ctx =aml_else (); + { +aml_append (else_ctx,aml_return (aml_int (0x0f ))); + } +aml_append (method, else_ctx); +aml_append (dev, method); + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x03F2 ,0x03F2 ,0x00 ,0x04 )); +aml_append (crs,aml_io (AML_DECODE16 ,0x03F7 ,0x03F7 ,0x00 ,0x01 )); +aml_append (crs,aml_irq_no_flags (6 )); +aml_append (crs, +aml_dma (AML_COMPATIBILITY ,AML_NOTBUSMASTER ,AML_TRANSFER8 ,2 )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +return dev; +} +static Aml *build_rtc_device_aml (void ) {Aml *dev;
@@ -1210,6 +1248,7 @@ static Aml *build_rtc_device_aml(void)aml_append (crs,aml_io (AML_DECODE16 ,0x0070 ,0x0070 ,0x10 ,0x02 ));aml_append (crs,aml_irq_no_flags (8 ));aml_append (crs,aml_io (AML_DECODE16 ,0x0072 ,0x0072 ,0x02 ,0x06 )); +aml_append (dev,aml_name_decl ("_CRS" , crs));return dev; }
@@ -1263,6 +1302,7 @@ static void build_isa_devices_aml(Aml *table)aml_append (scope,build_rtc_device_aml ());aml_append (scope,build_kbd_device_aml ());aml_append (scope,build_mouse_device_aml ()); +aml_append (scope,build_fdc_device_aml ());aml_append (table, scope); }
hw/i386/acpi-dsdt-isa.dsl +0 -18
@@ -16,24 +16,6 @@ /* Common legacy ISA style devices. */ Scope(\_SB.PCI0.ISA) { - Device(FDC0) { - Name(_HID, EisaId("PNP0700")) - Method(_STA, 0, NotSerialized) { - Store(FDEN, Local0) - If (LEqual(Local0, 0)) { - Return (0x00) - } Else { - Return (0x0F) - } - } - Name(_CRS, ResourceTemplate() { - IO(Decode16, 0x03F2, 0x03F2, 0x00, 0x04) - IO(Decode16, 0x03F7, 0x03F7, 0x00, 0x01) - IRQNoFlags() { 6 } - DMA(Compatibility, NotBusMaster, Transfer8) { 2 } - }) - } - Device(LPT) { Name(_HID, EisaId("PNP0400")) Method(_STA, 0, NotSerialized) {
Signature · 1 line
MST
[Qemu-devel] [PULL 31/59] pc: acpi: move LPT device from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 36 ++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 16 ---------------- 2 files changed, 36 insertions(+), 16 deletions(-)
hw/i386/acpi-build.c +36 -0
@@ -1295,6 +1295,41 @@ static Aml *build_mouse_device_aml(void)return dev; } +static Aml *build_lpt_device_aml (void ) +{ +Aml *dev; +Aml *crs; +Aml *method; +Aml *if_ctx; +Aml *else_ctx; +Aml *zero =aml_int (0 ); +Aml *is_present =aml_local (0 ); + + dev =aml_device ("LPT" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0400" ))); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_store (aml_name ("LPEN" ), is_present)); + if_ctx =aml_if (aml_equal (is_present, zero)); + { +aml_append (if_ctx,aml_return (aml_int (0x00 ))); + } +aml_append (method, if_ctx); + else_ctx =aml_else (); + { +aml_append (else_ctx,aml_return (aml_int (0x0f ))); + } +aml_append (method, else_ctx); +aml_append (dev, method); + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x0378 ,0x0378 ,0x08 ,0x08 )); +aml_append (crs,aml_irq_no_flags (7 )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +return dev; +} +static void build_isa_devices_aml (Aml *table) {Aml *scope =aml_scope ("_SB.PCI0.ISA" );
@@ -1303,6 +1338,7 @@ static void build_isa_devices_aml(Aml *table)aml_append (scope,build_kbd_device_aml ());aml_append (scope,build_mouse_device_aml ());aml_append (scope,build_fdc_device_aml ()); +aml_append (scope,build_lpt_device_aml ());aml_append (table, scope); }
hw/i386/acpi-dsdt-isa.dsl +0 -16
@@ -16,22 +16,6 @@ /* Common legacy ISA style devices. */ Scope(\_SB.PCI0.ISA) { - Device(LPT) { - Name(_HID, EisaId("PNP0400")) - Method(_STA, 0, NotSerialized) { - Store(LPEN, Local0) - If (LEqual(Local0, 0)) { - Return (0x00) - } Else { - Return (0x0F) - } - } - Name(_CRS, ResourceTemplate() { - IO(Decode16, 0x0378, 0x0378, 0x08, 0x08) - IRQNoFlags() { 7 } - }) - } - Device(COM1) { Name(_HID, EisaId("PNP0501")) Name(_UID, 0x01)
Signature · 1 line
MST
[Qemu-devel] [PULL 32/59] pc: acpi: move COM devices from DSDT to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 48 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt-isa.dsl | 52 ----------------------------------------------- hw/i386/acpi-dsdt.dsl | 3 --- hw/i386/q35-acpi-dsdt.dsl | 3 --- 4 files changed, 48 insertions(+), 58 deletions(-) delete mode 100644 hw/i386/acpi-dsdt-isa.dsl
hw/i386/acpi-build.c +48 -0
@@ -1330,6 +1330,52 @@ static Aml *build_lpt_device_aml(void)return dev; } +static Aml *build_com_device_aml (uint8_t uid) +{ +Aml *dev; +Aml *crs; +Aml *method; +Aml *if_ctx; +Aml *else_ctx; +Aml *zero =aml_int (0 ); +Aml *is_present =aml_local (0 ); +const char *enabled_field ="CAEN" ; +uint8_t irq =4 ; +uint16_t io_port =0x03F8 ; + +assert (uid ==1 || uid ==2 ); +if (uid ==2 ) { + enabled_field ="CBEN" ; + irq =3 ; + io_port =0x02F8 ; + } + + dev =aml_device ("COM%d" , uid); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0501" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (uid))); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_store (aml_name ("%s" , enabled_field), is_present)); + if_ctx =aml_if (aml_equal (is_present, zero)); + { +aml_append (if_ctx,aml_return (aml_int (0x00 ))); + } +aml_append (method, if_ctx); + else_ctx =aml_else (); + { +aml_append (else_ctx,aml_return (aml_int (0x0f ))); + } +aml_append (method, else_ctx); +aml_append (dev, method); + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 , io_port, io_port,0x00 ,0x08 )); +aml_append (crs,aml_irq_no_flags (irq)); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +return dev; +} +static void build_isa_devices_aml (Aml *table) {Aml *scope =aml_scope ("_SB.PCI0.ISA" );
@@ -1339,6 +1385,8 @@ static void build_isa_devices_aml(Aml *table)aml_append (scope,build_mouse_device_aml ());aml_append (scope,build_fdc_device_aml ());aml_append (scope,build_lpt_device_aml ()); +aml_append (scope,build_com_device_aml (1 )); +aml_append (scope,build_com_device_aml (2 ));aml_append (table, scope); }
hw/i386/acpi-dsdt-isa.dsl deleted +0 -52
52 lines not on this page · raw message
hw/i386/acpi-dsdt.dsl +0 -3
@@ -80,9 +80,6 @@ DefinitionBlock ( } } -#include "acpi-dsdt-isa.dsl" - - /**************************************************************** * PCI hotplug ****************************************************************/
hw/i386/q35-acpi-dsdt.dsl +0 -3
@@ -146,9 +146,6 @@ DefinitionBlock ( } } -#include "acpi-dsdt-isa.dsl" - - /**************************************************************** * PCI IRQs ****************************************************************/
Signature · 1 line
MST
[Qemu-devel] [PULL 33/59] pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
and also move PRQx fields declaration as it can't be split out into separate patch since fields use PCI0.ISA.P40C operation region and OperationRegion must be declared in the same table as a Field that uses it. If this condition is not statisfied Windows will BSOD ans IASL (make check) will error out as well.
For the same reason pm is moved together with isa-bridge as the later refernces P13C OperationRegion from pm device.
--- include/hw/acpi/aml-build.h | 1 + hw/i386/acpi-build.c | 77 +++++++++++++++++++++++++++++++++++++++++++-- hw/i386/acpi-dsdt.dsl | 52 +++--------------------------- 3 files changed, 81 insertions(+), 49 deletions(-)
include/hw/acpi/aml-build.h +1 -0
@@ -82,6 +82,7 @@ typedef enum {typedef enum {AML_SYSTEM_MEMORY =0X00 ,AML_SYSTEM_IO =0X01 , +AML_PCI_CONFIG =0X02 , }AmlRegionSpace ; typedef enum {
hw/i386/acpi-build.c +75 -2
105 lines not on this page · raw message
hw/i386/acpi-dsdt.dsl +5 -47
64 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 34/59] pc: acpi: move remaining GPE handlers into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 30 +++++++++++++++++++++++++++++- hw/i386/acpi-dsdt.dsl | 40 ---------------------------------------- hw/i386/q35-acpi-dsdt.dsl | 36 ------------------------------------ 3 files changed, 29 insertions(+), 77 deletions(-)
hw/i386/acpi-build.c +29 -1
@@ -1526,8 +1526,23 @@ build_ssdt(GArray *table_data, GArray *linker,build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len); - scope =aml_scope ("\\_GPE" ); + scope =aml_scope ("_GPE" ); { +aml_append (scope,aml_name_decl ("_HID" ,aml_string ("ACPI0006" ))); + +aml_append (scope,aml_method ("_L00" ,0 ,AML_NOTSERIALIZED )); + +if (misc->is_piix4) { + method =aml_method ("_E01" ,0 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_acquire (aml_name ("\\_SB.PCI0.BLCK" ),0xFFFF )); +aml_append (method,aml_call0 ("\\_SB.PCI0.PCNT" )); +aml_append (method,aml_release (aml_name ("\\_SB.PCI0.BLCK" ))); +aml_append (scope, method); + }else { +aml_append (scope,aml_method ("_L01" ,0 ,AML_NOTSERIALIZED )); + } + method =aml_method ("_E02" ,0 ,AML_NOTSERIALIZED );aml_append (method,aml_call0 ("\\_SB." CPU_SCAN_METHOD ));aml_append (scope, method);
@@ -1535,6 +1550,19 @@ build_ssdt(GArray *table_data, GArray *linker, method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED );aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH ));aml_append (scope, method); + +aml_append (scope,aml_method ("_L04" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L05" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L06" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L07" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L08" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L09" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0A" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0B" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0C" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0D" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0E" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0F" ,0 ,AML_NOTSERIALIZED )); }aml_append (ssdt, scope);
hw/i386/acpi-dsdt.dsl +0 -40
@@ -197,44 +197,4 @@ DefinitionBlock ( Method(_SRS, 1, NotSerialized) { } } } - -/**************************************************************** - * General purpose events - ****************************************************************/ - Scope(\_GPE) { - Name(_HID, "ACPI0006") - - Method(_L00) { - } - Method(_E01) { - // PCI hotplug event - Acquire(\_SB.PCI0.BLCK, 0xFFFF) - \_SB.PCI0.PCNT() - Release(\_SB.PCI0.BLCK) - } - Method(_L04) { - } - Method(_L05) { - } - Method(_L06) { - } - Method(_L07) { - } - Method(_L08) { - } - Method(_L09) { - } - Method(_L0A) { - } - Method(_L0B) { - } - Method(_L0C) { - } - Method(_L0D) { - } - Method(_L0E) { - } - Method(_L0F) { - } - } }
hw/i386/q35-acpi-dsdt.dsl +0 -36
@@ -375,40 +375,4 @@ DefinitionBlock ( define_gsi_link(GSIG, 0, 0x16) define_gsi_link(GSIH, 0, 0x17) } - -/**************************************************************** - * General purpose events - ****************************************************************/ - Scope(\_GPE) { - Name(_HID, "ACPI0006") - - Method(_L00) { - } - Method(_L01) { - } - Method(_L04) { - } - Method(_L05) { - } - Method(_L06) { - } - Method(_L07) { - } - Method(_L08) { - } - Method(_L09) { - } - Method(_L0A) { - } - Method(_L0B) { - } - Method(_L0C) { - } - Method(_L0D) { - } - Method(_L0E) { - } - Method(_L0F) { - } - } }
Signature · 1 line
MST
[Qemu-devel] [PULL 35/59] pc: acpi: pci: move link devices into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt.dsl | 49 ++++---------------------------- 2 files changed, 82 insertions(+), 44 deletions(-)
hw/i386/acpi-build.c +77 -0
@@ -1429,9 +1429,49 @@ static void build_dbg_aml(Aml *table)aml_append (table, scope); } +static Aml *build_link_dev (const char *name,uint8_t uid,Aml *reg) +{ +Aml *dev; +Aml *crs; +Aml *method; +uint32_t irqs[] = {5 ,10 ,11 }; + + dev =aml_device ("%s" , name); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C0F" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (uid))); + + crs =aml_resource_template (); +aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL ,AML_ACTIVE_HIGH , +AML_SHARED , irqs,ARRAY_SIZE (irqs))); +aml_append (dev,aml_name_decl ("_PRS" , crs)); + + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_call1 ("IQST" , reg))); +aml_append (dev, method); + + method =aml_method ("_DIS" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_or (reg,aml_int (0x80 ), reg)); +aml_append (dev, method); + + method =aml_method ("_CRS" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_call1 ("IQCR" , reg))); +aml_append (dev, method); + + method =aml_method ("_SRS" ,1 ,AML_NOTSERIALIZED ); +aml_append (method,aml_create_dword_field (aml_arg (0 ),aml_int (5 ),"PRRI" )); +aml_append (method,aml_store (aml_name ("PRRI" ), reg)); +aml_append (dev, method); + +return dev; + } +static void build_piix4_pci0_int (Aml *table) { +Aml *dev; +Aml *crs;Aml *field; +Aml *method; +uint32_t irqs;Aml *sb_scope =aml_scope ("_SB" ); field =aml_field ("PCI0.ISA.P40C" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE );
@@ -1441,6 +1481,43 @@ static void build_piix4_pci0_int(Aml *table)aml_append (field,aml_named_field ("PRQ3" ,8 ));aml_append (sb_scope, field); +aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQ0" ))); +aml_append (sb_scope,build_link_dev ("LNKB" ,1 ,aml_name ("PRQ1" ))); +aml_append (sb_scope,build_link_dev ("LNKC" ,2 ,aml_name ("PRQ2" ))); +aml_append (sb_scope,build_link_dev ("LNKD" ,3 ,aml_name ("PRQ3" ))); + + dev =aml_device ("LNKS" ); + { +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C0F" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (4 ))); + + crs =aml_resource_template (); + irqs =9 ; +aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL , +AML_ACTIVE_HIGH ,AML_SHARED , + &irqs,1 )); +aml_append (dev,aml_name_decl ("_PRS" , crs)); + +/* The SCI cannot be disabled and is always attached to GSI 9, +* so these are no-ops. We only need this link to override the +* polarity to active high and match the content of the MADT. +*/ + method =aml_method ("_STA" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_int (0x0b ))); +aml_append (dev, method); + + method =aml_method ("_DIS" ,0 ,AML_NOTSERIALIZED ); +aml_append (dev, method); + + method =aml_method ("_CRS" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_return (aml_name ("_PRS" ))); +aml_append (dev, method); + + method =aml_method ("_SRS" ,1 ,AML_NOTSERIALIZED ); +aml_append (dev, method); + } +aml_append (sb_scope, dev); +aml_append (table, sb_scope); }
hw/i386/acpi-dsdt.dsl +5 -44
54 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 36/59] pc: acpi: piix4: move IQCR() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 20 ++++++++++++++++++++ hw/i386/acpi-dsdt.dsl | 11 ----------- 2 files changed, 20 insertions(+), 11 deletions(-)
hw/i386/acpi-build.c +20 -0
@@ -1470,6 +1470,7 @@ static void build_piix4_pci0_int(Aml *table)Aml *dev;Aml *crs;Aml *field; +Aml *if_ctx;Aml *method;uint32_t irqs;Aml *sb_scope =aml_scope ("_SB" );
@@ -1481,6 +1482,25 @@ static void build_piix4_pci0_int(Aml *table)aml_append (field,aml_named_field ("PRQ3" ,8 ));aml_append (sb_scope, field); +/* _CRS method - get current settings */ + method =aml_method ("IQCR" ,1 ,AML_SERIALIZED ); + { + crs =aml_resource_template (); + irqs =0 ; +aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL , +AML_ACTIVE_HIGH ,AML_SHARED , &irqs,1 )); +aml_append (method,aml_name_decl ("PRR0" , crs)); + +aml_append (method, +aml_create_dword_field (aml_name ("PRR0" ),aml_int (5 ),"PRRI" )); + + if_ctx =aml_if (aml_lless (aml_arg (0 ),aml_int (0x80 ))); +aml_append (if_ctx,aml_store (aml_arg (0 ),aml_name ("PRRI" ))); +aml_append (method, if_ctx); +aml_append (method,aml_return (aml_name ("PRR0" ))); + } +aml_append (sb_scope, method); +aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQ0" )));aml_append (sb_scope,build_link_dev ("LNKB" ,1 ,aml_name ("PRQ1" )));aml_append (sb_scope,build_link_dev ("LNKC" ,2 ,aml_name ("PRQ2" )));
hw/i386/acpi-dsdt.dsl +0 -11
@@ -140,17 +140,6 @@ DefinitionBlock ( } Return (0x0B) } - Method(IQCR, 1, Serialized) { - // _CRS method - get current settings - Name(PRR0, ResourceTemplate() { - Interrupt(, Level, ActiveHigh, Shared) { 0 } - }) - CreateDWordField(PRR0, 0x05, PRRI) - If (LLess(Arg0, 0x80)) { - Store(Arg0, PRRI) - } - Return (PRR0) - } External(LNKA, DeviceObj) External(LNKB, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 37/59] pc: acpi: piix4: move IQST() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 10 ++++++++++ hw/i386/acpi-dsdt.dsl | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-)
hw/i386/acpi-build.c +10 -0
@@ -1482,6 +1482,16 @@ static void build_piix4_pci0_int(Aml *table)aml_append (field,aml_named_field ("PRQ3" ,8 ));aml_append (sb_scope, field); +/* _STA method - get status */ + method =aml_method ("IQST" ,1 ,AML_NOTSERIALIZED ); + { + if_ctx =aml_if (aml_and (aml_int (0x80 ),aml_arg (0 ),NULL )); +aml_append (if_ctx,aml_return (aml_int (0x09 ))); +aml_append (method, if_ctx); +aml_append (method,aml_return (aml_int (0x0B ))); + } +aml_append (sb_scope, method); +/* _CRS method - get current settings */ method =aml_method ("IQCR" ,1 ,AML_SERIALIZED ); {
hw/i386/acpi-dsdt.dsl +0 -9
@@ -132,15 +132,6 @@ DefinitionBlock ( External(PRQ1, FieldUnitObj) External(PRQ2, FieldUnitObj) External(PRQ3, FieldUnitObj) - - Method(IQST, 1, NotSerialized) { - // _STA method - get status - If (And(0x80, Arg0)) { - Return (0x09) - } - Return (0x0B) - } - External(LNKA, DeviceObj) External(LNKB, DeviceObj) External(LNKC, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 38/59] pc: acpi: piix4: move PCI0._PRT() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
PCI routing table for expander buses is build with help of build_prt() using AML API. And it's almost the same as PRT for PCI0 bus except of power-management device. So make existing build_prt() build PRT table for PCI0 bus as well.
--- hw/i386/acpi-build.c | 55 +++++++++++++++++++++++++++++++++++++++------- hw/i386/acpi-dsdt.dsl | 60 --------------------------------------------------- 2 files changed, 47 insertions(+), 68 deletions(-)
hw/i386/acpi-build.c +47 -8
@@ -623,6 +623,23 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,qobject_decref (bsel); } +/** +* build_prt_entry: +* @link_name: link name for PCI route entry +* +* build AML package containing a PCI route entry for @link_name +*/ +static Aml *build_prt_entry (const char *link_name) +{ +Aml *a_zero =aml_int (0 ); +Aml *pkg =aml_package (4 ); +aml_append (pkg, a_zero); +aml_append (pkg, a_zero); +aml_append (pkg,aml_name ("%s" , link_name)); +aml_append (pkg, a_zero); +return pkg; +} +/* * initialize_route - Initialize the interrupt routing rule * through a specific LINK:
@@ -633,12 +650,8 @@ static Aml *initialize_route(Aml *route, const char *link_name, Aml *lnk_idx, int idx) {Aml *if_ctx =aml_if (aml_equal (lnk_idx,aml_int (idx))); -Aml *pkg =aml_package (4 ); +Aml *pkg =build_prt_entry (link_name); -aml_append (pkg,aml_int (0 )); -aml_append (pkg,aml_int (0 )); -aml_append (pkg,aml_name ("%s" , link_name)); -aml_append (pkg,aml_int (0 ));aml_append (if_ctx,aml_store (pkg, route));return if_ctx;
@@ -654,7 +667,7 @@ static Aml *initialize_route(Aml *route, const char *link_name,* The hash function is (slot + pin) & 3 -> "LNK[D|A|B|C]". * */ -static Aml *build_prt (void ) +static Aml *build_prt (bool is_pci0_prt) {Aml *method, *while_ctx, *pin, *res;
@@ -681,7 +694,29 @@ static Aml *build_prt(void)/* route[2] = "LNK[D|A|B|C]", selection based on pin % 3 */ aml_append (while_ctx,initialize_route (route,"LNKD" , lnk_idx,0 )); -aml_append (while_ctx,initialize_route (route,"LNKA" , lnk_idx,1 )); +if (is_pci0_prt) { +Aml *if_device_1, *if_pin_4, *else_pin_4; + +/* device 1 is the power-management device, needs SCI */ + if_device_1 =aml_if (aml_equal (lnk_idx,aml_int (1 ))); + { + if_pin_4 =aml_if (aml_equal (pin,aml_int (4 ))); + { +aml_append (if_pin_4, +aml_store (build_prt_entry ("LNKS" ), route)); + } +aml_append (if_device_1, if_pin_4); + else_pin_4 =aml_else (); + { +aml_append (else_pin_4, +aml_store (build_prt_entry ("LNKA" ), route)); + } +aml_append (if_device_1, else_pin_4); + } +aml_append (while_ctx, if_device_1); + }else { +aml_append (while_ctx,initialize_route (route,"LNKA" , lnk_idx,1 )); + }aml_append (while_ctx,initialize_route (route,"LNKB" , lnk_idx,2 ));aml_append (while_ctx,initialize_route (route,"LNKC" , lnk_idx,3 ));
@@ -1474,6 +1509,10 @@ static void build_piix4_pci0_int(Aml *table)Aml *method;uint32_t irqs;Aml *sb_scope =aml_scope ("_SB" ); +Aml *pci0_scope =aml_scope ("PCI0" ); + +aml_append (pci0_scope,build_prt (true)); +aml_append (sb_scope, pci0_scope); field =aml_field ("PCI0.ISA.P40C" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE );aml_append (field,aml_named_field ("PRQ0" ,8 ));
@@ -1698,7 +1737,7 @@ build_ssdt(GArray *table_data, GArray *linker,aml_append (dev,aml_name_decl ("_PXM" ,aml_int (numa_node))); } -aml_append (dev,build_prt ()); +aml_append (dev,build_prt (false)); crs =build_crs (PCI_HOST_BRIDGE (BUS (bus)->parent), io_ranges, mem_ranges);aml_append (dev,aml_name_decl ("_CRS" , crs));
hw/i386/acpi-dsdt.dsl +0 -60
64 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 39/59] pc: acpi: piix4: move remaining PCI hotplug bits into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 43 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-dsdt.dsl | 40 ---------------------------------------- 2 files changed, 43 insertions(+), 40 deletions(-)
hw/i386/acpi-build.c +43 -0
@@ -1637,6 +1637,48 @@ static void build_piix4_isa_bridge(Aml *table)aml_append (table, scope); } +static void build_piix4_pci_hotplug (Aml *table) +{ +Aml *scope; +Aml *field; +Aml *method; + + scope =aml_scope ("_SB.PCI0" ); + +aml_append (scope, +aml_operation_region ("PCST" ,AML_SYSTEM_IO ,0xae00 ,0x08 )); + field =aml_field ("PCST" ,AML_DWORD_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("PCIU" ,32 )); +aml_append (field,aml_named_field ("PCID" ,32 )); +aml_append (scope, field); + +aml_append (scope, +aml_operation_region ("SEJ" ,AML_SYSTEM_IO ,0xae08 ,0x04 )); + field =aml_field ("SEJ" ,AML_DWORD_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("B0EJ" ,32 )); +aml_append (scope, field); + +aml_append (scope, +aml_operation_region ("BNMR" ,AML_SYSTEM_IO ,0xae10 ,0x04 )); + field =aml_field ("BNMR" ,AML_DWORD_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("BNUM" ,32 )); +aml_append (scope, field); + +aml_append (scope,aml_mutex ("BLCK" ,0 )); + + method =aml_method ("PCEJ" ,2 ,AML_NOTSERIALIZED ); +aml_append (method,aml_acquire (aml_name ("BLCK" ),0xFFFF )); +aml_append (method,aml_store (aml_arg (0 ),aml_name ("BNUM" ))); +aml_append (method, +aml_store (aml_shiftleft (aml_int (1 ),aml_arg (1 )),aml_name ("B0EJ" ))); +aml_append (method,aml_release (aml_name ("BLCK" ))); +aml_append (method,aml_return (aml_int (0 ))); +aml_append (scope, method); + +aml_append (table, scope); +} + + static void build_ssdt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -1663,6 +1705,7 @@ build_ssdt(GArray *table_data, GArray *linker,build_piix4_pm (ssdt);build_piix4_isa_bridge (ssdt);build_isa_devices_aml (ssdt); +build_piix4_pci_hotplug (ssdt);build_piix4_pci0_int (ssdt); }else {build_hpet_aml (ssdt);
hw/i386/acpi-dsdt.dsl +0 -40
@@ -38,44 +38,4 @@ DefinitionBlock ( // External(PX13, DeviceObj) } } - -/**************************************************************** - * PCI hotplug - ****************************************************************/ - - Scope(\_SB.PCI0) { - OperationRegion(PCST, SystemIO, 0xae00, 0x08) - Field(PCST, DWordAcc, NoLock, WriteAsZeros) { - PCIU, 32, - PCID, 32, - } - - OperationRegion(SEJ, SystemIO, 0xae08, 0x04) - Field(SEJ, DWordAcc, NoLock, WriteAsZeros) { - B0EJ, 32, - } - - OperationRegion(BNMR, SystemIO, 0xae10, 0x04) - Field(BNMR, DWordAcc, NoLock, WriteAsZeros) { - BNUM, 32, - } - - /* Lock to protect access to fields above. */ - Mutex(BLCK, 0) - - /* Methods called by bulk generated PCI devices below */ - - /* Methods called by hotplug devices */ - Method(PCEJ, 2, NotSerialized) { - // _EJ0 method - eject callback - Acquire(BLCK, 0xFFFF) - Store(Arg0, BNUM) - Store(ShiftLeft(1, Arg1), B0EJ) - Release(BLCK) - Return (0x0) - } - - /* Hotplug notification method supplied by SSDT */ - External(\_SB.PCI0.PCNT, MethodObj) - } }
Signature · 1 line
MST
[Qemu-devel] [PULL 40/59] pc: acpi: piix4: acpi move PCI0 device to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
leave Scope(\_SB) definition in DSDT so that iasl would be able to compile DSDT since we are still need definition block for table.
After Q35 ASL is converted, DSDT templates will be completly replaced by AML API generated tables.
--- hw/i386/acpi-build.c | 8 ++++++++ hw/i386/acpi-dsdt.dsl | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-)
hw/i386/acpi-build.c +8 -0
@@ -1701,6 +1701,14 @@ build_ssdt(GArray *table_data, GArray *linker,build_dbg_aml (ssdt);if (misc->is_piix4) { + sb_scope =aml_scope ("_SB" ); + dev =aml_device ("PCI0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); +aml_append (sb_scope, dev); +aml_append (ssdt, sb_scope); +build_hpet_aml (ssdt);build_piix4_pm (ssdt);build_piix4_isa_bridge (ssdt);
hw/i386/acpi-dsdt.dsl +0 -8
@@ -28,14 +28,6 @@ DefinitionBlock ( 0x1 // OEM Revision ) { - Scope(\_SB) { - Device(PCI0) { - Name(_HID, EisaId("PNP0A03")) - Name(_ADR, 0x00) - Name(_UID, 1) -//#define PX13 S0B_ -// External(PX13, DeviceObj) - } } }
Signature · 1 line
MST
[Qemu-devel] [PULL 41/59] pc: acpi: q35: move GSI links to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ hw/i386/q35-acpi-dsdt.dsl | 34 ++++++++-------------------------- 2 files changed, 55 insertions(+), 26 deletions(-)
hw/i386/acpi-build.c +47 -0
@@ -1500,6 +1500,31 @@ static Aml *build_link_dev(const char *name, uint8_t uid, Aml *reg)return dev; } +static Aml *build_gsi_link_dev (const char *name,uint8_t uid,uint8_t gsi) +{ +Aml *dev; +Aml *crs; +Aml *method; +uint32_t irqs; + + dev =aml_device ("%s" , name); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C0F" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (uid))); + + crs =aml_resource_template (); + irqs = gsi; +aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL ,AML_ACTIVE_HIGH , +AML_SHARED , &irqs,1 )); +aml_append (dev,aml_name_decl ("_PRS" , crs)); + +aml_append (dev,aml_name_decl ("_CRS" , crs)); + + method =aml_method ("_SRS" ,1 ,AML_NOTSERIALIZED ); +aml_append (dev, method); + +return dev; +} +static void build_piix4_pci0_int (Aml *table) {Aml *dev;
@@ -1590,6 +1615,26 @@ static void build_piix4_pci0_int(Aml *table)aml_append (table, sb_scope); } +static void build_q35_pci0_int (Aml *table) +{ +Aml *sb_scope =aml_scope ("_SB" ); + +/* +* TODO: UID probably shouldn't be the same for GSIx devices +* but that's how it was in original ASL so keep it for now +*/ +aml_append (sb_scope,build_gsi_link_dev ("GSIA" ,0 ,0x10 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIB" ,0 ,0x11 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIC" ,0 ,0x12 )); +aml_append (sb_scope,build_gsi_link_dev ("GSID" ,0 ,0x13 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIE" ,0 ,0x14 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIF" ,0 ,0x15 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIG" ,0 ,0x16 )); +aml_append (sb_scope,build_gsi_link_dev ("GSIH" ,0 ,0x17 )); + +aml_append (table, sb_scope); +} +static void build_piix4_pm (Aml *table) {Aml *dev;
@@ -1718,7 +1763,9 @@ build_ssdt(GArray *table_data, GArray *linker, }else {build_hpet_aml (ssdt);build_isa_devices_aml (ssdt); +build_q35_pci0_int (ssdt); } +build_cpu_hotplug_aml (ssdt);build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len);
hw/i386/q35-acpi-dsdt.dsl +8 -26
@@ -348,31 +348,13 @@ DefinitionBlock ( define_link(LNKG, 6, PRQG) define_link(LNKH, 7, PRQH) -#define define_gsi_link(link, uid, gsi) \ - Device(link) { \ - Name(_HID, EISAID("PNP0C0F")) \ - Name(_UID, uid) \ - Name(_PRS, ResourceTemplate() { \ - Interrupt(, Level, ActiveHigh, Shared) { \ - gsi \ - } \ - }) \ - Name(_CRS, ResourceTemplate() { \ - Interrupt(, Level, ActiveHigh, Shared) { \ - gsi \ - } \ - }) \ - Method(_SRS, 1, NotSerialized) { \ - } \ - } - - define_gsi_link(GSIA, 0, 0x10) - define_gsi_link(GSIB, 0, 0x11) - define_gsi_link(GSIC, 0, 0x12) - define_gsi_link(GSID, 0, 0x13) - define_gsi_link(GSIE, 0, 0x14) - define_gsi_link(GSIF, 0, 0x15) - define_gsi_link(GSIG, 0, 0x16) - define_gsi_link(GSIH, 0, 0x17) + External(GSIA, DeviceObj) + External(GSIB, DeviceObj) + External(GSIC, DeviceObj) + External(GSID, DeviceObj) + External(GSIE, DeviceObj) + External(GSIF, DeviceObj) + External(GSIG, DeviceObj) + External(GSIH, DeviceObj) } }
Signature · 1 line
MST
[Qemu-devel] [PULL 42/59] pc: acpi: q35: move link devices to SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 9 +++++++++ hw/i386/q35-acpi-dsdt.dsl | 40 ++++++++-------------------------------- 2 files changed, 17 insertions(+), 32 deletions(-)
hw/i386/acpi-build.c +9 -0
@@ -1619,6 +1619,15 @@ static void build_q35_pci0_int(Aml *table) {Aml *sb_scope =aml_scope ("_SB" ); +aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQA" ))); +aml_append (sb_scope,build_link_dev ("LNKB" ,1 ,aml_name ("PRQB" ))); +aml_append (sb_scope,build_link_dev ("LNKC" ,2 ,aml_name ("PRQC" ))); +aml_append (sb_scope,build_link_dev ("LNKD" ,3 ,aml_name ("PRQD" ))); +aml_append (sb_scope,build_link_dev ("LNKE" ,4 ,aml_name ("PRQE" ))); +aml_append (sb_scope,build_link_dev ("LNKF" ,5 ,aml_name ("PRQF" ))); +aml_append (sb_scope,build_link_dev ("LNKG" ,6 ,aml_name ("PRQG" ))); +aml_append (sb_scope,build_link_dev ("LNKH" ,7 ,aml_name ("PRQH" ))); +/* * TODO: UID probably shouldn't be the same for GSIx devices * but that's how it was in original ASL so keep it for now
hw/i386/q35-acpi-dsdt.dsl +8 -32
@@ -315,38 +315,14 @@ DefinitionBlock ( Return (PRR0) } -#define define_link(link, uid, reg) \ - Device(link) { \ - Name(_HID, EISAID("PNP0C0F")) \ - Name(_UID, uid) \ - Name(_PRS, ResourceTemplate() { \ - Interrupt(, Level, ActiveHigh, Shared) { \ - 5, 10, 11 \ - } \ - }) \ - Method(_STA, 0, NotSerialized) { \ - Return (IQST(reg)) \ - } \ - Method(_DIS, 0, NotSerialized) { \ - Or(reg, 0x80, reg) \ - } \ - Method(_CRS, 0, NotSerialized) { \ - Return (IQCR(reg)) \ - } \ - Method(_SRS, 1, NotSerialized) { \ - CreateDWordField(Arg0, 0x05, PRRI) \ - Store(PRRI, reg) \ - } \ - } - - define_link(LNKA, 0, PRQA) - define_link(LNKB, 1, PRQB) - define_link(LNKC, 2, PRQC) - define_link(LNKD, 3, PRQD) - define_link(LNKE, 4, PRQE) - define_link(LNKF, 5, PRQF) - define_link(LNKG, 6, PRQG) - define_link(LNKH, 7, PRQH) + External(LNKA, DeviceObj) + External(LNKB, DeviceObj) + External(LNKC, DeviceObj) + External(LNKD, DeviceObj) + External(LNKE, DeviceObj) + External(LNKF, DeviceObj) + External(LNKG, DeviceObj) + External(LNKH, DeviceObj) External(GSIA, DeviceObj) External(GSIB, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 43/59] pc: acpi: q35: move IQCR() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 51 ++++++++++++++++++++++++++++++----------------- hw/i386/q35-acpi-dsdt.dsl | 9 --------- 2 files changed, 33 insertions(+), 27 deletions(-)
hw/i386/acpi-build.c +33 -18
@@ -1525,6 +1525,36 @@ static Aml *build_gsi_link_dev(const char *name, uint8_t uid, uint8_t gsi)return dev; } +/* _CRS method - get current settings */ +static Aml *build_iqcr_method (bool is_piix4) +{ +Aml *if_ctx; +uint32_t irqs; +Aml *method =aml_method ("IQCR" ,1 ,AML_SERIALIZED ); +Aml *crs =aml_resource_template (); + + irqs =0 ; +aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL , +AML_ACTIVE_HIGH ,AML_SHARED , &irqs,1 )); +aml_append (method,aml_name_decl ("PRR0" , crs)); + +aml_append (method, +aml_create_dword_field (aml_name ("PRR0" ),aml_int (5 ),"PRRI" )); + +if (is_piix4) { + if_ctx =aml_if (aml_lless (aml_arg (0 ),aml_int (0x80 ))); +aml_append (if_ctx,aml_store (aml_arg (0 ),aml_name ("PRRI" ))); +aml_append (method, if_ctx); + }else { +aml_append (method, +aml_store (aml_and (aml_arg (0 ),aml_int (0xF ),NULL ), +aml_name ("PRRI" ))); + } + +aml_append (method,aml_return (aml_name ("PRR0" ))); +return method; +} +static void build_piix4_pci0_int (Aml *table) {Aml *dev;
@@ -1556,24 +1586,7 @@ static void build_piix4_pci0_int(Aml *table) }aml_append (sb_scope, method); -/* _CRS method - get current settings */ - method =aml_method ("IQCR" ,1 ,AML_SERIALIZED ); - { - crs =aml_resource_template (); - irqs =0 ; -aml_append (crs,aml_interrupt (AML_CONSUMER ,AML_LEVEL , -AML_ACTIVE_HIGH ,AML_SHARED , &irqs,1 )); -aml_append (method,aml_name_decl ("PRR0" , crs)); - -aml_append (method, -aml_create_dword_field (aml_name ("PRR0" ),aml_int (5 ),"PRRI" )); - - if_ctx =aml_if (aml_lless (aml_arg (0 ),aml_int (0x80 ))); -aml_append (if_ctx,aml_store (aml_arg (0 ),aml_name ("PRRI" ))); -aml_append (method, if_ctx); -aml_append (method,aml_return (aml_name ("PRR0" ))); - } -aml_append (sb_scope, method); +aml_append (sb_scope,build_iqcr_method (true));aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQ0" )));aml_append (sb_scope,build_link_dev ("LNKB" ,1 ,aml_name ("PRQ1" )));
@@ -1619,6 +1632,8 @@ static void build_q35_pci0_int(Aml *table) {Aml *sb_scope =aml_scope ("_SB" ); +aml_append (sb_scope,build_iqcr_method (false)); +aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQA" )));aml_append (sb_scope,build_link_dev ("LNKB" ,1 ,aml_name ("PRQB" )));aml_append (sb_scope,build_link_dev ("LNKC" ,2 ,aml_name ("PRQC" )));
hw/i386/q35-acpi-dsdt.dsl +0 -9
@@ -305,15 +305,6 @@ DefinitionBlock ( } Return (0x0B) } - Method(IQCR, 1, Serialized) { - // _CRS method - get current settings - Name(PRR0, ResourceTemplate() { - Interrupt(, Level, ActiveHigh, Shared) { 0 } - }) - CreateDWordField(PRR0, 0x05, PRRI) - Store(And(Arg0, 0x0F), PRRI) - Return (PRR0) - } External(LNKA, DeviceObj) External(LNKB, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 44/59] pc: acpi: q35: move IQST() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 26 +++++++++++++++----------- hw/i386/q35-acpi-dsdt.dsl | 8 -------- 2 files changed, 15 insertions(+), 19 deletions(-)
hw/i386/acpi-build.c +15 -11
@@ -1555,12 +1555,24 @@ static Aml *build_iqcr_method(bool is_piix4)return method; } +/* _STA method - get status */ +static Aml *build_irq_status_method (void ) +{ +Aml *if_ctx; +Aml *method =aml_method ("IQST" ,1 ,AML_NOTSERIALIZED ); + + if_ctx =aml_if (aml_and (aml_int (0x80 ),aml_arg (0 ),NULL )); +aml_append (if_ctx,aml_return (aml_int (0x09 ))); +aml_append (method, if_ctx); +aml_append (method,aml_return (aml_int (0x0B ))); +return method; +} +static void build_piix4_pci0_int (Aml *table) {Aml *dev;Aml *crs;Aml *field; -Aml *if_ctx;Aml *method;uint32_t irqs;Aml *sb_scope =aml_scope ("_SB" );
@@ -1576,16 +1588,7 @@ static void build_piix4_pci0_int(Aml *table)aml_append (field,aml_named_field ("PRQ3" ,8 ));aml_append (sb_scope, field); -/* _STA method - get status */ - method =aml_method ("IQST" ,1 ,AML_NOTSERIALIZED ); - { - if_ctx =aml_if (aml_and (aml_int (0x80 ),aml_arg (0 ),NULL )); -aml_append (if_ctx,aml_return (aml_int (0x09 ))); -aml_append (method, if_ctx); -aml_append (method,aml_return (aml_int (0x0B ))); - } -aml_append (sb_scope, method); - +aml_append (sb_scope,build_irq_status_method ());aml_append (sb_scope,build_iqcr_method (true));aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQ0" )));
@@ -1632,6 +1635,7 @@ static void build_q35_pci0_int(Aml *table) {Aml *sb_scope =aml_scope ("_SB" ); +aml_append (sb_scope,build_irq_status_method ());aml_append (sb_scope,build_iqcr_method (false));aml_append (sb_scope,build_link_dev ("LNKA" ,0 ,aml_name ("PRQA" )));
hw/i386/q35-acpi-dsdt.dsl +0 -8
@@ -298,14 +298,6 @@ DefinitionBlock ( PRQH, 8 } - Method(IQST, 1, NotSerialized) { - // _STA method - get status - If (And(0x80, Arg0)) { - Return (0x09) - } - Return (0x0B) - } - External(LNKA, DeviceObj) External(LNKB, DeviceObj) External(LNKC, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 45/59] pc: acpi: q35: move ISA bridge into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++ hw/i386/q35-acpi-dsdt.dsl | 46 ---------------------------------------- 2 files changed, 54 insertions(+), 46 deletions(-)
hw/i386/acpi-build.c +54 -0
@@ -1633,8 +1633,21 @@ static void build_piix4_pci0_int(Aml *table)static void build_q35_pci0_int (Aml *table) { +Aml *field;Aml *sb_scope =aml_scope ("_SB" ); + field =aml_field ("PCI0.ISA.PIRQ" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,aml_named_field ("PRQA" ,8 )); +aml_append (field,aml_named_field ("PRQB" ,8 )); +aml_append (field,aml_named_field ("PRQC" ,8 )); +aml_append (field,aml_named_field ("PRQD" ,8 )); +aml_append (field,aml_reserved_field (0x20 )); +aml_append (field,aml_named_field ("PRQE" ,8 )); +aml_append (field,aml_named_field ("PRQF" ,8 )); +aml_append (field,aml_named_field ("PRQG" ,8 )); +aml_append (field,aml_named_field ("PRQH" ,8 )); +aml_append (sb_scope, field); +aml_append (sb_scope,build_irq_status_method ());aml_append (sb_scope,build_iqcr_method (false));
@@ -1663,6 +1676,46 @@ static void build_q35_pci0_int(Aml *table)aml_append (table, sb_scope); } +static void build_q35_isa_bridge (Aml *table) +{ +Aml *dev; +Aml *scope; +Aml *field; + + scope =aml_scope ("_SB.PCI0" ); + dev =aml_device ("ISA" ); +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0x001F0000 ))); + +/* ICH9 PCI to ISA irq remapping */ +aml_append (dev,aml_operation_region ("PIRQ" ,AML_PCI_CONFIG , +0x60 ,0x0C )); + +aml_append (dev,aml_operation_region ("LPCD" ,AML_PCI_CONFIG , +0x80 ,0x02 )); + field =aml_field ("LPCD" ,AML_ANY_ACC ,AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,aml_named_field ("COMA" ,3 )); +aml_append (field,aml_reserved_field (1 )); +aml_append (field,aml_named_field ("COMB" ,3 )); +aml_append (field,aml_reserved_field (1 )); +aml_append (field,aml_named_field ("LPTD" ,2 )); +aml_append (field,aml_reserved_field (2 )); +aml_append (field,aml_named_field ("FDCD" ,2 )); +aml_append (dev, field); + +aml_append (dev,aml_operation_region ("LPCE" ,AML_PCI_CONFIG , +0x82 ,0x02 )); +/* enable bits */ + field =aml_field ("LPCE" ,AML_ANY_ACC ,AML_NOLOCK ,AML_PRESERVE ); +aml_append (field,aml_named_field ("CAEN" ,1 )); +aml_append (field,aml_named_field ("CBEN" ,1 )); +aml_append (field,aml_named_field ("LPEN" ,1 )); +aml_append (field,aml_named_field ("FDEN" ,1 )); +aml_append (dev, field); + +aml_append (scope, dev); +aml_append (table, scope); +} +static void build_piix4_pm (Aml *table) {Aml *dev;
@@ -1790,6 +1843,7 @@ build_ssdt(GArray *table_data, GArray *linker,build_piix4_pci0_int (ssdt); }else {build_hpet_aml (ssdt); +build_q35_isa_bridge (ssdt);build_isa_devices_aml (ssdt);build_q35_pci0_int (ssdt); }
hw/i386/q35-acpi-dsdt.dsl +0 -46
58 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 46/59] pc: acpi: q35: move _PRT() into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 21 +++++++++++++++++++++ hw/i386/q35-acpi-dsdt.dsl | 12 ------------ 2 files changed, 21 insertions(+), 12 deletions(-)
hw/i386/acpi-build.c +21 -0
@@ -1634,7 +1634,28 @@ static void build_piix4_pci0_int(Aml *table)static void build_q35_pci0_int (Aml *table) {Aml *field; +Aml *method;Aml *sb_scope =aml_scope ("_SB" ); +Aml *pci0_scope =aml_scope ("PCI0" ); + + method =aml_method ("_PRT" ,0 ,AML_NOTSERIALIZED ); + { +Aml *if_ctx; +Aml *else_ctx; + +/* PCI IRQ routing table, example from ACPI 2.0a specification, +section 6.2.8.1 */ +/* Note: we provide the same info as the PCI routing +table of the Bochs BIOS */ + if_ctx =aml_if (aml_equal (aml_name ("PICF" ),aml_int (0 ))); +aml_append (if_ctx,aml_return (aml_name ("PRTP" ))); +aml_append (method, if_ctx); + else_ctx =aml_else (); +aml_append (else_ctx,aml_return (aml_name ("PRTA" ))); +aml_append (method, else_ctx); + } +aml_append (pci0_scope, method); +aml_append (sb_scope, pci0_scope); field =aml_field ("PCI0.ISA.PIRQ" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE );aml_append (field,aml_named_field ("PRQA" ,8 ));
hw/i386/q35-acpi-dsdt.dsl +0 -12
@@ -238,18 +238,6 @@ DefinitionBlock ( prt_slot_gsiA(0x001f) }) - - Method(_PRT, 0, NotSerialized) { - /* PCI IRQ routing table, example from ACPI 2.0a specification, - section 6.2.8.1 */ - /* Note: we provide the same info as the PCI routing - table of the Bochs BIOS */ - If (LEqual(\PICF, Zero)) { - Return (PRTP) - } Else { - Return (PRTA) - } - } } External(LNKA, DeviceObj)
Signature · 1 line
MST
[Qemu-devel] [PULL 47/59] pc: acpi: q35: move PRTA routing table into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++ hw/i386/q35-acpi-dsdt.dsl | 57 ------------------------------------------- 2 files changed, 61 insertions(+), 57 deletions(-)
hw/i386/acpi-build.c +61 -0
@@ -1631,6 +1631,64 @@ static void build_piix4_pci0_int(Aml *table)aml_append (table, sb_scope); } +static void append_q35_prt_entry (Aml *ctx,uint32_t nr,const char *name) +{ +int i; +int head; +Aml *pkg; +char base = name[3 ] <'E' ?'A' :'E' ; +char *s =g_strdup (name); +Aml *a_nr =aml_int ((nr <<16 ) |0xffff ); + +assert (strlen (s) ==4 ); + + head = name[3 ] - base; +for (i =0 ; i <4 ; i++) { +if (head + i >3 ) { + head = i *-1 ; + } + s[3 ] = base + head + i; + pkg =aml_package (4 ); +aml_append (pkg, a_nr); +aml_append (pkg,aml_int (i)); +aml_append (pkg,aml_name ("%s" , s)); +aml_append (pkg,aml_int (0 )); +aml_append (ctx, pkg); + } +g_free (s); +} + +static Aml *build_q35_routing_table (const char *str) +{ +int i; +Aml *pkg; +char *name =g_strdup_printf ("%s " , str); + + pkg =aml_package (128 ); +for (i =0 ; i <0x18 ; i++) { + name[3 ] ='E' + (i &0x3 ); +append_q35_prt_entry (pkg, i, name); + } + + name[3 ] ='E' ; +append_q35_prt_entry (pkg,0x18 , name); + +/* INTA -> PIRQA for slot 25 - 31, see the default value of D<N>IR */ +for (i =0x0019 ; i <0x1e ; i++) { + name[3 ] ='A' ; +append_q35_prt_entry (pkg, i, name); + } + +/* PCIe->PCI bridge. use PIRQ[E-H] */ + name[3 ] ='E' ; +append_q35_prt_entry (pkg,0x1e , name); + name[3 ] ='A' ; +append_q35_prt_entry (pkg,0x1f , name); + +g_free (name); +return pkg; +} +static void build_q35_pci0_int (Aml *table) {Aml *field;
@@ -1638,6 +1696,9 @@ static void build_q35_pci0_int(Aml *table)Aml *sb_scope =aml_scope ("_SB" );Aml *pci0_scope =aml_scope ("PCI0" ); +aml_append (pci0_scope, +aml_name_decl ("PRTA" ,build_q35_routing_table ("GSI" ))); + method =aml_method ("_PRT" ,0 ,AML_NOTSERIALIZED ); {Aml *if_ctx;
hw/i386/q35-acpi-dsdt.dsl +0 -57
63 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 48/59] pc: acpi: q35: move PRTP routing table into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 2 ++ hw/i386/q35-acpi-dsdt.dsl | 79 ----------------------------------------------- 2 files changed, 2 insertions(+), 79 deletions(-)
hw/i386/acpi-build.c +2 -0
@@ -1697,6 +1697,8 @@ static void build_q35_pci0_int(Aml *table)Aml *pci0_scope =aml_scope ("PCI0" );aml_append (pci0_scope, +aml_name_decl ("PRTP" ,build_q35_routing_table ("LNK" ))); +aml_append (pci0_scope,aml_name_decl ("PRTA" ,build_q35_routing_table ("GSI" ))); method =aml_method ("_PRT" ,0 ,AML_NOTSERIALIZED );
hw/i386/q35-acpi-dsdt.dsl +0 -79
83 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 49/59] pc: acpi: q35: move _PIC() method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 8 ++++++++ hw/i386/q35-acpi-dsdt.dsl | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-)
hw/i386/acpi-build.c +8 -0
@@ -1696,6 +1696,14 @@ static void build_q35_pci0_int(Aml *table)Aml *sb_scope =aml_scope ("_SB" );Aml *pci0_scope =aml_scope ("PCI0" ); +/* Zero => PIC mode, One => APIC Mode */ +aml_append (table,aml_name_decl ("PICF" ,aml_int (0 ))); + method =aml_method ("_PIC" ,1 ,AML_NOTSERIALIZED ); + { +aml_append (method,aml_store (aml_arg (0 ),aml_name ("PICF" ))); + } +aml_append (table, method); +aml_append (pci0_scope,aml_name_decl ("PRTP" ,build_q35_routing_table ("LNK" ))); aml_append(pci0_scope,
hw/i386/q35-acpi-dsdt.dsl +0 -10
@@ -112,14 +112,4 @@ DefinitionBlock ( } } } - -/**************************************************************** - * PCI IRQs - ****************************************************************/ - - /* Zero => PIC mode, One => APIC Mode */ - Name(\PICF, Zero) - Method(\_PIC, 1, NotSerialized) { - Store(Arg0, \PICF) - } }
Signature · 1 line
MST
[Qemu-devel] [PULL 50/59] pc: acpi: q35: move PCI0._OSC() method into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ hw/i386/q35-acpi-dsdt.dsl | 57 ----------------------------------------------- 2 files changed, 56 insertions(+), 57 deletions(-)
hw/i386/acpi-build.c +56 -0
@@ -1896,6 +1896,54 @@ static void build_piix4_pci_hotplug(Aml *table)aml_append (table, scope); } +static Aml *build_q35_osc_method (void ) +{ +Aml *if_ctx; +Aml *if_ctx2; +Aml *else_ctx; +Aml *method; +Aml *a_cwd1 =aml_name ("CDW1" ); +Aml *a_ctrl =aml_name ("CTRL" ); + + method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED ); +aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" )); + + if_ctx =aml_if (aml_equal ( +aml_arg (0 ),aml_touuid ("33DB4D5B-1FF7-401C-9657-7441C03DD766" ))); +aml_append (if_ctx,aml_create_dword_field (aml_arg (3 ),aml_int (4 ),"CDW2" )); +aml_append (if_ctx,aml_create_dword_field (aml_arg (3 ),aml_int (8 ),"CDW3" )); + +aml_append (if_ctx,aml_store (aml_name ("CDW2" ),aml_name ("SUPP" ))); +aml_append (if_ctx,aml_store (aml_name ("CDW3" ), a_ctrl)); + +/* +* Always allow native PME, AER (no dependencies) +* Never allow SHPC (no SHPC controller in this system) +*/ +aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1D ), a_ctrl)); + + if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 )))); +/* Unknown revision */ +aml_append (if_ctx2,aml_or (a_cwd1,aml_int (0x08 ), a_cwd1)); +aml_append (if_ctx, if_ctx2); + + if_ctx2 =aml_if (aml_lnot (aml_equal (aml_name ("CDW3" ), a_ctrl))); +/* Capabilities bits were masked */ +aml_append (if_ctx2,aml_or (a_cwd1,aml_int (0x10 ), a_cwd1)); +aml_append (if_ctx, if_ctx2); + +/* Update DWORD3 in the buffer */ +aml_append (if_ctx,aml_store (a_ctrl,aml_name ("CDW3" ))); +aml_append (method, if_ctx); + + else_ctx =aml_else (); +/* Unrecognized UUID */ +aml_append (else_ctx,aml_or (a_cwd1,aml_int (4 ), a_cwd1)); +aml_append (method, else_ctx); + +aml_append (method,aml_return (aml_arg (3 ))); +return method; +} static void build_ssdt(GArray *table_data, GArray *linker,
@@ -1934,6 +1982,14 @@ build_ssdt(GArray *table_data, GArray *linker,build_piix4_pci_hotplug (ssdt);build_piix4_pci0_int (ssdt); }else { + sb_scope =aml_scope ("_SB" ); + scope =aml_scope ("PCI0" ); +aml_append (scope,aml_name_decl ("SUPP" ,aml_int (0 ))); +aml_append (scope,aml_name_decl ("CTRL" ,aml_int (0 ))); +aml_append (scope,build_q35_osc_method ()); +aml_append (sb_scope, scope); +aml_append (ssdt, sb_scope); +build_hpet_aml (ssdt);build_q35_isa_bridge (ssdt);build_isa_devices_aml (ssdt);
hw/i386/q35-acpi-dsdt.dsl +0 -57
63 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 51/59] pc: acpi: q35: move PCI0 device definition into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 14 +++++++++----- hw/i386/q35-acpi-dsdt.dsl | 13 ------------- 2 files changed, 9 insertions(+), 18 deletions(-)
hw/i386/acpi-build.c +9 -5
@@ -1983,11 +1983,15 @@ build_ssdt(GArray *table_data, GArray *linker,build_piix4_pci0_int (ssdt); }else { sb_scope =aml_scope ("_SB" ); - scope =aml_scope ("PCI0" ); -aml_append (scope,aml_name_decl ("SUPP" ,aml_int (0 ))); -aml_append (scope,aml_name_decl ("CTRL" ,aml_int (0 ))); -aml_append (scope,build_q35_osc_method ()); -aml_append (sb_scope, scope); + dev =aml_device ("PCI0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" ))); +aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); +aml_append (dev,aml_name_decl ("SUPP" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("CTRL" ,aml_int (0 ))); +aml_append (dev,build_q35_osc_method ()); +aml_append (sb_scope, dev);aml_append (ssdt, sb_scope);build_hpet_aml (ssdt);
hw/i386/q35-acpi-dsdt.dsl +0 -13
@@ -42,17 +42,4 @@ DefinitionBlock ( PCIB, 8, } } - - -/**************************************************************** - * PCI Bus definition - ****************************************************************/ - Scope(\_SB) { - Device(PCI0) { - Name(_HID, EisaId("PNP0A08")) - Name(_CID, EisaId("PNP0A03")) - Name(_ADR, 0x00) - Name(_UID, 1) - } - } }
Signature · 1 line
MST
[Qemu-devel] [PULL 52/59] pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 10 ++++++++++ hw/i386/q35-acpi-dsdt.dsl | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-)
hw/i386/acpi-build.c +10 -0
@@ -1983,6 +1983,16 @@ build_ssdt(GArray *table_data, GArray *linker,build_piix4_pci0_int (ssdt); }else { sb_scope =aml_scope ("_SB" ); +aml_append (sb_scope, +aml_operation_region ("PCST" ,AML_SYSTEM_IO ,0xae00 ,0x0c )); +aml_append (sb_scope, +aml_operation_region ("PCSB" ,AML_SYSTEM_IO ,0xae0c ,0x01 )); + field =aml_field ("PCSB" ,AML_ANY_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("PCIB" ,8 )); +aml_append (sb_scope, field); +aml_append (ssdt, sb_scope); + + sb_scope =aml_scope ("_SB" ); dev =aml_device ("PCI0" );aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));
hw/i386/q35-acpi-dsdt.dsl +0 -5
@@ -36,10 +36,5 @@ DefinitionBlock ( { Scope(\_SB) { - OperationRegion(PCST, SystemIO, 0xae00, 0x0c) - OperationRegion(PCSB, SystemIO, 0xae0c, 0x01) - Field(PCSB, AnyAcc, NoLock, WriteAsZeros) { - PCIB, 8, - } } }
Signature · 1 line
MST
[Qemu-devel] [PULL 53/59] pc: acpi: switch to AML API composed DSDT
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
--- hw/i386/acpi-build.c | 235 +++++++++++++++++++++++++-------------------------- 1 file changed, 115 insertions(+), 120 deletions(-)
hw/i386/acpi-build.c +115 -120
@@ -54,9 +54,6 @@#include "hw/i386/intel_iommu.h" #include "hw/timer/hpet.h" -#include "hw/i386/q35-acpi-dsdt.hex" -#include "hw/i386/acpi-dsdt.hex" -#include "hw/acpi/aml-build.h" #include "qapi/qmp/qint.h"
@@ -125,24 +122,6 @@ typedef struct AcpiBuildPciBusHotplugState {bool pcihp_bridge_en; } AcpiBuildPciBusHotplugState; -static void acpi_get_dsdt (AcpiMiscInfo *info) -{ -Object *piix =piix4_pm_find (); -Object *lpc =ich9_lpc_find (); -assert (!!piix != !!lpc); - -if (piix) { - info->is_piix4 = true; - info->dsdt_code = AcpiDsdtAmlCode; - info->dsdt_size =sizeof AcpiDsdtAmlCode; - } -if (lpc) { - info->is_piix4 = false; - info->dsdt_code = Q35AcpiDsdtAmlCode; - info->dsdt_size =sizeof Q35AcpiDsdtAmlCode; - } -} -static int acpi_add_cpu_info (Object *o,void *opaque) {
@@ -241,6 +220,17 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)static void acpi_get_misc_info (AcpiMiscInfo *info) { +Object *piix =piix4_pm_find (); +Object *lpc =ich9_lpc_find (); +assert (!!piix != !!lpc); + +if (piix) { + info->is_piix4 = true; + } +if (lpc) { + info->is_piix4 = false; + } + info->has_hpet =hpet_find (); info->tpm_version =tpm_get_version (); info->pvpanic_port =pvpanic_port ();
@@ -1965,95 +1955,6 @@ build_ssdt(GArray *table_data, GArray *linker,/* Reserve space for header */ acpi_data_push (ssdt->buf,sizeof (AcpiTableHeader)); -build_dbg_aml (ssdt); -if (misc->is_piix4) { - sb_scope =aml_scope ("_SB" ); - dev =aml_device ("PCI0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); -aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); -aml_append (sb_scope, dev); -aml_append (ssdt, sb_scope); - -build_hpet_aml (ssdt); -build_piix4_pm (ssdt); -build_piix4_isa_bridge (ssdt); -build_isa_devices_aml (ssdt); -build_piix4_pci_hotplug (ssdt); -build_piix4_pci0_int (ssdt); - }else { - sb_scope =aml_scope ("_SB" ); -aml_append (sb_scope, -aml_operation_region ("PCST" ,AML_SYSTEM_IO ,0xae00 ,0x0c )); -aml_append (sb_scope, -aml_operation_region ("PCSB" ,AML_SYSTEM_IO ,0xae0c ,0x01 )); - field =aml_field ("PCSB" ,AML_ANY_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); -aml_append (field,aml_named_field ("PCIB" ,8 )); -aml_append (sb_scope, field); -aml_append (ssdt, sb_scope); - - sb_scope =aml_scope ("_SB" ); - dev =aml_device ("PCI0" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" ))); -aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); -aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); -aml_append (dev,aml_name_decl ("SUPP" ,aml_int (0 ))); -aml_append (dev,aml_name_decl ("CTRL" ,aml_int (0 ))); -aml_append (dev,build_q35_osc_method ()); -aml_append (sb_scope, dev); -aml_append (ssdt, sb_scope); - -build_hpet_aml (ssdt); -build_q35_isa_bridge (ssdt); -build_isa_devices_aml (ssdt); -build_q35_pci0_int (ssdt); - } - -build_cpu_hotplug_aml (ssdt); -build_memory_hotplug_aml (ssdt, nr_mem, pm->mem_hp_io_base, - pm->mem_hp_io_len); - - scope =aml_scope ("_GPE" ); - { -aml_append (scope,aml_name_decl ("_HID" ,aml_string ("ACPI0006" ))); - -aml_append (scope,aml_method ("_L00" ,0 ,AML_NOTSERIALIZED )); - -if (misc->is_piix4) { - method =aml_method ("_E01" ,0 ,AML_NOTSERIALIZED ); -aml_append (method, -aml_acquire (aml_name ("\\_SB.PCI0.BLCK" ),0xFFFF )); -aml_append (method,aml_call0 ("\\_SB.PCI0.PCNT" )); -aml_append (method,aml_release (aml_name ("\\_SB.PCI0.BLCK" ))); -aml_append (scope, method); - }else { -aml_append (scope,aml_method ("_L01" ,0 ,AML_NOTSERIALIZED )); - } - - method =aml_method ("_E02" ,0 ,AML_NOTSERIALIZED ); -aml_append (method,aml_call0 ("\\_SB." CPU_SCAN_METHOD )); -aml_append (scope, method); - - method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED ); -aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH )); -aml_append (scope, method); - -aml_append (scope,aml_method ("_L04" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L05" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L06" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L07" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L08" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L09" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0A" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0B" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0C" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0D" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0E" ,0 ,AML_NOTSERIALIZED )); -aml_append (scope,aml_method ("_L0F" ,0 ,AML_NOTSERIALIZED )); - } -aml_append (ssdt, scope); - bus =PC_MACHINE (machine)->bus;if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) {
@@ -2523,18 +2424,113 @@ build_dmar_q35(GArray *table_data, GArray *linker) }static void -build_dsdt (GArray *table_data,GArray *linker,AcpiMiscInfo *misc) +build_dsdt (GArray *table_data,GArray *linker, +AcpiPmInfo *pm,AcpiMiscInfo *misc) { -AcpiTableHeader *dsdt; +Aml *dsdt, *sb_scope, *scope, *dev, *method, *field; +MachineState *machine =MACHINE (qdev_get_machine ()); +uint32_t nr_mem = machine->ram_slots; + + dsdt =init_aml_allocator (); -assert (misc->dsdt_code && misc->dsdt_size); +/* Reserve space for header */ +acpi_data_push (dsdt->buf,sizeof (AcpiTableHeader)); - dsdt =acpi_data_push (table_data, misc->dsdt_size); -memcpy (dsdt, misc->dsdt_code, misc->dsdt_size); +build_dbg_aml (dsdt); +if (misc->is_piix4) { + sb_scope =aml_scope ("_SB" ); + dev =aml_device ("PCI0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); +aml_append (sb_scope, dev); +aml_append (dsdt, sb_scope); + +build_hpet_aml (dsdt); +build_piix4_pm (dsdt); +build_piix4_isa_bridge (dsdt); +build_isa_devices_aml (dsdt); +build_piix4_pci_hotplug (dsdt); +build_piix4_pci0_int (dsdt); + }else { + sb_scope =aml_scope ("_SB" ); +aml_append (sb_scope, +aml_operation_region ("PCST" ,AML_SYSTEM_IO ,0xae00 ,0x0c )); +aml_append (sb_scope, +aml_operation_region ("PCSB" ,AML_SYSTEM_IO ,0xae0c ,0x01 )); + field =aml_field ("PCSB" ,AML_ANY_ACC ,AML_NOLOCK ,AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("PCIB" ,8 )); +aml_append (sb_scope, field); +aml_append (dsdt, sb_scope); + + sb_scope =aml_scope ("_SB" ); + dev =aml_device ("PCI0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" ))); +aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (1 ))); +aml_append (dev,aml_name_decl ("SUPP" ,aml_int (0 ))); +aml_append (dev,aml_name_decl ("CTRL" ,aml_int (0 ))); +aml_append (dev,build_q35_osc_method ()); +aml_append (sb_scope, dev); +aml_append (dsdt, sb_scope); + +build_hpet_aml (dsdt); +build_q35_isa_bridge (dsdt); +build_isa_devices_aml (dsdt); +build_q35_pci0_int (dsdt); + } -memset (dsdt,0 ,sizeof *dsdt); -build_header (linker, table_data, dsdt,"DSDT" , - misc->dsdt_size,1 ,NULL ); +build_cpu_hotplug_aml (dsdt); +build_memory_hotplug_aml (dsdt, nr_mem, pm->mem_hp_io_base, + pm->mem_hp_io_len); + + scope =aml_scope ("_GPE" ); + { +aml_append (scope,aml_name_decl ("_HID" ,aml_string ("ACPI0006" ))); + +aml_append (scope,aml_method ("_L00" ,0 ,AML_NOTSERIALIZED )); + +if (misc->is_piix4) { + method =aml_method ("_E01" ,0 ,AML_NOTSERIALIZED ); +aml_append (method, +aml_acquire (aml_name ("\\_SB.PCI0.BLCK" ),0xFFFF )); +aml_append (method,aml_call0 ("\\_SB.PCI0.PCNT" )); +aml_append (method,aml_release (aml_name ("\\_SB.PCI0.BLCK" ))); +aml_append (scope, method); + }else { +aml_append (scope,aml_method ("_L01" ,0 ,AML_NOTSERIALIZED )); + } + + method =aml_method ("_E02" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_call0 ("\\_SB." CPU_SCAN_METHOD )); +aml_append (scope, method); + + method =aml_method ("_E03" ,0 ,AML_NOTSERIALIZED ); +aml_append (method,aml_call0 (MEMORY_HOTPLUG_HANDLER_PATH )); +aml_append (scope, method); + +aml_append (scope,aml_method ("_L04" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L05" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L06" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L07" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L08" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L09" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0A" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0B" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0C" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0D" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0E" ,0 ,AML_NOTSERIALIZED )); +aml_append (scope,aml_method ("_L0F" ,0 ,AML_NOTSERIALIZED )); + } +aml_append (dsdt, scope); + +/* copy AML table into ACPI tables blob and patch header there */ +g_array_append_vals (table_data, dsdt->buf->data, dsdt->buf->len); +build_header (linker, table_data, + (void *)(table_data->data + table_data->len - dsdt->buf->len), +"DSDT" , dsdt->buf->len,1 ,NULL ); +free_aml_allocator (); } static GArray *
@@ -2628,7 +2624,6 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)acpi_get_cpu_info (&cpu);acpi_get_pm_info (&pm); -acpi_get_dsdt (&misc);acpi_get_misc_info (&misc);acpi_get_pci_info (&pci);
@@ -2650,7 +2645,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)/* DSDT is pointed to by FADT */ dsdt = tables_blob->len; -build_dsdt (tables_blob, tables->linker, &misc); +build_dsdt (tables_blob, tables->linker, &pm, &misc);/* Count the size of the DSDT and SSDT, we will need it for legacy * sizing of ACPI tables.
Signature · 1 line
MST
[Qemu-devel] [PULL 56/59] Add VMSTATE_STRUCT_VARRAY_KNOWN
In reply to Michael S. TsirkinFrom: "Dr. David Alan Gilbert" <[email protected]>
At the moment we have VMSTATE_STRUCT_ARRAY that requires the field is declared as an array of fixed size. We also have VMSTATE_STRUCT_VARRAY_UINT* that allows a field declared as a pointer, but requires that the length is a field member in the structure being loaded/saved.
VMSTATE_STRUCT_VARRAY_KNOWN is for arrays defined as pointers yet we somehow know the length of.
--- include/migration/vmstate.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
include/migration/vmstate.h +13 -0
@@ -374,6 +374,19 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_state, _field, _type, _num),\ } +/* a variable length array (i.e. _type *_field) but we know the +* length +*/ +#define VMSTATE_STRUCT_VARRAY_KNOWN (_field, _state, _num, _version, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .num = (_num), \ + .version_id = (_version), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_ARRAY, \ + .offset = offsetof(_state, _field), \ +} +#define VMSTATE_STRUCT_VARRAY_UINT8 (_field, _state, _field_num, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .num_offset = vmstate_offset_value(_state, _field_num, uint8_t), \
Signature · 1 line
MST
[Qemu-devel] [PULL 55/59] i386/pc: expose identifying the floppy controller
In reply to Michael S. TsirkinFrom: Roman Kagan <[email protected]>
Factor out and expose the function to locate the floppy controller in the system.
It will allow to dynamically populate the relevant objects in the ACPI tables.
--- include/hw/i386/pc.h | 2 ++ hw/i386/pc.c | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 18 deletions(-)
include/hw/i386/pc.h +2 -0
@@ -267,6 +267,8 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg);void ioapic_init_gsi (GSIState *gsi_state,const char *parent_name); +ISADevice *pc_find_fdc0 (void ); +/* acpi_piix.c */ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
hw/i386/pc.c +26 -18
62 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 57/59] migration/virtio: Remove simple .get/.put use
In reply to Michael S. TsirkinFrom: "Dr. David Alan Gilbert" <[email protected]>
The 'virtqueue_state' and 'ringsize' can be saved using VMSTATE macros rather than hand coded .get/.put
--- hw/virtio/virtio.c | 87 ++++++++++++------------------------------------------ 1 file changed, 19 insertions(+), 68 deletions(-)
hw/virtio/virtio.c +19 -68
@@ -1126,33 +1126,15 @@ static bool virtio_extra_state_needed(void *opaque) k->has_extra_state (qbus->parent); } -static void put_virtqueue_state (QEMUFile *f,void *pv,size_t size) -{ -VirtIODevice *vdev = pv; -int i; - -for (i =0 ; i <VIRTIO_QUEUE_MAX ; i++) { -qemu_put_be64 (f, vdev->vq[i].vring.avail); -qemu_put_be64 (f, vdev->vq[i].vring.used); - } -} - -static int get_virtqueue_state (QEMUFile *f,void *pv,size_t size) -{ -VirtIODevice *vdev = pv; -int i; - -for (i =0 ; i <VIRTIO_QUEUE_MAX ; i++) { - vdev->vq[i].vring.avail =qemu_get_be64 (f); - vdev->vq[i].vring.used =qemu_get_be64 (f); - } -return 0 ; -} - -static VMStateInfo vmstate_info_virtqueue = { +static const VMStateDescription vmstate_virtqueue = { .name ="virtqueue_state" , - .get = get_virtqueue_state, - .put = put_virtqueue_state, + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { + VMSTATE_UINT64(vring.avail, struct VirtQueue), + VMSTATE_UINT64(vring.used, struct VirtQueue), +VMSTATE_END_OF_LIST () + } };static const VMStateDescription vmstate_virtio_virtqueues = {
@@ -1161,44 +1143,20 @@ static const VMStateDescription vmstate_virtio_virtqueues = { .minimum_version_id = 1, .needed = &virtio_virtqueue_needed, .fields = (VMStateField []) { - { - .name ="virtqueues" , - .version_id =0 , - .field_exists =NULL , - .size =0 , - .info = &vmstate_info_virtqueue, - .flags =VMS_SINGLE , - .offset =0 , - }, + VMSTATE_STRUCT_VARRAY_KNOWN(vq, struct VirtIODevice, VIRTIO_QUEUE_MAX, +0 , vmstate_virtqueue, VirtQueue),VMSTATE_END_OF_LIST () } }; -static void put_ringsize_state (QEMUFile *f,void *pv,size_t size) -{ -VirtIODevice *vdev = pv; -int i; - -for (i =0 ; i <VIRTIO_QUEUE_MAX ; i++) { -qemu_put_be32 (f, vdev->vq[i].vring.num_default); - } -} - -static int get_ringsize_state (QEMUFile *f,void *pv,size_t size) -{ -VirtIODevice *vdev = pv; -int i; - -for (i =0 ; i <VIRTIO_QUEUE_MAX ; i++) { - vdev->vq[i].vring.num_default =qemu_get_be32 (f); - } -return 0 ; -} - -static VMStateInfo vmstate_info_ringsize = { +static const VMStateDescription vmstate_ringsize = { .name ="ringsize_state" , - .get = get_ringsize_state, - .put = put_ringsize_state, + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { + VMSTATE_UINT32(vring.num_default, struct VirtQueue), +VMSTATE_END_OF_LIST () + } };static const VMStateDescription vmstate_virtio_ringsize = {
@@ -1207,15 +1165,8 @@ static const VMStateDescription vmstate_virtio_ringsize = { .minimum_version_id = 1, .needed = &virtio_ringsize_needed, .fields = (VMStateField []) { - { - .name ="ringsize" , - .version_id =0 , - .field_exists =NULL , - .size =0 , - .info = &vmstate_info_ringsize, - .flags =VMS_SINGLE , - .offset =0 , - }, + VMSTATE_STRUCT_VARRAY_KNOWN(vq, struct VirtIODevice, VIRTIO_QUEUE_MAX, +0 , vmstate_ringsize, VirtQueue),VMSTATE_END_OF_LIST () } };
Signature · 1 line
MST
[Qemu-devel] [PULL 58/59] ivshmem: Store file descriptor for vhost-user negotiation
In reply to Michael S. TsirkinFrom: Tetsuya Mukawa <[email protected]>
If virtio-net driver allocates memory in ivshmem shared memory, vhost-net will work correctly, but vhost-user will not work because a fd of shared memory will not be sent to vhost-user backend. This patch fixes ivshmem to store file descriptor of shared memory. It will be used when vhost-user negotiates vhost-user backend.
--- include/exec/ram_addr.h | 1 + exec.c | 10 ++++++++++ hw/misc/ivshmem.c | 9 +++++++-- 3 files changed, 18 insertions(+), 2 deletions(-)
include/exec/ram_addr.h +1 -0
@@ -72,6 +72,7 @@ ram_addr_t qemu_ram_alloc_resizeable(ram_addr_t size, ram_addr_t max_size, void *host), MemoryRegion *mr, Error **errp);int qemu_get_ram_fd (ram_addr_t addr); +void qemu_set_ram_fd (ram_addr_t addr,int fd);void *qemu_get_ram_block_host_ptr (ram_addr_t addr);void qemu_ram_free (ram_addr_t addr);
exec.c +10 -0
@@ -1757,6 +1757,16 @@ int qemu_get_ram_fd(ram_addr_t addr)return fd; } +void qemu_set_ram_fd (ram_addr_t addr,int fd) +{ +RAMBlock *block; + +rcu_read_lock (); + block =qemu_get_ram_block (addr); + block->fd = fd; +rcu_read_unlock (); +} +void *qemu_get_ram_block_host_ptr (ram_addr_t addr) {RAMBlock *block;
hw/misc/ivshmem.c +7 -2
@@ -29,6 +29,7 @@#include "sysemu/char.h" #include "sysemu/hostmem.h" #include "qapi/visitor.h" +#include "exec/ram_addr.h" #include "hw/misc/ivshmem.h"
@@ -422,6 +423,7 @@ static int create_shared_memory_BAR(IVShmemState *s, int fd, uint8_t attr,memory_region_init_ram_ptr (&s->ivshmem,OBJECT (s),"ivshmem.bar2" , s->ivshmem_size, ptr); +qemu_set_ram_fd (s->ivshmem.ram_addr, fd);vmstate_register_ram (&s->ivshmem,DEVICE (s));memory_region_add_subregion (&s->bar,0 , &s->ivshmem);
@@ -682,6 +684,7 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size) }memory_region_init_ram_ptr (&s->ivshmem,OBJECT (s),"ivshmem.bar2" , s->ivshmem_size, map_ptr); +qemu_set_ram_fd (s->ivshmem.ram_addr, incoming_fd);vmstate_register_ram (&s->ivshmem,DEVICE (s)); IVSHMEM_DPRINTF("guest h/w addr = %p, size = %" PRIu64 "\n",
@@ -689,7 +692,6 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)memory_region_add_subregion (&s->bar,0 , &s->ivshmem); -close (incoming_fd);return ; }
@@ -991,7 +993,6 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error **errp) }create_shared_memory_BAR (s, fd, attr, errp); -close (fd); } }
@@ -1010,11 +1011,15 @@ static void pci_ivshmem_exit(PCIDevice *dev)if (memory_region_is_mapped (&s->ivshmem)) {if (!s->hostmem) {void *addr =memory_region_get_ram_ptr (&s->ivshmem); +int fd;if (munmap (addr, s->ivshmem_size) ==-1 ) {error_report ("Failed to munmap shared memory %s" ,strerror (errno)); } + +if ((fd =qemu_get_ram_fd (s->ivshmem.ram_addr)) !=-1 ) +close (fd); }vmstate_unregister_ram (&s->ivshmem,DEVICE (dev));
Signature · 1 line
MST
[Qemu-devel] [PULL 59/59] virtio: fix error message for number of queues
In reply to Michael S. TsirkinFrom: Cornelia Huck <[email protected]>
There's no such thing as "PCI queues" in the virtio core.
--- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio.c +1 -1
@@ -1380,7 +1380,7 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id) num =qemu_get_be32 (f);if (num >VIRTIO_QUEUE_MAX ) { -error_report ("Invalid number of PCI queues: 0x%x" , num); +error_report ("Invalid number of virtqueues: 0x%x" , num);return -1 ; }
Signature · 1 line
MST
[Qemu-devel] [PULL 54/59] pc: acpi: remove unused ASL templates and related blobs/utils
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
QEMU now uses internally composed DSDT so drop now empty *.dsl templates and related *.generated binary blobs.
Also since templates are not used anymore/obolete remove utility scripts used for extracting/patching AML blobs compiled by IASL and for updating them in git tree.
--- hw/i386/Makefile.objs | 30 - hw/i386/acpi-dsdt.dsl | 33 - hw/i386/acpi-dsdt.hex.generated | 2972 -------------- hw/i386/q35-acpi-dsdt.dsl | 40 - hw/i386/q35-acpi-dsdt.hex.generated | 7610 ----------------------------------- scripts/acpi_extract.py | 367 -- scripts/acpi_extract_preprocess.py | 51 - scripts/update-acpi.sh | 4 - 8 files changed, 11107 deletions(-) delete mode 100644 hw/i386/acpi-dsdt.dsl delete mode 100644 hw/i386/acpi-dsdt.hex.generated delete mode 100644 hw/i386/q35-acpi-dsdt.dsl delete mode 100644 hw/i386/q35-acpi-dsdt.hex.generated delete mode 100755 scripts/acpi_extract.py delete mode 100755 scripts/acpi_extract_preprocess.py delete mode 100644 scripts/update-acpi.sh
hw/i386/Makefile.objs +0 -30
@@ -8,33 +8,3 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/ obj-y += kvmvapic.o obj-y += acpi-build.o obj-y += pci-assign-load-rom.o - -gen-hex-y += hw/i386/acpi-dsdt.hex -gen-hex-y += hw/i386/q35-acpi-dsdt.hex - -hw/i386/acpi-build.o: hw/i386/acpi-build.c \ - $(gen-hex-y) - --include $(gen-hex-y:.hex=.d) - -iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \ - ; then echo "$(2)"; else echo "$(3)"; fi ;) - -ifdef IASL -#IASL Present. Generate hex files from .dsl -hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py - $(call quiet-command, $(CPP) -x c -P $(QEMU_DGFLAGS) $(QEMU_INCLUDES) $< -o $*.dsl.i.orig, " CPP $(TARGET_DIR)$*.dsl.i.orig") - $(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, " ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i") - $(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ," IASL $(TARGET_DIR)$*.dsl.i") - $(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract.py $*.lst > $*.off, " ACPI_EXTRACT $(TARGET_DIR)$*.off") - $(call quiet-command, cat $*.off > $@, " CAT $(TARGET_DIR)$@") -else -#IASL Not present. Restore pre-generated hex files. -hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.hex.generated - $(call quiet-command, cp -f $< $@, " CP $(TARGET_DIR)$@") -endif - -.PHONY: cleanhex -cleanhex: - rm -f hw/i386/*hex -clean: cleanhex
hw/i386/acpi-dsdt.dsl deleted +0 -33
@@ -1,33 +0,0 @@ -/* - * Bochs/QEMU ACPI DSDT ASL definition - * - * Copyright (c) 2006 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2 as published by the Free Software Foundation. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -ACPI_EXTRACT_ALL_CODE AcpiDsdtAmlCode - -DefinitionBlock ( - "acpi-dsdt.aml", // Output Filename - "DSDT", // Signature - 0x01, // DSDT Compliance Revision - "BXPC", // OEMID - "BXDSDT", // TABLE ID - 0x1 // OEM Revision - ) -{ - Scope(\_SB) { - } -}
hw/i386/acpi-dsdt.hex.generated deleted +0 -2972
2,934 lines not on this page · raw message
hw/i386/q35-acpi-dsdt.hex.generated deleted +0 -7610
7,610 lines not on this page · raw message
scripts/acpi_extract.py deleted +0 -367
367 lines not on this page · raw message
scripts/acpi_extract_preprocess.py deleted +0 -51
51 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
MST
Part of the diff is not shown here. View the raw message.
The following changes since commit 6bb9ead762bf749af11ea225fc2a74db1b93c105:
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging (2016-01-08 12:50:19 +0000)
are available in the git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 88e6cd937bc5dd4b972aaee18b6adc92b33b46c6:
virtio: fix error message for number of queues (2016-01-08 16:01:40 +0200)
----------------------------------------------------------------
acpi dsdt rework, misc fixes
This completes the dsdt rewrite, and includes misc fixes all over the place.
----------------------------------------------------------------
Cao jin (1):
igd-passthrough: fix use of host_pci_config_read
Cornelia Huck (1):
virtio: fix error message for number of queues
Dr. David Alan Gilbert (2):
Add VMSTATE_STRUCT_VARRAY_KNOWN migration/virtio: Remove simple .get/.put use
Haozhong Zhang (1):
nvdimm: fix header pointer in nvdimm_build_nfit()
Igor Mammedov (51):
tests: acpi: print ASL diff in verbose mode
pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code
pc: acpi: memhp: move MHPD._STA method into SSDT
pc: acpi: memhp: move MHPD.MLCK mutex into SSDT
pc: acpi: memhp: move MHPD.MSCN method into SSDT
pc: acpi: memhp: move MHPD.MRST method into SSDT
pc: acpi: memhp: move MHPD.MPXM method into SSDT
pc: acpi: memhp: move MHPD.MOST method into SSDT
pc: acpi: memhp: move MHPD.MEJ0 method into SSDT
pc: acpi: memhp: move MHPD.MCRS method into SSDT
pc: acpi: memhp: move MHPD Device into SSDT
pc: acpi: factor out memhp code from build_ssdt() into separate function
pc: acpi: memhp: move \_GPE._E03 into SSDT
pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage
pc: acpi: drop unused CPU_STATUS_LEN from DSDT
pc: acpi: cpuhp: move CPEJ() method to SSDT
pc: acpi: cpuhp: move CPMA() method into SSDT
pc: acpi: cpuhp: move CPST() method into SSDT
pc: acpi: cpuhp: move PRSC() method into SSDT
pc: acpi: cpuhp: move \_GPE._E02() into SSDT
pc: acpi: factor out cpu hotplug code from build_ssdt() into separate function
pc: acpi: move HPET from DSDT to SSDT
pc: acpi: move DBUG() from DSDT to SSDT
pc: acpi: move RTC device from DSDT to SSDT
pc: acpi: move KBD device from DSDT to SSDT
pc: acpi: move MOU device from DSDT to SSDT
pc: acpi: move FDC0 device from DSDT to SSDT
pc: acpi: move LPT device from DSDT to SSDT
pc: acpi: move COM devices from DSDT to SSDT
pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT
pc: acpi: move remaining GPE handlers into SSDT
pc: acpi: pci: move link devices into SSDT
pc: acpi: piix4: move IQCR() into SSDT
pc: acpi: piix4: move IQST() into SSDT
pc: acpi: piix4: move PCI0._PRT() into SSDT
pc: acpi: piix4: move remaining PCI hotplug bits into SSDT
pc: acpi: piix4: acpi move PCI0 device to SSDT
pc: acpi: q35: move GSI links to SSDT
pc: acpi: q35: move link devices to SSDT
pc: acpi: q35: move IQCR() into SSDT
pc: acpi: q35: move IQST() into SSDT
pc: acpi: q35: move ISA bridge into SSDT
pc: acpi: q35: move _PRT() into SSDT
pc: acpi: q35: move PRTA routing table into SSDT
pc: acpi: q35: move PRTP routing table into SSDT
pc: acpi: q35: move _PIC() method into SSDT
pc: acpi: q35: move PCI0._OSC() method into SSDT
pc: acpi: q35: move PCI0 device definition into SSDT
pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT
pc: acpi: switch to AML API composed DSDT
pc: acpi: remove unused ASL templates and related blobs/utils
Laszlo Ersek (1):
hw/i386: fill in the CENTURY field of the FADT (FACP) ACPI table
Roman Kagan (1):
i386/pc: expose identifying the floppy controller
Tetsuya Mukawa (1):
ivshmem: Store file descriptor for vhost-user negotiation
include/exec/ram_addr.h | 1 + include/hw/acpi/aml-build.h | 3 + include/hw/acpi/cpu_hotplug.h | 10 + include/hw/acpi/memory_hotplug.h | 9 + include/hw/acpi/pc-hotplug.h | 44 +- include/hw/i386/pc.h | 2 + include/hw/timer/hpet.h | 1 + include/migration/vmstate.h | 13 + exec.c | 10 + hw/acpi/cpu_hotplug_acpi_table.c | 135 + hw/acpi/memory_hotplug_acpi_table.c | 262 ++ hw/acpi/nvdimm.c | 8 +- hw/i386/acpi-build.c | 1369 +++++-- hw/i386/pc.c | 44 +- hw/misc/ivshmem.c | 9 +- hw/pci-host/piix.c | 8 +- hw/timer/hpet.c | 2 +- hw/virtio/virtio.c | 89 +- tests/bios-tables-test.c | 16 + hw/acpi/Makefile.objs | 4 +- hw/i386/Makefile.objs | 30 - hw/i386/acpi-dsdt-cpu-hotplug.dsl | 90 - hw/i386/acpi-dsdt-dbug.dsl | 41 - hw/i386/acpi-dsdt-hpet.dsl | 48 - hw/i386/acpi-dsdt-isa.dsl | 117 - hw/i386/acpi-dsdt-mem-hotplug.dsl | 171 - hw/i386/acpi-dsdt.dsl | 303 -- hw/i386/acpi-dsdt.hex.generated | 2972 -------------- hw/i386/q35-acpi-dsdt.dsl | 436 -- hw/i386/q35-acpi-dsdt.hex.generated | 7610 ----------------------------------- scripts/acpi_extract.py | 367 -- scripts/acpi_extract_preprocess.py | 51 - scripts/update-acpi.sh | 4 - 33 files changed, 1690 insertions(+), 12589 deletions(-) create mode 100644 hw/acpi/cpu_hotplug_acpi_table.c create mode 100644 hw/acpi/memory_hotplug_acpi_table.c delete mode 100644 hw/i386/acpi-dsdt-cpu-hotplug.dsl delete mode 100644 hw/i386/acpi-dsdt-dbug.dsl delete mode 100644 hw/i386/acpi-dsdt-hpet.dsl delete mode 100644 hw/i386/acpi-dsdt-isa.dsl delete mode 100644 hw/i386/acpi-dsdt-mem-hotplug.dsl delete mode 100644 hw/i386/acpi-dsdt.dsl delete mode 100644 hw/i386/acpi-dsdt.hex.generated delete mode 100644 hw/i386/q35-acpi-dsdt.dsl delete mode 100644 hw/i386/q35-acpi-dsdt.hex.generated delete mode 100755 scripts/acpi_extract.py delete mode 100755 scripts/acpi_extract_preprocess.py delete mode 100644 scripts/update-acpi.sh
[Qemu-devel] [PULL 01/59] nvdimm: fix header pointer in nvdimm_build_nfit()
From: Haozhong Zhang <[email protected]>
In the current nvdimm_build_nfit(), the pointer 'header' initially equals to table_data->data + table_data->len. However, the following g_array_append_vals(table_data, structures->data, structures->len) may resize and relocate table_data->data[]. Therefore, the usage of 'header' afterwards may be illegal.
This patch fixes this issue by storing an offset within table_data->data[] (rather than an address) in 'header'.
--- hw/acpi/nvdimm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/acpi/nvdimm.c +5 -3
@@ -353,16 +353,18 @@ static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets, GArray *table_data, GArray *linker) {GArray *structures =nvdimm_build_device_structure (device_list); -void *header; +unsigned int header;acpi_add_table (table_offsets, table_data);/* NFIT header. */ - header =acpi_data_push (table_data,sizeof (NvdimmNfitHeader)); + header = table_data->len; +acpi_data_push (table_data,sizeof (NvdimmNfitHeader));/* NVDIMM device structures. */ g_array_append_vals (table_data, structures->data, structures->len); -build_header (linker, table_data, header,"NFIT" , +build_header (linker, table_data, + (void *)(table_data->data + header),"NFIT" ,sizeof (NvdimmNfitHeader) + structures->len,1 ,NULL );g_array_free (structures, true); }
Signature · 1 line
MST
[Qemu-devel] [PULL 02/59] igd-passthrough: fix use of host_pci_config_read
In reply to Michael S. TsirkinFrom: Cao jin <[email protected]>
Fix the bug introduced by 595a4f07: function host_pci_config_read() should be pass-by-reference, not value.
This probably means this function never worked for anyone.
--- hw/pci-host/piix.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/pci-host/piix.c +5 -3
@@ -761,7 +761,7 @@ static const IGDHostInfo igd_host_bridge_infos[] = { {0xa8, 4}, /* SNB: base of GTT stolen memory */ }; -static int host_pci_config_read (int pos,int len,uint32_t val) +static int host_pci_config_read (int pos,int len,uint32_t *val) {char path[PATH_MAX ];int config_fd;
@@ -784,12 +784,14 @@ static int host_pci_config_read(int pos, int len, uint32_t val) ret = -errno; goto out; } +do { - rc =read (config_fd, (uint8_t *)&val, len); + rc =read (config_fd, (uint8_t *)val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) { ret = -errno; } + out:close (config_fd);return ret;
@@ -805,7 +807,7 @@ static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev)for (i =0 ; i < num; i++) { pos = igd_host_bridge_infos[i].offset; len = igd_host_bridge_infos[i].len; - rc =host_pci_config_read (pos, len, val); + rc =host_pci_config_read (pos, len, &val);if (rc) {return -ENODEV ; }
Signature · 1 line
MST
[Qemu-devel] [PULL 03/59] hw/i386: fill in the CENTURY field of the FADT (FACP) ACPI table
In reply to Michael S. TsirkinFrom: Laszlo Ersek <[email protected]>
The ACPI specification (minimally versions 1.0b through 6.0) define the FADT.CENTURY field as:
The RTC CMOS RAM index to the century of data value (hundred and thousand year decimals). If this field contains a zero, then the RTC centenary feature is not supported. If this field has a non-zero value, then this field contains an index into RTC RAM space that OSPM can use to program the centenary field.
The x86 targets generate ACPI payload, emulate an RTC (CONFIG_MC146818RTC), and that RTC supports the "centenary feature" (see occurrences of RTC_CENTURY in cmos_ioport_write() and cmos_ioport_read() in "hw/timer/mc146818rtc.c".)
However, FADT.CENTURY is left at zero currently:
[06Ch 0108 1] RTC Century Index : 00
which -- according to analysis done by Ruiyu Ni at Intel -- should cause Linux and Windows 8+ to think the RTC centenary feature is unavailable, and cause Windows 7 to (incorrectly) assume that the offset to use is constant 0x32. (0x32 happens to be the right value on QEMU, but Windows 7 is wrong to assume anything at all).
Exposing the right nonzero offset in FADT.CENTURY informs Linux and Windows 8+ about the right capabilities of the hardware, plus it retrofits our FADT to Windows 7's behavior.
Regression tested with the following guests (all UEFI installs):
- i386 Q35: Fedora 21 ("Fedlet" edition)
- x86_64:
- i440fx:
- Fedora 21
- RHEL 6 and 7
- Windows 7 and 10
- Windows Server 2008 R2 and 2012 R2
- Q35:
- Fedora 22
- Windows 8.1
--- hw/i386/acpi-build.c | 2 ++ 1 file changed, 2 insertions(+)
hw/i386/acpi-build.c +2 -0
@@ -43,6 +43,7 @@#include "sysemu/tpm.h" #include "hw/acpi/tpm.h" #include "sysemu/tpm_backend.h" +#include "hw/timer/mc146818rtc_regs.h" /* Supported chipsets: */ #include "hw/acpi/piix4.h"
@@ -335,6 +336,7 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm)if (max_cpus >8 ) { fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } + fadt->century =RTC_CENTURY ; }
Signature · 1 line
MST
Quoted 10 lines · Michael S. Tsirkin
The following changes since commit
6bb9ead762bf749af11ea225fc2a74db1b93c105:Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging (2016-01-08 12:50:19 +0000)
are available in the git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
88e6cd937bc5dd4b972aaee18b6adc92b33b46c6:
Quoted 8 lines
virtio: fix error message for number of queues (2016-01-08 16:01:40 +0200)
----------------------------------------------------------------
acpi dsdt rework, misc fixesThis completes the dsdt rewrite, and includes misc fixes all over the place.
Signed-off-by Michael S. Tsirkin <[email protected]>
Still fails to build on w32 for the same reason:/home/petmay01/linaro/qemu-for-merges/hw/acpi/memory_hotplug_acpi_table.c:
In function ‘build_memory_hotplug_aml’:/home/petmay01/linaro/qemu-for-merges/hw/acpi/memory_hotplug_acpi_table.c:148:
warning: integer constant is too large for ‘long’ type /home/petmay01/linaro/qemu-for-merges/hw/acpi/memory_hotplug_acpi_table.c:149:
warning: integer constant is too large for ‘long’ type
thanks
-- PMM
PATCH 1/1 pc: acpi: fix build fail on w32
build fail with warnings on w32 compiler:
hw/acpi/memory_hotplug_acpi_table.c:
In function ‘build_memory_hotplug_aml’:hw/acpi/memory_hotplug_acpi_table.c:148:
warning: integer constant is too large for ‘long’ type hw/acpi/memory_hotplug_acpi_table.c:149:
warning: integer constant is too large for ‘long’ type
fix it by expilictly saying that int const is 64bit number
--- hw/acpi/memory_hotplug_acpi_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/acpi/memory_hotplug_acpi_table.c +2 -2
@@ -145,8 +145,8 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (crs_tmpl,aml_qword_memory (AML_POS_DECODE ,AML_MIN_FIXED ,AML_MAX_FIXED ,AML_CACHEABLE ,AML_READ_WRITE , -0 ,0x0 ,0xFFFFFFFFFFFFFFFE ,0 , -0xFFFFFFFFFFFFFFFF )); +0 ,0x0 ,0xFFFFFFFFFFFFFFFEULL ,0 , +0xFFFFFFFFFFFFFFFFULL ));aml_append (method,aml_name_decl ("MR64" , crs_tmpl));aml_append (method,aml_create_dword_field (mr64,aml_int (14 ),"MINL" ));
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH] pc: acpi: fix build fail on w32
Quoted 9 lines · Igor Mammedov
build fail with warnings on w32 compiler:
hw/acpi/memory_hotplug_acpi_table.c:
In function ‘build_memory_hotplug_aml’:hw/acpi/memory_hotplug_acpi_table.c:148:
warning: integer constant is too large for ‘long’ typehw/acpi/memory_hotplug_acpi_table.c:149:
warning: integer constant is too large for ‘long’ type
Quoted 3 lines
fix it by expilictly saying that int const is 64bit number
Signed-off-by Igor Mammedov <[email protected]>
thanks!
Make it a fixup! patch next time pls.
Quoted 21 lines
--- hw/acpi/memory_hotplug_acpi_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/acpi/memory_hotplug_acpi_table.c +2
-2@@ -145,8 +145,8 @@ void build_memory_hotplug_aml(Aml *ctx, uint32_t nr_mem,aml_append (crs_tmpl,aml_qword_memory (AML_POS_DECODE ,AML_MIN_FIXED ,AML_MAX_FIXED ,AML_CACHEABLE ,AML_READ_WRITE , -0 ,0x0 ,0xFFFFFFFFFFFFFFFE ,0 , -0xFFFFFFFFFFFFFFFF )); +0 ,0x0 ,0xFFFFFFFFFFFFFFFEULL ,0 , +0xFFFFFFFFFFFFFFFFULL ));aml_append (method,aml_name_decl ("MR64" , crs_tmpl));aml_append (method,aml_create_dword_field (mr64,aml_int (14 ),"MINL" ));Signature · 1 line
1.8.3.1