Page MenuHomeFreeBSD

Support PCI extended config space in bhyve.
ClosedPublic

Authored by neel on Jul 30 2014, 8:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 20 2024, 9:19 PM
Unknown Object (File)
Jan 1 2024, 6:50 AM
Unknown Object (File)
Dec 23 2023, 1:52 AM
Unknown Object (File)
Nov 16 2023, 11:47 AM
Unknown Object (File)
Oct 15 2023, 10:43 AM
Unknown Object (File)
Jul 5 2023, 7:02 AM
Unknown Object (File)
Apr 8 2023, 9:05 PM
Unknown Object (File)
Mar 23 2023, 6:27 AM
Subscribers
None

Details

Reviewers
grehan
jhb
Summary

Add the ACPI MCFG table to advertise the extended config memory window.

Introduce a new flag MEM_F_IMMUTABLE for memory ranges that cannot be deleted
or moved in the guest's address space. The PCI extended config space is an
example of an immutable memory range.

Add emulation for the "movzw" instruction. This instruction is used by FreeBSD
to read a 16-bit extended config space register.

Test Plan
  • Booted FreeBSD/amd64 -current and 9.3, FreeBSD/i386 10.0, OpenBSD/i386 5.5, OpenBSD/amd64 5.4, Centos/amd64 6.4, Ubuntu/amd64 14.04, NetBSD/amd64 6.1.1.
  • Verified that FreeBSD, OpenBSD and Linux are able to access extended config.
  • Verified that MCFG table is generated properly using acpidump.
  • Verified that the memory window used for extended config appears as a reserved memory resource in the ACPI tables.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

neel retitled this revision from to Support PCI extended config space in bhyve..
neel updated this object.
neel edited the test plan for this revision. (Show Details)
neel added reviewers: grehan, jhb.

There is no hurry but just making sure it's on the radar.

grehan edited edge metadata.

Looks good.

At some point it might be worth making the extended config an option (on PCIe support ?). It takes up a bunch of address space, and there's been a request to make more memory available on i386. Though, that would involve changing the PCI hole base address as well.

usr.sbin/bhyve/pci_emul.c
1719

pci_cfgrw ?

This revision is now accepted and ready to land.Aug 5 2014, 6:18 PM
jhb edited edge metadata.

Just some minor nits

usr.sbin/bhyve/pci_emul.c
1739

I think 8-byte config access might not be forbidden when using MCFG. FreeBSD doesn't have a way to do it, but I could maybe see a guest doing it for a 64-bit BAR, etc.

1883

The indentation here looks off?

usr.sbin/bhyve/pci_emul.c
1719

Fixed.

1739

The PCI express spec says that host bridges are not required to support MMIO config space accesses that cross a 32-bit boundary (page 581, "Implementation Note" in version 3.0) so my assumption is that most OSes won't do this.

1883

Fixed.

usr.sbin/bhyve/pci_emul.c
1739

Fair enough.