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, Jun 21, 2:56 AM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 PM
Unknown Object (File)
Sun, Jun 16, 10:17 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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #7086)

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

sys/x86/x86/identcpu.c
1299 ↗(On Diff #7086)

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 ↗(On Diff #7436)

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

sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
719 ↗(On Diff #7436)

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 ↗(On Diff #7436)

Protocol.

sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
719 ↗(On Diff #7436)

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
719 ↗(On Diff #7086)

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

sys/x86/x86/identcpu.c
1299 ↗(On Diff #7086)

good point. I will revert this.

Looks good to me overall.

sys/x86/x86/identcpu.c
127 ↗(On Diff #11677)

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.