Page MenuHomeFreeBSD

hyperv/vmbus: also find acpi_syscontainer0 for _CRS
AbandonedPublic

Authored by decui_microsoft.com on Apr 28 2017, 9:31 AM.

Details

Summary

This is needed for PCIe pass-through on Hyper-V Generation 2 VM.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8955
Build 9347: arc lint + arc unit

Event Timeline

jhb edited edge metadata.Apr 28 2017, 3:59 PM

Humm, ok I guess. This is a gross hack though that would be fixed by making vmbus a child of whatever device it belongs to. Also, it seems like you should be trying to find _CRS on your parent in the namespace. That wouldn't be on acpi0, but instead you would use something like:

ACPI_STATUS status;
ACPI_HANDLE handle;

status = AcpiGetParent(acpi_get_handle(dev), &handle);
if (ACPI_SUCCESS(status)) {
    device_t parent;

    parent = acpi_get_device(handle);
    if (parent != NULL)
        vmbus_get_crs(parent, dev, pass);
}

This would find the parent of the VMBus device in the ACPI namespace and use that device's device_t.

Sephe will send out a patchset that will handle the issue in a better way.