FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 04-02-2012, 09:53 AM
"Victor Miasnikov"
 
Default 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>

f.. List-id: <linux-ide.vger.kernel.org>

--------------------------------------------------------------------------------

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.

BugLink: http://bugs.launchpad.net/bugs/929545
BugLink: http://bugs.launchpad.net/bugs/942316
Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxxx>
---
drivers/ata/ata_piix.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)

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>

f.. List-id: <linux-ide.vger.kernel.org>

--------------------------------------------------------------------------------

Hi!

----- 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

From: "Victor Miasnikov"
Date: 2012-03-29 14:00:05

. . .

"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
 
Old 04-02-2012, 03:57 PM
Jonathan Nieder
 
Default 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:

http://thread.gmane.org/gmane.linux.ide/51712
http://thread.gmane.org/gmane.linux.kernel/1186996/

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
 
Old 04-03-2012, 12:58 PM
"Victor Miasnikov"
 
Default 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:

http://thread.gmane.org/gmane.linux.ide/51712
http://thread.gmane.org/gmane.linux.kernel/1186996/

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.




{
{ This is _old_ variant "OpenSUSE Way"


http://thread.gmane.org/gmane.linux.kernel/1186996/


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/


Or

http://kernel.opensuse.org/cgit/kernel/commit/?id=aeff3a8fcde6df6e7f26618c5e3bc716a6aa9e85
http://kernel.opensuse.org/cgit/kernel/tree/drivers/ata/ata_piix.c?id=aeff3a8fcde6df6e7f26618c5e3bc716a6aa 9e85
[
http://kernel.opensuse.org/cgit/kernel/plain/drivers/ata/ata_piix.c?id=aeff3a8fcde6df6e7f26618c5e3bc716a6aa 9e85
]

==


}


{

{
matsimons-hv-kernel
linux-3.2-hyperv

https://gitorious.org/~matsimon/linux-gymkl/matsimons-hv-kernel/commits/linux-3.2-hyperv

on "2012-03-29 07-33"

use _first_/ _old_ variant "UBUNTU Way" ata_piix.c

}

But after

https://launchpad.net/ubuntu/+source/linux/3.2.0-18.29
[
http://launchpadlibrarian.net/96134755/linux_3.2.0-18.28_3.2.0-18.29.diff.gz
]


===
...
--- linux-3.2.0/debian/changelog
+++ linux-3.2.0/debian/changelog
@@ -1,3 +1,39 @@
+linux (3.2.0-18.29) precise; urgency=low
+
+ [ Andy Whitcroft ]
+
+ * [Config] restore build-% shortcut
+ * SAUCE: ata_piix: defer disks to the Hyper-V drivers by default
+ - LP: #929545, #942316
+
...
===




===
...


--- linux-3.2.0/drivers/ata/ata_piix.c
+++ linux-3.2.0/drivers/ata/ata_piix.c
@@ -191,6 +191,29 @@

static unsigned int in_module_init = 1;

+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 struct ata_port_operations piix_vmw_ops = {
@@ -1677,21 +1701,9 @@
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
");
rc = pci_register_driver(&piix_pci_driver);
diff -u linux-3.2.0/fs/binfmt_elf.c linux-3.2.0/fs/binfmt_elf.c




...
===

Ubuntu use this:


{

This patch is "UBUNTU Way"


http://thread.gmane.org/gmane.linux.ide/51712


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
 

Thread Tools




All times are GMT. The time now is 05:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org