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)
Tue, Nov 26, 5:46 AM
Unknown Object (File)
Mon, Nov 25, 3:26 PM
Unknown Object (File)
Fri, Nov 22, 5:06 PM
Unknown Object (File)
Thu, Nov 21, 12:30 AM
Unknown Object (File)
Tue, Nov 19, 2:42 PM
Unknown Object (File)
Thu, Nov 14, 1:03 AM
Unknown Object (File)
Tue, Nov 12, 1:13 PM
Unknown Object (File)
Wed, Nov 6, 8:03 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 53468
Build 50359: arc lint + arc unit

Event Timeline

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

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)

1650

Could you add a similar layout comment for arm64?

1811

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
154

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...

1811

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
154

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
154

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.