State of Linux on Hyper-V — total «moved out ot staging» in kernel v3.2/v3.3
Update 2012-02-23 12-00:
a)
See
==
K. Y. Srinivasan:
With regards to the ata_piix changes, we will try to push that upstream shortly.
==
z)
Hyper-V drivers for Linux will finally leave the staging area with 3.4
http://git.kernel.org/?p=linux/kernel/git/gregkh/staging.git;a=commit;h=89ae7d709357df3a60e81c57613859d91d093ace
==
. . .
Staging: hv: storvsc: Move the storage driver out of the staging area
The storage driver (storvsc_drv.c) handles all block storage devices
assigned to Linux guests hosted on Hyper-V. This driver has been in the
staging tree for a while and this patch moves it out of the staging area.
James was willing to apply this patch during the 3.3-rc phase and a decision
was taken to defer this to 3.4 since Greg had queued up a bunch of storvsc
patches for 3.4. Now that Greg has applied all of the pending storvsc patches,
I am sending this patch to move this driver out of staging. Based on James’
recommendation, this patch gets rid of the unneeded files in the staging/hv
directory.
. . .
==
Update 2012-02-21 11-32:
See
==
«Ubuntu Way»
. . .
2. Modify the ata driver to recognize that when hosted on Hyper-V
==
Update 2012-02-17 16-05:
see later:
==
Kernel v3.2: With Arch fork Сhakra: mouse work fine ( simply — ideal) , but
— \dev\sda = = \dev\sdb
\dev\sdb is IDE Drive Master Primary ( and not work as need)
and
\dev\sda is IDE Drive Master Primary
and SCSI not \dev\sdb , but \dev\sdc — IMHO, it is may be not very well
==
http://www.simweb.ch/blog/2011/12/experimental-hyper-v-branch/
==
. . .
. . . will be coming from stagin-next, hid and the network area where some of the drivers Hyper-V have left staging as of December 2011. So with the release of 3.2 sooner or later, you can fetch a kernel that has:
• SCSI hot plug / remove
• netvsc network promiscuous mode
• netvsc and hid out of staging
. . .. . . – I’m quite positive with 3.4 most of Hyper-V code will have left staging and reached a maturity for other distributions to enable drivers in default kernel builds.
If you’re a admin that has to manage Linux on Hyper-V – other than SLES/RHEL or CentOS – now you should be asking your distributions to enable these modules (at least hyper-v bus with 3.2)
. . .
==
http://www.simweb.ch/blog/2011/12/experimental-hyper-v-branch/
==
Experimental Hyper-V branchHere is a experimental branch of the mainline kernel with some backported patches . . .
https://gitorious.org/~matsimon/linux-gymkl/matsimons-hv-kernel
==
{
http://www.simweb.ch/blog/2011/10/state-of-linux-on-hyper-v/
==
State of Linux on Hyper-V
Update 02.2012 . . .
==
==
. . . move the handling of IDE drives to hv_storvsc and drops hv_blkvsc completely . . .Update: It seems one can ommit this having only /boot and GRUB on the bootable IDE disk, thanks Victor – he has more details how to omit this.
Actually it’s not a technical problem yet. MS handles this via modprobe rules in their Linux ICs for sanity.
==
==
Partly leaving the staging area
Greg Kroah-Hartmann has put a patch in staging-next that moves the VMBus part out of drivers/staging/hv – read his commit message. It now means the VMBus drivers – the paravirtualized bus of Hyper-V where paravirt devices connect to the hypervisor backend – are considered enough cleaned up to be considered stable.Update: With Linux 3.3 only storvsc will be / is left in staging area. This means that the kernel hackers think that the overall quality of the kernel modules are believed to be good enough for daily use. For sure there are possible bugs and will be fixed hopefully as well.
==
==
Mouse support
. . .Update: I have since then tested the dirvers, 3.2 seems to work well but 3.3 contains some memory leak bugfixes others have had their issues with them in 3.0/3.1. If you dont have X.org on a Server VM, you can quietly ignore this module anyway. – I’ll let Puppet do the work or SSH to the box first
Starting 3.3 the driver has been renamed once as hid_hyperv and was moved out ot staging.
==
}
----- Original Message -----
From: "Mathieu Simon"
To: "Victor Miasnikov"
Sent: Thursday, February 16, 2012 4:32 PM
. . .
While 3.2 is quite ok, 3.3 still has a bunch of fixes that look scary - and are missing in 3.2 still (kernel oopses, memory leaks etc.)
Have fun with Arch on Hyper-V - there is a patch underway that will also remove the 4 vCPU limit that is still yet imposed by 2008 R2 and will go awa with Windows 8 Servers.
. . .
But I ( Mathieu Simon) don't think this patch is already in 3.3.
You can read here:
http://groups.google.com/group/linux.kernel/browse_thread/thread/26e70c50d24fd38c/9aa8eea98838fbf3?show_docid=9aa8eea98838fbf3
. . .
--
----- Original Message -----
From: "Victor Miasnikov"
To: "Mathieu Simon"
Sent: Thursday, February 16, 2012 5:51 PM
. . . Thanks You for very interesant and usefull blog and other work
>> If you dont have X.org on a Server VM, you can quietly ignore this module anyway. – I’ll let Puppet do the work or SSH to the box first
If need mouse in old-kernel Linux -- simple use directly connect via Hyper-V MMC from physically Windows-workstantion
. . .
--
Update 2012-02-17 16-05:
Kernel v3.2: With Arch fork Сhakra: mouse work fine ( simply — ideal) , but
\dev\sdb is IDE Drive Master Primary ( and not work as need)
and
\dev\sda is IDE Drive Master Primary
i.e.
— \dev\sda = = \dev\sdb
and SCSI not \dev\sdb , but \dev\sdc — IMHO, it is may be not very well
see Linux on Hyper-V Image:

