[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [SOLVED] GPLPV SCSI passthrough does not working



Thanks for that. That locking code is really nasty... do you think your patch 
is fixing the problem or just working around it?

James

> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxx [mailto:xen-devel-
> bounces@xxxxxxxxxxxxx] On Behalf Of Kazuto Yoshino
> Sent: Friday, 8 June 2012 11:37 PM
> To: xen-devel@xxxxxxxxxxxxx; yoshink@xxxxxxxxxxx
> Subject: [Xen-devel] [SOLVED] GPLPV SCSI passthrough does not working
> 
> Hi all,
> 
> SCSI passthrough of DVD drive is tried on Windows.
> If vcpus=1 is used, it works.
> However, if vcpus=2 is used, it does not work.
> The log is as follows.
> 
> 
> Hardware:
> DELL Optiplex 990
> Intel Core i5 2500
> 
> 
> Software:
> xen 4.2-unstable (25452:6bea63e6c780)
> dom0: Linux 3.1.0-rc10+ 64bit
> domU: Windows 7 SP1 64bit
> GPLPV 0.10.0.357
> 
> 
> domU config:
> kernel = "hvmloader"
> builder='hvm'
> memory = 2048
> name = "win7x64"
> vcpus=2
> vif = [ 'type=ioemu, mac=00:16:3e:19:18:7b, bridge=virbr0' ] disk = [
> 'file:/etc/xen/win7x64.img,hda,w' ] device_model = 'qemu-dm'
> sdl=0
> opengl=1
> vnc=1
> vnclisten="0.0.0.0"
> vncpasswd=''
> stdvga=0
> serial='pty'
> tsc_mode=0
> 
> 
> command:
> # xm create /etc/xen/win7x64.hvm
> # xm scsi-attach win7x64 1:0:0:0 2:0:0:0
> 
> 
> qemu-dm log:
> 12983594247656: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247656: XenPCI     Rescanning child list
> 12983594247656: XenPCI --> XenPci_EvtChildListScanForChildren
> 12983594247656: XenPCI     Found path = device/vbd/768
> 12983594247656: XenPCI     Found path = device/vif/0
> 12983594247671: XenPCI     Found path = device/vscsi/2
> 12983594247671: XenPCI <-- XenPci_EvtChildListScanForChildren
> 12983594247671: XenPCI --> XenPci_EvtChildListCreateDevice
> 12983594247671: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247671: XenPCI     device = 'vscsi', index = '2', path =
> 'device/vscsi/2'
> 12983594247671: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247671: XenPCI <-- XenPci_EvtChildListCreateDevice
> 12983594247671: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247671: XenPCI -->
> XenPciPdo_EvtDeviceWdmIrpPreprocess_START_DEVICE
> 12983594247671: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247671: XenPCI     device/vscsi/2
> 12983594247671: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247671: XenPCI     CmResourceTypeMemory (0)
> 12983594247671: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247671: XenPCI     Start = f2000000, Length = 0
> 12983594247671: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247687: XenPCI     pfn[0] = 0000d445
> 12983594247687: XenPCI     New Start = 000000000d445000, Length = 4096
> 12983594247687: XenPCI     CmResourceTypeMemory (1)
> 12983594247687: XenPCI     Start = f2000001, Length = 0
> 12983594247687: XenPCI <--
> XenPciPdo_EvtDeviceWdmIrpPreprocess_START_DEVICE
> 12983594247687: XenPCI --> XenPciPdo_EvtDevicePrepareHardware
> 12983594247687: XenPCI <-- XenPciPdo_EvtDevicePrepareHardware
> 12983594247687: XenPCI --> XenPciPdo_EvtDeviceD0Entry
> 12983594247687: XenPCI     path = device/vscsi/2
> 12983594247687: XenPCI     WdfPowerDeviceD3Final
> 12983594247687: XenPCI --> XenPci_GetBackendAndAddWatch
> 12983594247687: XenPCI <-- XenPci_GetBackendAndAddWatch
> 12983594247687: XenPCI --> XenPci_UpdateBackendState
> 12983594247687: XenPCI --> XenConfig_InitConfigPage
> 12983594247687: XenPCI     Backend State Changed to InitWait
> 12983594247687: XenPCI     fdo_driver_object = FFFFFA80025B9E70
> 12983594247687: XenPCI <-- XenPci_UpdateBackendState
> 12983594247687: XenPCI     fdo_driver_extension = FFFFFA8001869010
> 12983594247703: XenPCI <-- XenConfig_InitConfigPage
> 12983594247703: XenPCI --> XenPci_XenConfigDeviceSpecifyBuffers
> 12983594247703: XenPCI     XEN_INIT_TYPE_RING - ring-ref =
> FFFFFA8002AB9000
> 12983594247703: XenPCI     XEN_INIT_TYPE_RING - ring-ref = 16383
> 12983594247703: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247703: XenPCI     XEN_INIT_TYPE_EVENT_CHANNEL - event-
> channel = 8
> 12983594247703: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247703: XenPCI --> EvtChn_BindIrq
> 12983594247703: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247703: XenPCI <-- EvtChn_BindIrq
> 12983594247703: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247703: XenPCI --> XenPci_ChangeFrontendStateMap
> 12983594247703: XenPCI --> XenPci_ChangeFrontendState
> 12983594247703: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247703: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247703: XenPCI --> XenPci_UpdateBackendState
> 12983594247718: XenPCI     Backend State Changed to Connected
> 12983594247718: XenPCI <-- XenPci_UpdateBackendState
> 12983594247718: XenPCI <-- XenPci_ChangeFrontendState
> 12983594247718: XenPCI <-- XenPci_ChangeFrontendStateMap
> 12983594247718: XenPCI --> XenPci_ChangeFrontendStateMap
> 12983594247718: XenPCI --> XenPci_ChangeFrontendState
> 12983594247734: XenPCI <-- XenPci_ChangeFrontendState
> 12983594247734: XenPCI --> XenPci_DeviceWatchHandler
> 12983594247734: XenPCI <-- XenPci_ChangeFrontendStateMap
> 12983594247734: XenPCI <-- XenPci_DeviceWatchHandler
> 12983594247734: XenPCI <-- XenPci_XenConfigDeviceSpecifyBuffers
> 12983594247734: XenPCI <-- XenPciPdo_EvtDeviceD0Entry
> 12983594247734: XenSCSI --> XenScsi_HwScsiFindAdapter
> 12983594247734: XenSCSI     IRQL = 0
> 12983594247734: XenSCSI     BusInterruptLevel = 28
> 12983594247734: XenSCSI     BusInterruptVector = 01c
> 12983594247734: XenSCSI     RangeStart = 0d445000, RangeLength = 00001000
> 12983594247734: XenSCSI     XEN_INIT_TYPE_13
> 12983594247734: XenSCSI     XEN_INIT_TYPE_VECTORS
> 12983594247734: XenSCSI     XEN_INIT_TYPE_11
> 12983594247734: XenSCSI     XEN_INIT_TYPE_RING - ring-ref =
> FFFFFA8002AB9000
> 12983594247734: XenSCSI     XEN_INIT_TYPE_EVENT_CHANNEL - event-
> channel = 8
> 12983594247750: XenSCSI     XEN_INIT_TYPE_GRANT_ENTRIES - 144
> 12983594247750: XenSCSI     Dma64BitAddresses supported
> 12983594247750: XenPCI --> XenPci_XenBus_AddWatch
> 12983594247750: XenPCI     XenPci_XenBus_AddWatch -
> /local/domain/0/backend/vscsi/3/2/vscsi-devs = NULL
> 12983594247750: XenSCSI --> XenScsi_DevWatch
> 12983594247750: XenPCI <-- XenPci_XenBus_AddWatch
> 12983594247750: XenSCSI     Waiting for pause...
> 12983594247750: XenSCSI <-- XenScsi_HwScsiFindAdapter
> 12983594247750: XenSCSI --> XenScsi_HwScsiInitialize
> 12983594247750: XenSCSI <-- XenScsi_HwScsiInitialize
> 12983594247750: XenSCSI --> XenScsi_HwScsiAdapterControl
> 12983594247750: XenSCSI     IRQL = 0
> 12983594247750: XenSCSI     ScsiQuerySupportedControlTypes (Max = 5)
> 12983594247750: XenSCSI <-- XenScsi_HwScsiAdapterControl
> 12983594247750: XenSCSI     Busy
> 12983594247859: XenSCSI     Waiting for pause...
> 12983594247968: XenSCSI     Waiting for pause...
> 12983594248078: XenSCSI     Waiting for pause...
> 12983594248187: XenSCSI     Waiting for pause...
> 12983594248296: XenSCSI     Waiting for pause...
> 12983594248406: XenSCSI     Waiting for pause...
> 12983594248515: XenSCSI     Waiting for pause...
> 12983594248625: XenSCSI     Waiting for pause...
> 12983594248734: XenSCSI     Waiting for pause...
> 12983594248843: XenSCSI     Waiting for pause...
> 
> 
> 
> It worked, when correcting the source code of GPLPV as follows.
> 
> 
> --- a/xenscsi/xenscsi.c
> +++ b/xenscsi/xenscsi.c
> @@ -278,17 +278,27 @@
>      /* this can only be called from a watch and so is always serialised */
>      FUNCTION_ENTER();
> 
> -  #if DBG
> -  oldpause =
> -  #endif
> -    InterlockedExchange(&xsdd->shared_paused,
> SHARED_PAUSED_PASSIVE_PAUSED);
> -  ASSERT(oldpause == SHARED_PAUSED_SCSIPORT_UNPAUSED);
> -
> -  while (InterlockedCompareExchange(&xsdd->shared_paused,
> SHARED_PAUSED_SCSIPORT_PAUSED,
> SHARED_PAUSED_SCSIPORT_PAUSED) !=
> SHARED_PAUSED_SCSIPORT_PAUSED)
> +  while (1)
>      {
> -    KdPrint((__DRIVER_NAME "     Waiting for pause...\n"));
> -    wait_time.QuadPart = -100 * 1000 * 10; /* 100ms */
> -    KeDelayExecutionThread(KernelMode, FALSE, &wait_time);
> +    if (InterlockedCompareExchange(&xsdd->shared_paused,
> SHARED_PAUSED_SCSIPORT_UNPAUSED,
> SHARED_PAUSED_SCSIPORT_UNPAUSED) ==
> SHARED_PAUSED_SCSIPORT_UNPAUSED)
> +    {
> +      #if DBG
> +      oldpause =
> +      #endif
> +        InterlockedExchange(&xsdd->shared_paused,
> SHARED_PAUSED_PASSIVE_PAUSED);
> +      ASSERT(oldpause == SHARED_PAUSED_SCSIPORT_UNPAUSED);
> +    }
> +
> +    if (InterlockedCompareExchange(&xsdd->shared_paused,
> SHARED_PAUSED_SCSIPORT_PAUSED,
> SHARED_PAUSED_SCSIPORT_PAUSED) !=
> SHARED_PAUSED_SCSIPORT_PAUSED)
> +    {
> +      KdPrint((__DRIVER_NAME "     Waiting for pause...\n"));
> +      wait_time.QuadPart = -100 * 1000 * 10; /* 100ms */
> +      KeDelayExecutionThread(KernelMode, FALSE, &wait_time);
> +    }
> +    else
> +    {
> +      break;
> +    }
>      }
> 
>      KdPrint((__DRIVER_NAME "     Watch triggered on %s\n", path));
> 
> 
> Thanks,
> Kazuto Yoshino.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.