From 7a94ad720e6915d6ed1967d154cdc9324561aeb9 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Fri, 11 Feb 2022 09:46:15 -0700 Subject: [PATCH] soc/intel/common/block/acpi: Return existing Object for _DSM subfunction Currently the LPIT Get Constraints _DSM subfunction returns a package containing the path to a nonexistent device (\NULL). This is used to work around an issue with Windows, where returning an empty package will cause a BSOD. However, using this non-existent device can also cause confusion, as on Linux, it shows an error in dmesg, e.g. ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \NULL (20200925/dspkginit-438) Therefore, this patch modifies this returned package slightly to include the path to ACPI_CPU_STRING for CPU 0, which should always be emitted on Intel platforms that use the PEP driver. Tested on google/brya0 on ChromeOS 5.10 kernel Tested with current Windows 11 ISO Signed-off-by: Tim Wawrzynczak Change-Id: If74a1620ff0de33bcdba06e1225c5e28c64253e1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61868 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Shobhit Srivastava --- src/soc/intel/common/block/acpi/pep.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/soc/intel/common/block/acpi/pep.c b/src/soc/intel/common/block/acpi/pep.c index 8419a331f4..c7f1270b36 100644 --- a/src/soc/intel/common/block/acpi/pep.c +++ b/src/soc/intel/common/block/acpi/pep.c @@ -70,15 +70,19 @@ static void read_pmc_lpm_requirements(const struct soc_pmc_lpm *lpm, } /* - * For now there is only one disabled non-existent device, because Windows - * expects at least one device and crashes without it with a bluescreen - * (`INTERNAL_POWER_ERROR`). Returning an empty package does not work. + * Windows expects a non-empty package for this subfunction, otherwise it + * results in a bluescreen (`INTERNAL_POWER_ERROR`); returning an empty package + * does not work. To workaround this, return a package describing a single + * device, one that is known to exist, i.e. ACPI_CPU_STRING. expects at least + * one device and crashes without it with a bluescreen. */ static void lpi_get_constraints(void *unused) { + char path[16]; + /* * Return (Package() { - * Package() { "\NULL", 0, + * Package() { "\_SB.CP00", 0, * Package() { 0, * Package() { 0xff, 0 }}}}) */ @@ -87,7 +91,8 @@ static void lpi_get_constraints(void *unused) { acpigen_write_package(3); { - acpigen_emit_namestring("\\NULL"); + snprintf(path, sizeof(path), CONFIG_ACPI_CPU_STRING, 0); + acpigen_emit_namestring(path); acpigen_write_integer(0); /* device disabled */ acpigen_write_package(2); {