Full size picture:
http://vvm.blog.tut.by/files/2012/02/Linux-on-Hyper-V-Image-2012-02-17-14-04.png
–
Update 2012-02-21 11-32:
From: Miasnikov Victor
Sent: Tuesday, February 21, 2012 11:23 AM
To: 'K. Y. Srinivasan'
Subject: Ubuntu: ata_piix.prefer_ms_hyperv=0 Fw: Problem: \dev\sda == \dev\sdb is is IDE Drive Master Primary and SCSI not \dev\sdb , but \dev\sdc Fw: move the handling of IDE drives to hv_storvsc and drops hv_blkvsc completely Fw: State of Linux on Hyper-V
. . .
Can solve problem someone a-la this
Var A Or "Ubuntu Way"
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/929545
==
. . .
The strategies Microsoft currently use on other distributions are based on setting up modprobe rules but these will not work on Ubuntu
as the native (ata*) driver is built directly into the kernel.
. . .
2. Modify the ata driver to recognize that when hosted on Hyper-V, it
should not control the disks.
. . .
Andy Whitcroft (apw) wrote on 2012-02-10:
I . . . add hyper-v detection to the ata_piix driver. This basically defers handling to hyper-v by default if the hypervisor is detected. I have also added an override to allow this to be suppressed from the command line. Could someone with a hyper-v based cloud test the kernels below and report whether they work here. Could you please include a dmesg of a successful boot so I can confirm the detection has recorded itself correctly. It would also be helpful to get a boot with ata_piix.prefer_ms_hyperv=0,
==
http://www.ubuntuupdates.org/package/core/precise/main/base/linux-image-3.2.0-17-generic
=>
===
...
* deviations -- note the source of the Hyper-V updates
* SAUCE: ata_piix: defer to the Hyper-V drivers by default
- LP: #929545
...
===
==
http://people.canonical.com/~apw/lp929545-precise/0001-ata_piix-defer-to-the-Hyper-V-drivers-by-default.patch
===
From 9c2e8890fee7c07540e477bac63984a53a903455 Mon Sep 17 00:00:00 2001
From: Andy Whitcroft
Date: Fri, 10 Feb 2012 12:17:14 +0000
Subject: [PATCH 01/70] ata_piix: defer to the Hyper-V drivers by default
When we are hosted on a Microsoft Hyper-V hypervisor the guest disks
are exposed both via the Hyper-V paravirtualised drivers and via an
emulated SATA disk drive. In this case we want to use the
paravirtualised drivers if we can as they are much more efficient.
Add check for the Hyper-V hypervisor during initialisation and avoid
initialising. Also adds a module parameter to override this behaviour.
BugLink: http://bugs.launchpad.net/bugs/929545
Signed-off-by: Andy Whitcroft
---
debian/rules.d/1-maintainer.mk | 1 +
drivers/ata/ata_piix.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 975cd79..6477b68 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -92,6 +92,7 @@ prev_release="$(release)-$(prev_revision)"
printchanges:
@baseCommit=$$(git log --pretty=format:'%H %s' | \
awk '/UBUNTU: '".*Ubuntu-$(prev_release)"'$$/ { print $$1; exit }'); \
+ echo "$$baseCommit" ; \
git log "$$baseCommit"..HEAD | \
perl -w -f $(DROOT)/scripts/misc/git-ubuntu-log $(ubuntu_log_opts)
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 69ac373..f8280c5 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -94,6 +94,9 @@
#include
#include
#include
+#ifdef CONFIG_X86
+#include
+#endif
#define DRV_NAME "ata_piix"
#define DRV_VERSION "2.13"
@@ -1666,9 +1669,21 @@ static void piix_remove_one(struct pci_dev *pdev)
ata_pci_remove_one(pdev);
}
+static int prefer_ms_hyperv = 1;
+
static int __init piix_init(void)
{
int rc;
+#ifdef CONFIG_X86
+ /*
+ * If we are on the Microsoft Hyper-V platform deferr to its block
+ * drivers.
+ */
+ if (prefer_ms_hyperv && x86_hyper == &x86_hyper_ms_hyperv) {
+ pr_info("ata_piix: deferring to Hyper-V hypervisor");
+ return -ENODEV;
+ }
+#endif
DPRINTK("pci_register_driver\n");
rc = pci_register_driver(&piix_pci_driver);
@@ -1688,3 +1703,5 @@ static void __exit piix_exit(void)
module_init(piix_init);
module_exit(piix_exit);
+
+module_param(prefer_ms_hyperv, int, 0);
--
1.7.9
===
==
==
http://people.canonical.com/~apw/lp929545-precise/0002-debug.patch
===
From b58963a158e54b716bd6e43de08df4503f273a00 Mon Sep 17 00:00:00 2001
From: Andy Whitcroft
Date: Fri, 10 Feb 2012 19:55:16 +0000
Subject: [PATCH 02/70] debug
---
drivers/ata/ata_piix.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index f8280c5..b022548 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1682,6 +1682,8 @@ static int __init piix_init(void)
if (prefer_ms_hyperv && x86_hyper == &x86_hyper_ms_hyperv) {
pr_info("ata_piix: deferring to Hyper-V hypervisor");
return -ENODEV;
+ } else {
+ pr_info("ata_piix: no Hyper-V hypervisor found");
}
#endif
--
1.7.9
===
==
Var B Or "OpenSUSE Way"
http://patchwork.ozlabs.org/patch/112939/
===
...
Olaf Hering - Sept. 1, 2011, 3:43 p.m.
On Wed, Aug 31, Olaf Hering wrote:
> After some more testing it looks like the hv_blkvsc driver claimed the
> ide major #3, so the ide_core could not bind to the emulated IDE
> hardware. The modprobe.conf rules prevented that ata_piix gets loaded.
> If I force a module load order of 'ata_piix ;hv_blkvsc' both ata_piix
> and hv_blkvsc will bind to the same drive, just as shown in my previous
> mail. So there is appearently no way to shutdown the IDE ports like it
> is done with xen_emul_unplug= option for Xen guests.
>
> Maybe some hack is needed for a hyper-v specific unplug if Windows does
> indeed lack that feature. Now that ata_piix is compiled into the kernel,
> there is nothing to a modprobe.conf rule can "fix".
Here is an attempt to ignore disks in a hyper-v disks, and let ata_piix
handle only the configured cdrom devices (iso of physical).
If the disks are not ignored, they will appear twice, once through
ata_piix and once through hv_storvsc.
Once hv_storvsc can also handle the configured cdrom devices, the added
piix_pata_read_id() function can be removed again. Only the check in
piix_init() or something similar needs to be done.
Maybe there is a better way enable only ATA_DEV_ATAPI?
Signed-off-by: Olaf Hering
. . .
Patch
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -98,6 +98,10 @@
#define DRV_NAME "ata_piix"
#define DRV_VERSION "2.13"
+#if defined(CONFIG_HYPERV_STORAGE) || defined(CONFIG_HYPERV_STORAGE_MODULE)
+#define PIIX_IGNORE_ATA_ON_HYPERV 1
+#endif
+
. . .
...
===
--------------------------------------------------------------------------------
From: KY Srinivasan
Sent: Tuesday, February 21, 2012 7:37 PM
To: Мясников Виктор Вячеславович
Subject: RE: . . . b) patches to ata_piix need in _official_ kernel RE: Ubuntu: ata_piix.prefer_ms_hyperv=0 Fw: Problem: \dev\sda == \dev\sdb Fw: IDE drives to hv_storvsc and drops hv_blkvsc Fw: State of Linux on Hyper-V
. . .
With regards to the ata_piix changes, we will try to push that upstream shortly.
K. Y
Good result:
http://www.yusufozturk.info/linux-server/future-of-linux-support-ubuntu-12-on-hyper-v-v3.html#more-4009
<=
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/929545/comments/27
==
Comment 27 for bug 929545 ( #27)
Mike Sterling (mike-sterling) wrote on 2012-02-14:
. . .
In fact, I would strongly suggest that the latest hv* drivers from linux-next be used if at all possible.
The snapshot being used as the base for the Precise kernel only has the hv_vmbus driver out of staging.
With the release of the 3.3 kernel, the hv_netvsc and hv_mouse drivers were approved for exit,
and we've already received word that the hv_storvsc driver will exit in 3.4.
The quality of code after going through the community review is leaps and bounds better
than what is present in 3.2, and should be ideal for a -LTS release.
To accomplish this, you can either pull from linux-next and replace the files in
/drivers/staging/hv
(which would require no changes to the build system),
or pull the appropriate files out of the various folders (as well as the Kconfigs)
and place them in the locations as of linux-next:
drivers/hv, drivers/net/hyperv/, drivers/hid/hid-hyperv.c, drivers/scsi/storvsc_drv.c
==
Ubuntu 12.04 (PP) development kernel tree — Ubuntu-3.2.0-20.33
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-precise.git;a=summary
Ubuntu 12.04 — Ubuntu-3.2.0-20.33
ubuntu-precise-870f3e3.tar.gz
debian.master\deviations.txt
==
HYPER-V DRIVERS
F: drivers/hid/hid-hyperv.c
F: drivers/hv/*
F: drivers/scsi/storvsc_drv.c
F: drivers/staging/hv/*
Updated version of the Hyper-V storage, network, and mouse drivers
from those planned for v3.4. The drivers in v3.2 simply do not
work correctly dropping access to the drive after a few seconds
of sustained use. Testing with the Azure folk showed that the
v3.4 drivers worked well in the v3.2 codebase. Intial version
from linux-next pre-merge window, update from v3.4-stable once
it releases.
==
<=
==
linux (3.2.0-17.26) precise; urgency=low
[ Andy Whitcroft ]
* deviations -- note the source of the Hyper-V updates
==