Hyper-V: enable all hv drivers and export them in the initramfs

Bug #917135 reported by Mark Baker
This bug affects 5 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Andy Whitcroft
linux (Ubuntu)
Fix Released
Andy Whitcroft

Bug Description

As of kernel 3.2, all of drivers (except for the storage driver) required to be able to run Ubuntu as a guest image in a Microsoft Hyper-V environment have exited the staging tree of the kernel, and are now present in the following locations:

a. hv_timesource: Merged with general CPU detection code.

b. hv_vmbus: Moved to drivers/hv. Provides general vmbus functionality.

c. hv_utils: Moved to drivers/hv. Provides kvp, timesync, shutdown, and heartbeat.

d. hv_netvsc: Moved to drivers/net/hyperv. Provides synthetic network access.

e. hv_mouse: Moved to drivers/hid. Provides synthetic mouse access.

f. hv_storvsc: Still in drivers/staging/hv. Minor fixes still being hammered out (see http://driverdev.linuxdriverproject.org/pipermail/devel/2012-January/024012.html for more details on remaining fixes)

For the Ubuntu 12.04 kernel please ensure that:

1. Drivers are added to the install initrd so users have access to all synthetic devices during installation

2. Drivers are automatically installed by default in the installed initrd (so no rebuilding is necessary)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: linux-image-3.0.0-14-generic 3.0.0-14.23
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: ALC272 Analog [ALC272 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 /dev/snd/controlC0: mab 1646 F.... pulseaudio
 /dev/snd/pcmC0D0p: mab 1646 F...m pulseaudio
CRDA: Error: [Errno 2] No such file or directory
 Card hw:0 'Intel'/'HDA Intel at 0xf0800000 irq 44'
   Mixer name : 'Intel IbexPeak HDMI'
   Components : 'HDA:10ec0272,15583100,00100001 HDA:80862804,15584101,00100000'
   Controls : 24
   Simple ctrls : 13
Date: Mon Jan 16 12:42:07 2012
HibernationDevice: RESUME=UUID=55a31584-1ed4-41fb-b6cc-2514ebd87aaa
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MachineType: System76, Inc. Lemur UltraThin
 PATH=(custom, no user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-14-generic root=UUID=e4e40d03-f45e-4d22-8c88-71c7e91801df ro quiet splash vt.handoff=7
 linux-restricted-modules-3.0.0-14-generic N/A
 linux-backports-modules-3.0.0-14-generic N/A
 linux-firmware 1.60
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
SourcePackage: linux
StagingDrivers: mei
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/17/2010
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: CALPELLACRB.86C.0000.X.0000000000
dmi.board.asset.tag: Tag 12345
dmi.board.name: Lemur UltraThin
dmi.board.vendor: System76, Inc.
dmi.board.version: lemu2
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: System76, Inc.
dmi.chassis.version: lemu2
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrCALPELLACRB.86C.0000.X.0000000000:bd08/17/2010:svnSystem76,Inc.:pnLemurUltraThin:pvrlemu2:rvnSystem76,Inc.:rnLemurUltraThin:rvrlemu2:cvnSystem76,Inc.:ct10:cvrlemu2:
dmi.product.name: Lemur UltraThin
dmi.product.version: lemu2
dmi.sys.vendor: System76, Inc.

Andy Whitcroft (apw)
Changed in linux (Ubuntu):
status: New → Triaged
summary: - Add modules to kernel and (maybe) initramFS
+ Hyper-V: enable all hv drivers and export them in the initramfs
Changed in linux (Ubuntu):
assignee: nobody → Andy Whitcroft (apw)
importance: Undecided → Medium
Revision history for this message
Andy Whitcroft (apw) wrote :

hv_timesource: this is delivered by x86/kernel/cpu/mshyperv.c and builtin
hv_vmbus: delivered by hy_vmbus.ko and is modular; CONFIG_HYPERV=m
hv_utils: delivered by hy_utils and is modular; CONFIG_HYPERV_UTILS=m
hv_netvsc: delivered by hy_netvsc and is modular; CONFIG_HYPERV_NET=m
hv_mouse: delivered by hy_mouse and is modular; CONFIG_HYPERV_MOUSE=m
hv_storvsc: delivered by hy_netvsc and is modular; CONFIG_HYPERV_NET=m

All of these are already enabled and available kernel side, and appear in a
completed install.

These however are not obviously included in either the default initramfs nor included in d-i.

Revision history for this message
Mike Sterling (mike-sterling) wrote :

Can we get the drivers included in the initramfs? Without having them loaded, Ubuntu running on Hyper-V will be forced to install using the older non-PV drivers (for IDE) and not have access to SCSI or network unless specifically configured.

Additionally, as ata_piix is statically linked in Ubuntu 12.04, we are unable to control our root device with our hv_storvsc driver. On other distributions, we use modprobe rules to block the loading of ata_piix. As I see it, we have two options:

1. Build Hyper-V relevant storage driver as part of the kernel and we can fix the initialization ordering to ensure that our PV drivers control the root device when Ubuntu is running on a Hyper-V host. When not running on a Hyper-V host, our drivers will not successfully initialize and so will not have any effect. This would simultaneously address your need for fast boot while also addressing the performance issues on the root device when hosted on Hyper-V.
2. Modify the ata driver to recognize that when hosted on Hyper-V, it should not control the disks.

Let me know if either of those are options we can collaborate on.

Revision history for this message
Andy Whitcroft (apw) wrote :

Ok I have pushed some initramfs-tools changes to the linked branch. This includes the hv_* modules in the initramfs by default.

Revision history for this message
Andy Whitcroft (apw) wrote :

I have also pushed up a fix to the kernel to include them in the d-i virtio udeb for the alternate CDs.

Changed in initramfs-tools (Ubuntu):
assignee: nobody → Andy Whitcroft (apw)
importance: Undecided → Medium
Changed in linux (Ubuntu):
status: Triaged → In Progress
Changed in initramfs-tools (Ubuntu):
status: New → In Progress
Revision history for this message
Andy Whitcroft (apw) wrote :

I have produced test initramfs-tools packages for testing. See the commentary on bug #929545 for these, as you need the updated kernels to match to test correctly.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.2.0-16.25

linux (3.2.0-16.25) precise; urgency=low

  [ Andy Whitcroft ]

  * d-i -- include the Hyper-V drivers in the virtio udeb
    - LP: #917135

  [ Felix Fietkau ]

  * (pre-stable): ath9k_hw: fix a RTS/CTS timeout regression
    - LP: #925602

  [ Keith Packard ]

  * SAUCE: drm/i915: Force explicit bpp selection for
    - LP: #745112, #912387, #917330

  [ Leann Ogasawara ]

  * Fix typo in generic-pae description
    - LP: #928448
  * Rebase to v3.2.6

  [ Upstream Kernel Changes ]

  * procfs: parse mount options
    - CVE-2011-4917
  * procfs: add hidepid= and gid= mount options
    - CVE-2011-4917
  * proc: fix null pointer deref in proc_pid_permission()
    - CVE-2011-4917
  * xhci: Remove warnings about MSI and MSI-X capabilities.
    - LP: #929656
  * xhci: Remove scary warnings about transfer issues.
    - LP: #929656
  * x86, mce, therm_throt: Don't report power limit and package level
    thermal throttle events in mcelog
    - LP: #930288
  * rebase to v3.2.6
    - LP: #924320
    - LP: #918254
 -- Leann Ogasawara <email address hidden> Mon, 13 Feb 2012 13:00:08 -0800

Changed in linux (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Mathieu Simon (mathieu-simon) wrote :

I'm afraid to tell that the mainline branch of Linux 3.2 has only the hv_vmbus and hv_utils moved out of staging. Only with 3.3 the biggest chunk of the Hyper-V drivers have left staging - except storvsc.

Although I see that most patches from 3.3 apply properly without problems (kinda' backporting) there are big chunks of bugfixes (possible memory leaks for hv_vmbus, kernel oops, hid-hyperv) and features (promiscuous mode and jumbo frame support) that are missing in mainline 3.2.x but present in 3.3.

How do you plan to handle this. - The 3.2 series have proven to be already quite stable but some fixes from upstream still show the drivers for network and storage have rough edges. - We don't need the quality of the HV modules as they were in 10.04 LTS (quite unstable)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.99ubuntu10

initramfs-tools (0.99ubuntu10) precise; urgency=low

  * Add Hyper-V paravirtualised device drivers to the initramfs to allow
    booting of stock images in a Hyper-V guest. (LP: #917135)
 -- Andy Whitcroft <email address hidden> Fri, 10 Feb 2012 14:44:46 +0000

Changed in initramfs-tools (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Tim Miller Dyck (timmillerdyck) wrote :


I have success also with the -generic kernel image, but the -virtual kernel packages do not seem to include the hv_ drivers.

Tested with linux-image-virtual

# dpkg -l | grep linux-image-virtual
ii linux-image-virtual Linux kernel image for virtual machines

# zcat /boot/initrd.img-3.2.0-17-virtual | cpio -it | grep hv_
25562 blocks


Rebooted with the -generic kernel:

# dpkg -l | grep linux-image-generic
ii linux-image-generic Generic Linux kernel image

# zcat /boot/initrd.img-3.2.0-17-generic | cpio -it | grep hv_
78921 blocks


Could the -virtual kernel packages get the same Hyper-V support?

Tim Miller Dyck

Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Marking as "confirmed" pending placement of the drivers into the virtual images.

Changed in linux (Ubuntu):
status: Fix Released → Confirmed
Changed in initramfs-tools (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

I've confirmed that this is in the latest kernel.

# zcat /boot/initrd.img-3.2.0-18-virtual | cpio -it | grep hv_

Andy Whitcroft (apw)
Changed in initramfs-tools (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.