Hi!

This may have been asked before but the solution we have currently is less than ideal. Please bear with me on the repetition and provide any suggestions you may have.


One of the issues with Hyper-V is that it does not virtualize the CD device and therefore we rely on the ATA driver in the guest operating system to manage CDROMs.
What we would like to do is disable the ATA driver for all device types except 
the CDROM in the presence of Hyper-V.

Yes: "disable . . . except the CDROM" need for  "LiveCD and (or) .ISO for setup 
FreeBSD"

See P.P.P.S.
==
----- Original Message ----- From: "Victor Miasnikov"
To: "Alexander Motin"
Cc: <freebsd-virtualization@freebsd.org>;  "Larry Melia" ( in fact to 3 e-mail 
address )
Sent: Tuesday, May 07, 2013 12:00 PM
Subject: Re: ATA controller and Hyper-V "synthetic storage driver" handle the IDE disks devices ( but not for the CD-ROM) Re: Hyper-V on FreeBSD

 . . .

On 07.05.2013 10:40, Victor Miasnikov wrote:
prevent default OS driver from attaching to emulated ATA controller
when Hyper-V

Disable both primary and secondary ATA controller prevent use CD-ROM
device in VM ( guest)

Because "synthetic storage driver" not handle CD-ROM devices
( IMHO, even more: Hyper-V host work with CD-ROM only as "PCI bus" device)

A.M.> Then may be possibility of blocking/hiding specific ATA channels or
A.M.> devices could be investigated.

IMHO, this ( or some like this) must be investigated
In any case, need carefully testing work CD-ROM ( primary for LiveCD and (or) 
.ISO for setup FreeBSD) in Hyper-V
enviroment
==


As of now we have implemented a disengage driver that disables ATA driver 
permanently on Hyper-V.

As _first_ step:
temporary disable BlkVSC (paravirtual IDE) functional

(
 Or  ( as best tmp. solution):
"turn on"  hw.ata.disk_enable by default
i.e. implement  hw.ata.disk_disable

When Hyper-V sysadmin need syntetic/"Hyper-V specific" ATA driver functional,
sysadmin use hw.ata.disk_disable

 When Hyper-V sysadmin need CD-ROM -- sysadmin skip/not use hw.ata.disk_disable
)

See in P.P.S.
==
L.M.>>> Removing our ATA patches, on the other hand, results in a huge
L.M.>>> performance loss. This is because the root file system is managed by the
L.M.>>> ATA driver, which is emulated under Hyper-V.
VVM>> Place on IDE disk only "\boot" ( and bootloader), other on SCSI .
+
VVM>> Disable both primary and secondary ATA controller prevent use CD-ROM 
device in VM ( guest)
VVM>> Because "synthetic storage driver" not handle CD-ROM devices

 May be temporary disable BlkVSC (paravirtual IDE) functional?

And enable [imm.]after implement work on Hyper-V both CD-ROM and ATA disks
==

(
And not forget about hv_ata_pci_disengage.c
)

However this is less than desirable and we are looking for a better solution. Please let us know if you have some thoughts.

On _second_ step, we can start inplement "better solution"

Can someone help us in answering the following in this regard:

a)      What is the correct location in the FreeBSD ATA code where we can put 
in selective disabling?

b)      Is this a good approach? Is there something cleaner you can think of?



   Disable non-syntetic/"legacy" ATA driver on ATA channel N1 ( for HDD )  ,
but enable non-syntetic/"legacy" ATA driver on ATA channel N2 ( for CD-Rom 
devices)

(
Of cource:
Enable syntetic/"Hyper-V specific" ATA driver on ATA channel N1 ( for HDD );
Disable syntetic/"Hyper-V specific" ATA driver on ATA channel N2 ( for CD-Rom 
devices)
)

See:
----- Original Message ----- From: "Alexander Motin"
To: "Larry Melia"
Cc: "Abhishek Gupta (LIS)" ; "KY Srinivasan" ; 
<freebsd-virtualization@freebsd.org>
Sent: Tuesday, June 04, 2013 7:23 PM
Subject: Re: more granular detection and control to disable/enable PCI-ATA 
devices

 . . .

That is why you can't replace driver for a single disk
in the same way as you replaced driver for the whole controller.
The highest level present in "NewBus" is ATA channel.
So if  disk and CD-ROM are always live on different channels,
you can create dummy driver not for the whole controller (atapciX),
but for single hardcoded ATA channel (ataX).

. . .

--




Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


P.S.


----- Original Message ----- From: "Abhishek Gupta (LIS)"
To: freebsd-virtualization  (at)  freebsd.org
Sent: Tuesday, October 01, 2013 12:02 AM
Subject: Disabling ATA driver for IDE devices on Hyper-V

Hi folks,

This may have been asked before but the solution we have currently is less than ideal. Please bear with me on the repetition and provide any suggestions you may have.

