The hardcoded device names can cause false-positives on Windows bios version checks. Use the %pP format to avoid that.
Reported-by: Sam Eiderman shmuel.eiderman@oracle.com Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/fw/pciinit.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index c0634bc..d5e87f0 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -292,12 +292,10 @@ static void intel_igd_setup(struct pci_device *dev, void *arg) { struct romfile_s *opregion = romfile_find("etc/igd-opregion"); u64 bdsm_size = le64_to_cpu(romfile_loadint("etc/igd-bdsm-size", 0)); - void *addr; - u16 bdf = dev->bdf;
/* Apply OpRegion to any Intel VGA device, more than one is undefined */ if (opregion && opregion->size) { - addr = memalign_high(PAGE_SIZE, opregion->size); + void *addr = memalign_high(PAGE_SIZE, opregion->size); if (!addr) { warn_noalloc(); return; @@ -308,16 +306,15 @@ static void intel_igd_setup(struct pci_device *dev, void *arg) return; }
- pci_config_writel(bdf, 0xFC, cpu_to_le32((u32)addr)); + pci_config_writel(dev->bdf, 0xFC, cpu_to_le32((u32)addr));
- dprintf(1, "Intel IGD OpRegion enabled at 0x%08x, size %dKB, dev " - "%02x:%02x.%x\n", (u32)addr, opregion->size >> 10, - pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf)); + dprintf(1, "Intel IGD OpRegion enabled at 0x%08x, size %dKB, dev %pP\n" + , (u32)addr, opregion->size >> 10, dev); }
/* Apply BDSM only to Intel VGA at 00:02.0 */ - if (bdsm_size && (bdf == pci_to_bdf(0, 2, 0))) { - addr = memalign_tmphigh(1024 * 1024, bdsm_size); + if (bdsm_size && (dev->bdf == pci_to_bdf(0, 2, 0))) { + void *addr = memalign_tmphigh(1024 * 1024, bdsm_size); if (!addr) { warn_noalloc(); return; @@ -325,10 +322,10 @@ static void intel_igd_setup(struct pci_device *dev, void *arg)
e820_add((u32)addr, bdsm_size, E820_RESERVED);
- pci_config_writel(bdf, 0x5C, cpu_to_le32((u32)addr)); + pci_config_writel(dev->bdf, 0x5C, cpu_to_le32((u32)addr));
- dprintf(1, "Intel IGD BDSM enabled at 0x%08x, size %lldMB, dev " - "00:02.0\n", (u32)addr, bdsm_size >> 20); + dprintf(1, "Intel IGD BDSM enabled at 0x%08x, size %lldMB, dev %pP\n" + , (u32)addr, bdsm_size >> 20, dev); } }
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/hw/virtio-pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 96f9c6b..d543521 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -417,9 +417,8 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) vp->device.cfg = cap; vp->device.bdf = pci->bdf; vp_cap = NULL; - dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d [pci cfg access]\n", - pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf), - cap, type); + dprintf(1, "pci dev %pP virtio cap at 0x%x type %d" + " [pci cfg access]\n", pci, cap, type); break; default: vp_cap = NULL; @@ -473,10 +472,9 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) mode = "Huh?"; break; } - dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d " + dprintf(1, "pci dev %pP virtio cap at 0x%x type %d " "bar %d at 0x%08llx off +0x%04x [%s]\n", - pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf), - vp_cap->cap, type, vp_cap->bar, addr, offset, mode); + pci, vp_cap->cap, type, vp_cap->bar, addr, offset, mode); }
cap = pci_find_capability(pci->bdf, PCI_CAP_ID_VNDR, cap);
Hey,
What is the status on these patches?
Sam
On 23 May 2019, at 18:39, Kevin O'Connor kevin@koconnor.net wrote:
Signed-off-by: Kevin O'Connor kevin@koconnor.net
src/hw/virtio-pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 96f9c6b..d543521 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -417,9 +417,8 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) vp->device.cfg = cap; vp->device.bdf = pci->bdf; vp_cap = NULL;
dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d [pci cfg access]\n",
pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
cap, type);
dprintf(1, "pci dev %pP virtio cap at 0x%x type %d"
" [pci cfg access]\n", pci, cap, type); break; default: vp_cap = NULL;
@@ -473,10 +472,9 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) mode = "Huh?"; break; }
dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d "
dprintf(1, "pci dev %pP virtio cap at 0x%x type %d " "bar %d at 0x%08llx off +0x%04x [%s]\n",
pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
vp_cap->cap, type, vp_cap->bar, addr, offset, mode);
pci, vp_cap->cap, type, vp_cap->bar, addr, offset, mode); } cap = pci_find_capability(pci->bdf, PCI_CAP_ID_VNDR, cap);
-- 2.17.2 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org
On Mon, Jun 10, 2019 at 10:48:31AM +0300, Sam Eiderman wrote:
Hey,
What is the status on these patches?
I just committed them.
Thanks, -Kevin
On 23 May 2019, at 18:39, Kevin O'Connor kevin@koconnor.net wrote:
Signed-off-by: Kevin O'Connor kevin@koconnor.net
src/hw/virtio-pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 96f9c6b..d543521 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -417,9 +417,8 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) vp->device.cfg = cap; vp->device.bdf = pci->bdf; vp_cap = NULL;
dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d [pci cfg access]\n",
pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
cap, type);
dprintf(1, "pci dev %pP virtio cap at 0x%x type %d"
" [pci cfg access]\n", pci, cap, type); break; default: vp_cap = NULL;
@@ -473,10 +472,9 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) mode = "Huh?"; break; }
dprintf(1, "pci dev %x:%x virtio cap at 0x%x type %d "
dprintf(1, "pci dev %pP virtio cap at 0x%x type %d " "bar %d at 0x%08llx off +0x%04x [%s]\n",
pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf),
vp_cap->cap, type, vp_cap->bar, addr, offset, mode);
pci, vp_cap->cap, type, vp_cap->bar, addr, offset, mode); } cap = pci_find_capability(pci->bdf, PCI_CAP_ID_VNDR, cap);
-- 2.17.2 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org