Page MenuHomeFreeBSD

bhyve: Add PCI mappings for arm64
ClosedPublic

Authored by markj on Sep 5 2023, 6:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 5:36 AM
Unknown Object (File)
Sun, Dec 1, 3:11 AM
Unknown Object (File)
Fri, Nov 29, 7:36 PM
Unknown Object (File)
Fri, Nov 29, 6:58 PM
Unknown Object (File)
Nov 26 2024, 5:46 AM
Unknown Object (File)
Nov 25 2024, 3:26 PM
Unknown Object (File)
Nov 22 2024, 5:06 PM
Unknown Object (File)
Nov 21 2024, 12:30 AM
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.