One of the issues with Hyper-V is that it does not virtualize the CD device and therefore we rely on the ATA driver in the guest operating system to manage CDROMs. What we would like to do is disable the ATA driver for all device types except the CDROM in the presence of Hyper-V. Can someone help us in answering the following in this regard:


a)      What is the correct location in the FreeBSD ATA code where we can put 
in selective disabling?

b)      Is this a good approach? Is there something cleaner you can think of?

As of now we have implemented a disengage driver that disables ATA driver permanently on Hyper-V. However this is less than desirable and we are looking for a better solution. Please let us know if you have some thoughts.

Thanks,
Abhishek
--



----- Original Message ----- From: "Alexander Motin"
To: "Larry Melia"
Cc: "Abhishek Gupta (LIS)" ;"KY Srinivasan" ; 
<freebsd-virtualization@freebsd.org>
Sent: Tuesday, June 04, 2013 7:23 PM
Subject: Re: more granular detection and control to disable/enable PCI-ATA 
devices

Hi.

On 04.06.2013 18:30, Larry Melia wrote:
With you suggestions, I finally was able to get the override driver
working-see
https://github.com/FreeBSDonHyper-V/freebsd-snapshot/blob/hyperv-dev-ata-override/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c.
While it operates wonderfully, allowing our "enlightened" driver to
improve performance, some versions of Hyper-V still use the native
CD-ROM driver, because there is no "enlightened" support for it in the
hypervisor. From my limited knowledge of the ATA drivers, it seems
likely that the PCI-ATA driver be attached when a CD-ROM is detected,
but lower-level drivers disabled (during a probe) when a hard drive is
detected. On Hyper-V, therefore, a user would be able to configure a
PCI/IDE virtual controller with two devices, the first device a hard
disk and the second one a CD-ROM. The CD-ROM would operate via the
native driver, whereas the hard disk would use the "enlightened" driver
(to improve performance).  Is there an easy way to add more granular
detection, disabling the native ATA driver(s) selectively for hard
drives, while allowing CD-ROM devices to be natively attached? Any
suggestions would be very much appreciated.

Unfortunately, CAM subsystem used for both ATA and SCSI stacks in
FreeBSD 9.x and above is mostly unaware of "NewBus" infrastructure used
for driver probe and attachment. That is why you can't replace driver
for a single disk in the same way as you replaced driver for the whole
controller. The highest level present in "NewBus" is ATA channel. So if
disk and CD-ROM are always live on different channels, you can create
dummy driver not for the whole controller (atapciX), but for single
hardcoded ATA channel (ataX).

Another possible way is to make controller driver not dummy, making it
mostly duplicating default one, but filtering out unwanted devices. That
may look like overkill, but it is not necessary so, because ATA stack is
quite modularized, and you probably don't need to implement all ATA
functionality such as mode setting, etc. Only thing that should be
different in your driver is a reset method -- never reporting ATA disks
to upper layers, only ATAPI devices. You may find number of drivers for
example in sys/dev/ata/chipsets.

The later way is definitely more complicated then just a few lines hack
blocking CAM ada driver (ATA disk driver), but it still can be made
modular and non-invasive.

--
Alexander Motin




P.P.S.


----- Original Message ----- From: "Victor Miasnikov"
To: <freebsd-virtualization@freebsd.org>; "Alexander Motin" ; "Larry Melia"  
<zzzzzz...@gmail.com>
Cc: "Larry Melia" <e-mail_N2>
Sent: Saturday, May 18, 2013 9:06 AM
Subject: Tmp. disable BlkVSC (paravirtual IDE) functional? Re: ATA controller and Hyper-V "synthetic storage driver" handle the IDE disks devices ( but not for the CD-ROM) Re: Hyper-V on FreeBSD

Hi!

Short:

{{
L.M.>>> Removing our ATA patches, on the other hand, results in a huge
L.M.>>> performance loss. This is because the root file system is managed by the
L.M.>>> ATA driver, which is emulated under Hyper-V.
VVM>> Place on IDE disk only "\boot" ( and bootloader), other on SCSI .
+
VVM>> Disable both primary and secondary ATA controller prevent use CD-ROM 
device in VM ( guest)
VVM>> Because "synthetic storage driver" not handle CD-ROM devices

 May be temporary disable BlkVSC (paravirtual IDE) functional?

And enable [imm.]after implement work on Hyper-V both CD-ROM and ATA disks



==

--- 000\hv_storvsc_drv_freebsd.c Wed Apr 10 06:18:58 2013
+++ hv_storvsc_drv_freebsd.c Wed May 08 11:59:06 2013

. . .

 * Using the type GUID, determine if this is a StorVSC (paravirtual
 * SCSI or BlkVSC (paravirtual IDE) device.

. . .

 if (!memcmp(p, &gBlkVscDeviceType, sizeof(hv_guid))) {
-   return DRIVER_BLKVSC;
+  /* TODO: enable after implement work on Hyper-V both CD-ROM and ATA disks
+   * return DRIVER_BLKVSC;
+   */
+   return (DRIVER_UNKNOWN);

. . .

==

}}




Full:

On Tue, May 7, 2013 at 12:40 AM, Victor Miasnikov <vvm (at) tut.by> wrote:



L.M.>> ==
L.M.>> . . .
L.M.>> On 23.04.2013 17:07, Larry Melia wrote:
L.M.>> . . .
L.M.>>
L.M.>>> Removing our ATA patches, on the other hand, results in a huge
L.M.>>> performance loss. This is because the root file system is managed by the
L.M.>>> ATA driver, which is emulated under Hyper-V.
L.M.>>>
L.M.>> ==

VVM>>
VVM>> Place on IDE disk only "\boot" ( and bootloader), other on SCSI .
VVM>>


prevent default OS driver from attaching to emulated ATA controller when  
Hyper-V

VVM>>
VVM>> Disable both primary and secondary ATA controller prevent use CD-ROM 
device in VM ( guest)
VVM>>
VVM>> Because "synthetic storage driver" not handle CD-ROM devices
VVM>> ( IMHO, even more: Hyper-V host work with CD-ROM only as "PCI bus" device)


L.M.>Regarding the CD-ROM drive, there's a known problem with CD-ROM support 
and using our synthetic storage driver.
L.M.>At the moment, it's not supported correctly on FreeBSD,
L.M.>but  . . . there's a workaround  ( details skipped by VVM, {= not all simply , 
"long story" )  ,
L.M.>which we will try to get working on FreeBSD.
L.M.>This will be addressed shortly, but . . . ( skipped by VVM ) .


 May be temporary disable BlkVSC (paravirtual IDE) functional?
And enable after implement work on Hyper-V both CD-ROM and ATA disks


==
--- 000\hv_storvsc_drv_freebsd.c    Wed Apr 10 06:18:58 2013
+++ hv_storvsc_drv_freebsd.c    Wed May 08 11:59:06 2013
@@ -1449,22 +1449,25 @@
/**
 * @brief Determine type of storage device from GUID
 *
 * Using the type GUID, determine if this is a StorVSC (paravirtual
 * SCSI or BlkVSC (paravirtual IDE) device.
 *
 * @param dev a device
 * returns an enum
 */
static enum hv_storage_type
storvsc_get_storage_type(device_t dev)
{
    const char *p = vmbus_get_type(dev);

    if (!memcmp(p, &gBlkVscDeviceType, sizeof(hv_guid))) {
-        return DRIVER_BLKVSC;
+        /* TODO: enable after implement work on Hyper-V both CD-ROM and ATA 
disks
+         * return DRIVER_BLKVSC;
+         */
+        return (DRIVER_UNKNOWN);
    } else if (!memcmp(p, &gStorVscDeviceType, sizeof(hv_guid))) {
        return DRIVER_STORVSC;
    }
    return (DRIVER_UNKNOWN);
}


==


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


P.S.  Sorry, for code style -- is primary demo of _idea_




P.P.P.S.

----- Original Message ----- From: "Victor Miasnikov"
To: "Alexander Motin"
Cc: <freebsd-virtualization@freebsd.org>;  "Larry Melia" ( in fact to 3 e-mail 
address )
Sent: Tuesday, May 07, 2013 12:00 PM
Subject: Re: ATA controller and Hyper-V "synthetic storage driver" handle the IDE disks devices ( but not for the CD-ROM) Re: Hyper-V on FreeBSD

Hi!


On 07.05.2013 10:40, Victor Miasnikov wrote:
prevent default OS driver from attaching to emulated ATA controller
when Hyper-V

Disable both primary and secondary ATA controller prevent use CD-ROM
device in VM ( guest)

Because "synthetic storage driver" not handle CD-ROM devices
( IMHO, even more: Hyper-V host work with CD-ROM only as "PCI bus" device)

A.M.> Then may be possibility of blocking/hiding specific ATA channels or
A.M.> devices could be investigated.

IMHO, this ( or some like this) must be investigated
In any case, need carefully testing work CD-ROM ( primary for LiveCD and (or) 
.ISO for setup FreeBSD) in Hyper-V
enviroment


http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-April/001180.html

==
. . .
On 23.04.2013 17:07, Larry Melia wrote:
. . .
L.M.>>> Removing our ATA patches, on the other hand, results in a huge
L.M.>>> performance loss. This is because the root file system is managed by the
L.M.>>> ATA driver, which is emulated under Hyper-V.
==
VVM>>
VVM>> Place on IDE disk only "\boot" ( and bootloader), other on SCSI .
VVM>>
A.M.>
A.M.> May be instead of splitting filesystem it could be better to boot from
A.M.> "SCSI" completely and forget about "ATA"?
A.M.> Or there is no option ROM for SCSI boot in Hyper-V?
A.M.>

Yes, boot from SCSI disk in Hyper-V VM ( "guest") is impossible


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/
==

_______________________________________________
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Reply via email to