bios: Use the correct mask to size the PCI option ROM BAR
[qemu/aliguori-queue.git] / pc-bios / bios-pq / 0016-use-correct-mask-to-size-pci-option-rom-bar.patch
blob556a0bda796b5ac453ae4fd01b8fe95cf4c85cdb
1 Subject: [PATCH] bios: Use the correct mask to size the PCI option ROM BAR
2 From: Alex Williamson <alex.williamson@hp.com>
4 Bit 0 is the enable bit, which we not only don't want to set, but
5 it will stick and make us think it's an I/O port resource.
7 Signed-off-by: Alex Williamson <alex.williamson@hp.com>
8 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
9 ---
11 diff --git a/bios/rombios32.c b/bios/rombios32.c
12 index d7e18e9..f861f81 100644
13 --- a/bios/rombios32.c
14 +++ b/bios/rombios32.c
15 @@ -985,11 +985,13 @@ static void pci_bios_init_device(PCIDevice *d)
16 int ofs;
17 uint32_t val, size ;
19 - if (i == PCI_ROM_SLOT)
20 + if (i == PCI_ROM_SLOT) {
21 ofs = 0x30;
22 - else
23 + pci_config_writel(d, ofs, 0xfffffffe);
24 + } else {
25 ofs = 0x10 + i * 4;
26 - pci_config_writel(d, ofs, 0xffffffff);
27 + pci_config_writel(d, ofs, 0xffffffff);
28 + }
29 val = pci_config_readl(d, ofs);
30 if (val != 0) {
31 size = (~(val & ~0xf)) + 1;