Commit 4ebc736e authored by Laszlo Ersek's avatar Laszlo Ersek Committed by Michael S. Tsirkin
Browse files

i386/acpi-build: fix PXB workarounds for unsupported BIOSes



The patch

  apci: fix PXB behaviour if used with unsupported BIOS

uses the following condition to see if a "PXB mem/IO chunk" has *not* been
configured by the BIOS:

  (!range_base || range_base > range_limit)

When this condition evaluates to true, said patch *omits* the
corresponding entry from the _CRS.

Later on the patch checks for the opposite condition (with the intent of
*adding* entries to the _CRS if the "PXB mem/IO chunks" *have* been
configured). Unfortunately, the condition was negated incorrectly: only
the first ! operator was removed, which led to the nonsensical expression

  (range_base || range_base > range_limit)

leading to bogus entries in the _CRS, and causing BSOD in Windows Server
2012 R2 when it runs on OVMF.

The correct negative of the condition seen at the top is

  (range_base && range_base <= range_limit)

Fix the expressions.

Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
Reviewed-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent c96d9286
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -832,7 +832,7 @@ static Aml *build_crs(PCIHostState *host,
             * Work-around for old bioses
             * that do not support multiple root buses
             */
            if (range_base || range_base > range_limit) {
            if (range_base && range_base <= range_limit) {
                aml_append(crs,
                           aml_word_io(AML_MIN_FIXED, AML_MAX_FIXED,
                                       AML_POS_DECODE, AML_ENTIRE_RANGE,
@@ -853,7 +853,7 @@ static Aml *build_crs(PCIHostState *host,
             * Work-around for old bioses
             * that do not support multiple root buses
             */
            if (range_base || range_base > range_limit) {
            if (range_base && range_base <= range_limit) {
                aml_append(crs,
                           aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED,
                                            AML_MAX_FIXED, AML_NON_CACHEABLE,
@@ -875,7 +875,7 @@ static Aml *build_crs(PCIHostState *host,
             * Work-around for old bioses
             * that do not support multiple root buses
             */
            if (range_base || range_base > range_limit) {
            if (range_base && range_base <= range_limit) {
                aml_append(crs,
                           aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED,
                                            AML_MAX_FIXED, AML_NON_CACHEABLE,