From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Schmauss, Erik" <erik.schmauss@intel.com>
Cc: "imammedo@redhat.com" <imammedo@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"He, Junyan" <junyan.he@intel.com>,
"Moore, Robert" <robert.moore@intel.com>
Subject: Re: [Qemu-devel] RFC: altering the NVDIMM acpi table
Date: Tue, 24 Apr 2018 00:11:39 +0300 [thread overview]
Message-ID: <20180424000615-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CF6A88132359CE47947DB4C6E1709ED53973A6AF@ORSMSX110.amr.corp.intel.com>
On Mon, Apr 23, 2018 at 08:35:45PM +0000, Schmauss, Erik wrote:
> Hello,
>
> I work on ACPICA and we have recently made changes to the behavior of
> the Linux AML interpreter to match other OS implementations. After
> sending the patches to upstream Linux, we have identified that
> hw/acpi/nvdimm.c specifies an ACPI table with a forward reference
> (MEMA is a forward reference that is no longer supported as of Linux
> 4.17-rc1).
>
> We would like to change this file to move the declaration of Name
> (MEMA,...) to appear as the very first declaration in the SSDT. Below is a patch outlining the change that I would like to make.
> However, I am having a hard time getting make check to run
> to completion in a reasonable amount of time. It always seems to fail
> on some sort of checksum test... It would be great if you could let me
> know what you think of the change and what I can do to speed up the
> execution time of make check...
>
>
> Thanks,
>
> Erik Schmauss
>
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index 59d6e4254c..7c9efd9ac7 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -1234,6 +1234,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
> ssdt = init_aml_allocator();
> acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
>
> + mem_addr_offset = build_append_named_dword(table_data,
> + NVDIMM_ACPI_MEM_ADDR);
> +
> sb_scope = aml_scope("\\_SB");
Hmm I suspect this won't work because you are appending to
table_data, but the ssdt header isn't there yet - it's
in ssdt at this point.
Look at hw/acpi/vmgenid.c for how to do it right:
vgia_offset = table_data->len +
build_append_named_dword(ssdt->buf, "VGIA");
ugly, but works.
>
> dev = aml_device("NVDR");
> @@ -1266,9 +1269,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,
> sizeof(NvdimmDsmIn), false /* high memory */);
prev parent reply other threads:[~2018-04-23 21:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 20:35 [Qemu-devel] RFC: altering the NVDIMM acpi table Schmauss, Erik
2018-04-23 20:57 ` Michael S. Tsirkin
2018-04-23 23:05 ` Michael S. Tsirkin
2018-04-24 0:28 ` Schmauss, Erik
2018-04-23 21:00 ` Dan Williams
2018-04-23 21:11 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180424000615-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=erik.schmauss@intel.com \
--cc=imammedo@redhat.com \
--cc=junyan.he@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).