[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/22] x86: acpi: workaround Windows not handling name references
From: |
Michael S. Tsirkin |
Subject: |
[PULL 06/22] x86: acpi: workaround Windows not handling name references in Package properly |
Date: |
Thu, 3 Aug 2023 18:21:03 -0400 |
From: Igor Mammedov <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>
Message-Id: <20230720133858.1974024-3-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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))
--
MST
- [PULL 00/22] pc,pci,virtio,crypto: bugfixes, Michael S. Tsirkin, 2023/08/03
- [PULL 01/22] hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command(), Michael S. Tsirkin, 2023/08/03
- [PULL 02/22] hw/pci-bridge/cxl_upstream.c: Use g_new0() in build_cdat_table(), Michael S. Tsirkin, 2023/08/03
- [PULL 03/22] virtio-iommu: Standardize granule extraction and formatting, Michael S. Tsirkin, 2023/08/03
- [PULL 04/22] hw/virtio: Add a protection against duplicate vu_scmi_stop calls, Michael S. Tsirkin, 2023/08/03
- [PULL 05/22] tests: acpi: x86: whitelist expected blobs, Michael S. Tsirkin, 2023/08/03
- [PULL 06/22] x86: acpi: workaround Windows not handling name references in Package properly,
Michael S. Tsirkin <=
- [PULL 08/22] tests: acpi: whitelist expected blobs, Michael S. Tsirkin, 2023/08/03
- [PULL 07/22] tests: acpi: x86: update expected blobs, Michael S. Tsirkin, 2023/08/03
- [PULL 09/22] acpi: x86: remove _ADR on host bridges, Michael S. Tsirkin, 2023/08/03
- [PULL 10/22] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/08/03
- [PULL 11/22] hw/virtio: qmp: add RING_RESET to 'info virtio-status', Michael S. Tsirkin, 2023/08/03
- [PULL 12/22] virtio: Fix packed virtqueue used_idx mask, Michael S. Tsirkin, 2023/08/03
- [PULL 13/22] pci: do not respond config requests after PCI device eject, Michael S. Tsirkin, 2023/08/03
- [PULL 14/22] vhost: fix the fd leak, Michael S. Tsirkin, 2023/08/03