Page MenuHomeFreeBSD

hyperv/vmbus: add new vmbus methods to support PCIe pass-through
ClosedPublic

Authored by decui_microsoft.com on Nov 1 2016, 9:20 AM.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 5784
Build 6087: arc lint + arc unit

Event Timeline

decui_microsoft.com retitled this revision from to hyperv/vmbus: add new vmbus methods to support PCIe pass-through.
decui_microsoft.com updated this object.
decui_microsoft.com edited the test plan for this revision. (Show Details)
sys/dev/hyperv/vmbus/vmbus_if.m
49

This replaced by:
vmbus_chan_guid_inst(vmbus_get_channel(dev))

sys/dev/hyperv/vmbus/vmbus_if.m
49

OK, will remove this method.

removed the get instance guid method, and moved the get_vcpu_id method to a separate patch (https://reviews.freebsd.org/D8410)

sys/dev/hyperv/vmbus/vmbus.c
47–52

Move sys/rman.h to the above inclusion group. Group machine/*.h together

59

Move this after "acpi_if.h" inclusion. Strip the blank line bewteen dev/pci/*.h and dev/acpica/acpivar.h

sepherosa_gmail.com edited edge metadata.
This revision is now accepted and ready to land.Nov 2 2016, 1:19 AM
decui_microsoft.com edited edge metadata.

This new version addressed Sephe's comments.

This revision now requires review to proceed.Nov 2 2016, 2:27 AM
decui_microsoft.com marked 2 inline comments as done.Nov 2 2016, 2:31 AM

I uploaded the new version to address the comments.

sepherosa_gmail.com edited edge metadata.

Ship it!

This revision is now accepted and ready to land.Nov 2 2016, 2:31 AM
jhb edited edge metadata.Nov 2 2016, 4:43 PM

This looks fine. Note that there is some existing code this somewhat duplicates. For example, the ACPI Host-PCI bridge driver also parses _CRS to determine valid ranges. It uses the pcib_host_res_* API to add those ranges to a list that it then iterates on allocation requests. I'm not sure if does the same trick of preferring > 4G ranges for 64-bit BARs (though if pcib_host_res_*() would otherwise work for you I'd be fine with fixing it to do the same).

In D8409#175275, @jhb wrote:

This looks fine. Note that there is some existing code this somewhat duplicates. For example, the ACPI Host-PCI bridge driver also parses _CRS to determine valid ranges. It uses the pcib_host_res_* API to add those ranges to a list that it then iterates on allocation requests. I'm not sure if does the same trick of preferring > 4G ranges for 64-bit BARs (though if pcib_host_res_*() would otherwise work for you I'd be fine with fixing it to do the same).

Hmm, we probably can reuse the existing APIs, but do two pass decodes, the first pass adds the 64-bits BARs, the second one adds 32-bits BARs.

Hi jhb, Thanks for the suggestion! I'll update the patch with the pcib_host_res_* APIs.

In D8409#175275, @jhb wrote:

This looks fine. Note that there is some existing code this somewhat duplicates. For example, the ACPI Host-PCI bridge driver also parses _CRS to determine valid ranges. It uses the pcib_host_res_* API to add those ranges to a list that it then iterates on allocation requests. I'm not sure if does the same trick of preferring > 4G ranges for 64-bit BARs (though if pcib_host_res_*() would otherwise work for you I'd be fine with fixing it to do the same).

Hmm, we probably can reuse the existing APIs, but do two pass decodes, the first pass adds the 64-bits BARs, the second one adds 32-bits BARs.

Good suggestion! I've made a patch with the 2-pass method. Will upload it shortly.

decui_microsoft.com edited edge metadata.

This new version addressed jhb and sephe's comments.

This revision now requires review to proceed.Nov 3 2016, 9:13 AM
sepherosa_gmail.com edited edge metadata.
This revision is now accepted and ready to land.Nov 3 2016, 9:32 AM
This revision was automatically updated to reflect the committed changes.