[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 42/42] i386/acpi-build: fix PXB workarounds for unsup
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 42/42] i386/acpi-build: fix PXB workarounds for unsupported BIOSes |
Date: |
Thu, 11 Jun 2015 14:01:40 +0200 |
From: Laszlo Ersek <address@hidden>
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 <address@hidden>
Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Laszlo Ersek <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/acpi-build.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 8fae3b9..8e88ade 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -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,
@@ -864,7 +864,7 @@ static Aml *build_crs(PCIHostState *host,
0,
range_limit - range_base + 1));
crs_range_insert(mem_ranges, range_base, range_limit);
- }
+ }
range_base =
pci_bridge_get_base(dev, PCI_BASE_ADDRESS_MEM_PREFETCH);
@@ -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,
--
MST
- [Qemu-devel] [PULL 32/42] virtio-input: core code & base class [pci], (continued)
- [Qemu-devel] [PULL 32/42] virtio-input: core code & base class [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-net.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 33/42] virtio-input: emulated devices [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 35/42] virtio-net.h: Remove unsed DEFINE_VIRTIO_NET_PROPERTIES, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 37/42] virtio-rng: move qdev properties into virtio-rng.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 39/42] virtio-9p-device: move qdev properties into virtio-9p-device.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 38/42] virtio-serial-bus: move qdev properties into virtio-serial-bus.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 40/42] vhost-scsi: move qdev properties into vhost-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 41/42] i386/acpi-build: more traditional _UID and _HID for PXB root buses, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 42/42] i386/acpi-build: fix PXB workarounds for unsupported BIOSes,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 21/42] virtio-pci: correctly set host notifiers for modern bar, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 20/42] virtio-pci: make modern bar 64bit + prefetchable, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 19/42] virtio-pci: change & document virtio pci bar layout., Michael S. Tsirkin, 2015/06/11
- Re: [Qemu-devel] [PULL 00/42] pc, acpi, virtio, Peter Maydell, 2015/06/11