From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, anisinha@redhat.com
Subject: [PATCH for-8.1 2/6] x86: acpi: workaround Windows not handling name references in Package properly
Date: Thu, 20 Jul 2023 15:38:54 +0200 [thread overview]
Message-ID: <20230720133858.1974024-3-imammedo@redhat.com> (raw)
In-Reply-To: <20230720133858.1974024-1-imammedo@redhat.com>
it seems that Windows is unable to handle variable references
making it choke up when accessing ASUN during _DSM call
when device is hotplugged (it lists package elements as DataAlias
but despite that later on it misbehaves) with following error
shown up in AMLI debugger (WS2012r2):
Store(ShiftLeft(One,Arg1="ASUN",) AMLI_ERROR(c0140008): Unexpected argument type
ValidateArgTypes: expected Arg1 to be type Integer (Type=String)
Similar outcome with WS2022.
Issue is not fatal but as result acpi-index/"PCI Label ID" property
is either not shown in device details page or shows incorrect value.
Fix it by doing assignment of BSEL/ASUN values to package
elements manually after package declaration.
Fix was tested with: WS2012r2, WS2022, RHEL9
Fixes: 467d099a2985 (x86: acpi: _DSM: use Package to pass parameters)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/acpi-build.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 9c74fa17ad..19d268ff59 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -362,9 +362,13 @@ Aml *aml_pci_device_dsm(void)
{
Aml *params = aml_local(0);
Aml *pkg = aml_package(2);
- aml_append(pkg, aml_name("BSEL"));
- aml_append(pkg, aml_name("ASUN"));
+ aml_append(pkg, aml_int(0));
+ aml_append(pkg, aml_int(0));
aml_append(method, aml_store(pkg, params));
+ aml_append(method,
+ aml_store(aml_name("BSEL"), aml_index(params, aml_int(0))));
+ aml_append(method,
+ aml_store(aml_name("ASUN"), aml_index(params, aml_int(1))));
aml_append(method,
aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1),
aml_arg(2), aml_arg(3), params))
--
2.39.3
next prev parent reply other threads:[~2023-07-20 13:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 13:38 [PATCH for-8.1 0/6] x86: acpi pci fixes Igor Mammedov
2023-07-20 13:38 ` [PATCH for-8.1 1/6] tests: acpi: x86: whitelist expected blobs Igor Mammedov
2023-07-20 13:38 ` Igor Mammedov [this message]
2023-07-20 13:38 ` [PATCH for-8.1 3/6] tests: acpi: x86: update " Igor Mammedov
2023-07-20 13:38 ` [PATCH for-8.1 4/6] tests: acpi: whitelist " Igor Mammedov
2023-07-20 13:38 ` [PATCH for-8.1 5/6] acpi: x86: remove _ADR on host bridges Igor Mammedov
2023-07-20 13:38 ` [PATCH for-8.1 6/6] tests: acpi: update expected blobs Igor Mammedov
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=20230720133858.1974024-3-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=anisinha@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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).