Page MenuHomeFreeBSD

Use x86 generic code to do the hypervisor detection for hv
ClosedPublic

Authored by howard0su_gmail.com on Jul 14 2015, 2:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 2:40 PM
Unknown Object (File)
Fri, Dec 20, 2:25 PM
Unknown Object (File)
Fri, Dec 20, 2:10 PM
Unknown Object (File)
Fri, Dec 20, 1:47 PM
Unknown Object (File)
Fri, Dec 20, 1:47 PM
Unknown Object (File)
Fri, Dec 20, 1:44 PM
Unknown Object (File)
Tue, Dec 10, 12:05 AM
Unknown Object (File)
Fri, Dec 6, 10:36 PM
Subscribers

Details

Summary

This is first step to move the generic part of HV code into kernel instead of module,

so that it is possible to use hypercall to implement some other paravirtualization code in the kernel.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1861
Build 1868: arc lint + arc unit

Event Timeline

howard0su_gmail.com retitled this revision from to Use x86 generic code to do the hypervisor detection for hv.
howard0su_gmail.com updated this object.
howard0su_gmail.com edited the test plan for this revision. (Show Details)

Make hyperv driver match FreeBSD device driver better.

I have a couple of comments, but I would really like Wei to take a look at this.

sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
719

Does this need to depend on ACPI? Is the description for the HyperV paravirtualized devices coming from ACPI tables?

sys/x86/x86/identcpu.c
1335

I'm not really sure this is right, but I might be missing something. AFAICT if smbios.system.product contains "Virtual Machine" the guest type will be set to VM_GUEST_HV which is wrong because Virtual PC is not the same as HyperV.

howard0su_gmail.com edited edge metadata.

Address code review feedback.

Thanks for the updated diff, I see that one of my initial comments has not yet been addressed or replied. Wei, can you also please take a look?

sys/dev/hyperv/vmbus/hv_connection.c
254

Is this really meant to be "Protocal" and not "Protocol"?

sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
719

I see no fix and no comment clarifying this, please either reply to the comment or leave the code as-is.

sorry didn't realize that I didn't submit my comments.

sys/dev/hyperv/vmbus/hv_connection.c
254

Protocol.

sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
719

Yes. the paravirtualized bus called VMBUS is attached to ACPI bus.

719

this is a dump from my hyperv VM of devinfo -v. (I removed non related information)
nexus0

acpi0
  unknown pnpinfo _HID=VMBUS _UID=0 at handle=\_SB_.PCI0.SBRG.VMBS (disabled)
  vmbus0 pnpinfo _HID=VMBUS _UID=0 at handle=\_SB_.PCI0.SBRG.VMB8
    storvsc0
    unknown
    unknown
    unknown
sys/x86/x86/identcpu.c
1335

good point. I will revert this.

Looks good to me overall.

sys/x86/x86/identcpu.c
165

I really doubt if the compiler would be able to make use of the other 3 bytes in this array :)

Revert vendor string size back to 16

royger edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 11 2016, 5:42 PM
adrian added a reviewer: adrian.
This revision was automatically updated to reflect the committed changes.