Bug#661318: ata_piix: defer disks to the Hyper-V paravirtualised drivers by default Possibility integrating newer Hyper-V paravirt drivers in squeeze?
Hi!
Mathieu Simon wrote:
ata_pIIx doesn't defer to the (much faster) paravirt storage driver when
Debian is run on Hyper-V,
or worse, we can lose the root file system when drivers switch between
storvsc and ata_piix.
As we can't use modprobe rules (as done on RHEL for this), Andy
Whitcroft has come up
with a patch for Ubuntu's 3.2-based kernel that solves the problem and
does the job on Wheezys' kernel too.*
Jonathan Nieder>>
ata_pIIx [...]
Has the topic been raised on the linux-ide@ list?
http://www.spinics.net/lists/linux-ide/msg43078.html
==
a.. To: Jeff Garzik <jgarzik@xxxxxxxxx>, linux-ide@xxxxxxxxxxxxxxx
b.. Subject: [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drivers by default
c.. From: Andy Whitcroft <apw@xxxxxxxxxxxxx>
d.. Date: Thu, 29 Mar 2012 18:28:50 +0100
e.. Cc: Andy Whitcroft <apw@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, Mike
Sterling <Mike.Sterling@xxxxxxxxxxxxx>
When we are hosted on a Hyper-V hypervisor the guest disks are exposed
both via the Hyper-V paravirtualised drivers and via an emulated SATA disk
controller. We want to use the paravirtualised drivers where possible as
they are much more performant. The Hyper-V paravirtualised drivers only
expose the virtual hard disk devices, the CDROM/DVD devices must still
be enumerated on the virtualised SATA controller. As we have no control
over kernel probe order for these two drivers especially when one driver
is builtin to the kernel and the other a module, we need to prevent the
ata_piix driver from claiming the disks devices by default when running
on a Hyper-V hypervisor.
When enumerating the drives look at the aquired device ID and if it
appears to be a disk device then report it as disconnected. Limit this
behaviour to when we have detected a Hyper-V hypervisor. Finally allow
this behaviour to be overriden via a new module parameter.
This was discovered when doing some boot testing on a Hyper-V
host. Performance was found to be bad as out builtin ata_piix
driver was grabbing the disks. I am Cc:ing a couple of the
Microsoft people who worked on the HV driver set as well.
Note that the device id data is converted from device to host
order in the caller which makes examining the data problematic.
As this code only make sense on X86 and we know we are in
matching order we can access the data without first fixing it.
Alternativly we could add a new callback from the ata core
after the code has been fixed for validation.
Comments?
-apw
. . .==
http://www.spinics.net/lists/linux-ide/msg43087.html
==
a.. To: "Andy Whitcroft" <apw@xxxxxxxxxxxxx>, "Jeff Garzik" <jgarzik@xxxxxxxxx>, <linux-ide@xxxxxxxxxxxxxxx>
b.. Subject: Re: [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drivers by default
c.. From: "Victor Miasnikov" <vvm@xxxxxx>
d.. Date: Fri, 30 Mar 2012 12:14:20 +0300
e.. Cc: <linux-kernel@xxxxxxxxxxxxxxx>, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, "Mike Sterling"
<Mike.Sterling@xxxxxxxxxxxxx>
----- Original Message ----- From: "Andy Whitcroft" apw
Sent: Thursday, March 29, 2012 8:28 PM
Subject: [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drivers by default
guest disks are exposed both via the Hyper-V paravirtualised drivers and via an emulated SATA disk
controller. . . . we need to prevent the
ata_piix driver from claiming the disks devices by default when running
on a Hyper-V hypervisor.
Yes
Thanks for patch!
Comments?
This patch is "UBUNTU Way" Solution described in
See
http://vvm.blog.tut.by/2012/03/29/linux-on-hyper-v-use-hv_storvsc-instead-of-ata_piix-to-handle-the-ide-disks-devices-but-not-for-the-dvd-rom-cd-rom-device-handling/
Or
http://marc.info/?l=linux-kernel&m=133302969709312&w=2
==
List: linux-kernel
Subject: Linux on Hyper-V -- use hv_storvsc instead of ata_piix to handle the IDE disks devices ( but not for the
DVD-ROM / CD-ROM device handling) Fw: [PATCH RFC] ata_piix: ignore disks in a hyper-v guest
"UBUNTU Way" Solution -- tested with
Ubuntu 12.04 LTS (Precise Pangolin) Daily Build 2012-03-13
precise-desktop-amd64.iso
, work Ok
. . .
==
i.e. "[PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drivers by default" is fully worked solution to
the described problem
Best regards, Victor Miasnikov
Blog: http://vvm.blog.tut.by/
--
==
Best regards, Victor Miasnikov
Blog: http://vvm.blog.tut.by/
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 49586396462D476B91083D83890E01C4@local.st.by">http ://lists.debian.org/49586396462D476B91083D83890E01C4@local.st.by
04-02-2012, 03:57 PM
Jonathan Nieder
Bug#661318: ata_piix: defer disks to the Hyper-V paravirtualised drivers by default Possibility integrating newer Hyper-V paravirt drivers in squeeze?
Hi Victor,
Victor Miasnikov wrote:
> This patch is "UBUNTU Way" Solution described in
If I understand correctly, you are saying there are two patches that
deal with deciding whether ata_piix or hv_storvsc handles a device and
making sure CD-ROMs are still usable:
that the former of the two works a little better, that Mathieu was
using the former, and that upstream has not committed to one yet. Ok.
Thanks,
Jonathan
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120402155753.GE3365@burratino">http://lists.debian.org/20120402155753.GE3365@burratino
04-03-2012, 12:58 PM
"Victor Miasnikov"
Bug#661318: ata_piix: defer disks to the Hyper-V paravirtualised drivers by default Possibility integrating newer Hyper-V paravirt drivers in squeeze?
Hi!
This patch is "UBUNTU Way" Solution described in
If I understand correctly, you are saying there are two patches that
deal with deciding whether ata_piix or hv_storvsc handles a device and
making sure CD-ROMs are still usable:
1 Sep 17:43 Olaf Hering [PATCH RFC] ata_piix: ignore disks in a hyper-v guest
}
New variant see in
http://marc.info/?l=linux-kernel&m=133302969709312&w=2
Or
http://vvm.blog.tut.by/2012/03/29/linux-on-hyper-v-use-hv_storvsc-instead-of-ata_piix-to-handle-the-ide-disks-devices-but-not-for-the-dvd-rom-cd-rom-device-handling/
+static int prefer_ms_hyperv = 1;
+
+unsigned int ata_piix_read_id(struct ata_device *dev,
+ struct ata_taskfile *tf, u16 *id)
+{
+ int ret = ata_do_dev_read_id(dev, tf, id);
+
+#ifdef CONFIG_X86
+ /* XXX: note that the device id is in little-endian order, the caller
+ * will shift it to host order, but we are working with little-endian.
+ * As this is _only_ used on x86 we can actually directly access it
+ * as host is also little-endian.
+ */
+ if (!ret && prefer_ms_hyperv && x86_hyper == &x86_hyper_ms_hyperv &&
+ ata_id_is_ata(id)) {
+ ata_dev_printk(dev, KERN_WARNING, "ATA disk ignored deferring to Hyper-V paravirt driver
");
+
+ return AC_ERR_DEV|AC_ERR_NODEV_HINT;
+ }
+#endif
+ return ret;
+}
+
static const struct pci_device_id piix_pci_tbl[] = {
/* Intel PIIX3 for the 430HX etc */
{ 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma },
@@ -362,6 +385,7 @@
.set_piomode = piix_set_piomode,
.set_dmamode = piix_set_dmamode,
.prereset = piix_pata_prereset,
+ .read_id = ata_piix_read_id,
};
-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
29 Mar 19:28 Andy Whitcroft [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drive
30 Mar 11:14 Victor Miasnikov [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drive
}
}
IMHO, need use
==
29 Mar 19:28 Andy Whitcroft [PATCH 1/1] ata_piix: defer disks to the Hyper-V paravirtualised drive
==
may be, combine with some ideas from _latest_ "OpenSUSE Way"
Thanks,
No problem :-)
Best regards, Victor Miasnikov
Blog: http://vvm.blog.tut.by/
P.S. About Ubuntu v12.04 on Hyper-V:
http://www.thomasmaurer.ch/2012/03/install-ubuntu-12-04-on-hyper-v/
==
on March 26, 2012 by Thomas Maurer
. . . work fine
==
http://www.yusufozturk.info/linux-server/future-of-linux-support-ubuntu-12-on-hyper-v-v3.html
==
Future of Linux Support: Ubuntu 12 on Hyper-V v3
26/03/2012 04:19
==
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4B9B2ABDB8FC42DD8DBFC223DDF5AE54@local.st.by">http ://lists.debian.org/4B9B2ABDB8FC42DD8DBFC223DDF5AE54@local.st.by