qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] acpi/nvdimm: remove forward name references
@ 2018-04-23 23:02 Michael S. Tsirkin
  2018-04-24  0:41 ` Schmauss, Erik
  0 siblings, 1 reply; 13+ messages in thread
From: Michael S. Tsirkin @ 2018-04-23 23:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Schmauss, Erik, Igor Mammedov, Xiao Guangrong

NVDIMM SSDT table references a name ("MEMA") before
it is defined. This is reported to no longer be supported
since Linux 4.17-rc1.

While arguably Linux needs to keep working on old hypervisors, and other
OSes seem fine with our behaviour, it seems cleaner to have the
definition appear in the SSDT before use.

Suggested-by: "Schmauss, Erik" <erik.schmauss@intel.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

Hi Erik,
could you pls test the issue and report whether it addresses
your concern? I can't do much to fix past releases which IIUC
shipped this code since 2.6.0 about a year ago.

Lightly tested with Linux only.

 hw/acpi/nvdimm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 59d6e42..fadebbd 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -1234,6 +1234,10 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
     ssdt = init_aml_allocator();
     acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
 
+    /* Storage for the memory address */
+    mem_addr_offset = table_data->len +
+        build_append_named_dword(ssdt->buf, NVDIMM_ACPI_MEM_ADDR);
+
     sb_scope = aml_scope("\\_SB");
 
     dev = aml_device("NVDR");
@@ -1266,8 +1270,6 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
 
     /* copy AML table into ACPI tables blob and patch header there */
     g_array_append_vals(table_data, ssdt->buf->data, ssdt->buf->len);
-    mem_addr_offset = build_append_named_dword(table_data,
-                                               NVDIMM_ACPI_MEM_ADDR);
 
     bios_linker_loader_alloc(linker,
                              NVDIMM_DSM_MEM_FILE, dsm_dma_arrea,
-- 
MST

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-04-25 18:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 23:02 [Qemu-devel] [PATCH] acpi/nvdimm: remove forward name references Michael S. Tsirkin
2018-04-24  0:41 ` Schmauss, Erik
2018-04-24  1:02   ` Michael S. Tsirkin
2018-04-24  7:57     ` Igor Mammedov
2018-04-24 17:43       ` Michael S. Tsirkin
2018-04-24 17:47         ` Schmauss, Erik
2018-04-24 18:06           ` Michael S. Tsirkin
2018-04-25 13:49             ` Igor Mammedov
2018-04-25 13:56               ` Igor Mammedov
2018-04-25 14:17               ` Michael S. Tsirkin
2018-04-25 15:31                 ` Igor Mammedov
2018-04-25 16:47                   ` Schmauss, Erik
2018-04-25 18:30                     ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).