Page MenuHomeFreeBSD

bhyve: Add PCI mappings for arm64
ClosedPublic

Authored by markj on Sep 5 2023, 6:18 PM.
Tags
None
Referenced Files
F102456356: D41739.diff
Tue, Nov 12, 1:13 PM
Unknown Object (File)
Wed, Nov 6, 8:03 PM
Unknown Object (File)
Tue, Nov 5, 9:21 AM
Unknown Object (File)
Mon, Oct 21, 5:11 PM
Unknown Object (File)
Sun, Oct 20, 5:20 AM
Unknown Object (File)
Wed, Oct 16, 12:58 AM
Unknown Object (File)
Wed, Oct 16, 12:58 AM
Unknown Object (File)
Mon, Oct 14, 10:33 PM
Subscribers

Details

Summary

Obtained from https://github.com/zxombie/freebsd/tree/bhyvearm64 .

  • The extended config space and BAR ranges are listed in the FDT.
  • Avoid referencing I/O ports in ACPI tables. Currently the arm64 port does not support ACPI in any case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Sep 5 2023, 6:18 PM
usr.sbin/bhyve/pci_emul.c
153

Hmm, this is kind of curious. Do you need to disable sysres0 entirely on arm64? This just ensures that acpi_sysresX reserves this phys addr range so that the guest OS won't try to allocate it to anything else (e.g. for BARs)

1649

Could you add a similar layout comment for arm64?

1810

Do you still need some sort of producer _CRS entry for the mmio region that backs I/O resources?

markj marked 2 inline comments as done.

Address review comments.

This revision is now accepted and ready to land.Sep 6 2023, 4:34 PM
usr.sbin/bhyve/pci_emul.c
153

The mechanical reason for this part of the change is that sysres regions are handled by the LPC device model, but that's not present on arm64. There's no reason that can't be factored out, I think, but since we currently don't support ACPI for arm64, there's no need to use this macro to define fixed resources.

Though, currently the ECFG range is duplicated in the FDT-building code (the "bus-range" property in the pcie node). I need to find some way to deduplicate, perhaps also using this kind of linker set approach. Hmm, but it looks like pci_host_generic_setup_fdt() ignores that range anyway, see the TODO comment...

1810

Note that we currently don't support ACPI at all, though on a second though there is no reason to exclude this particular bit of code.

usr.sbin/bhyve/pci_emul.c
153

I wonder if we should nop-out the macros instead for now so that once ACPI is implemented it would just be one place to fix vs chasing all of them down?

markj marked 2 inline comments as done.Sep 7 2023, 1:26 PM
markj added inline comments.
usr.sbin/bhyve/pci_emul.c
153

Currently this is the only use of the macro, so I don't think it makes much of a difference.

jhb requested changes to this revision.Sep 7 2023, 9:04 PM
This revision now requires changes to proceed.Sep 7 2023, 9:04 PM
This revision is now accepted and ready to land.Sep 7 2023, 9:04 PM
This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.