win-pvdrivers

changeset 1087:494bfa9c34c4

Apply same fix from xenvbd_storport to fix problem with crash dump
author James Harper <james.harper@bendigoit.com.au>
date Tue Dec 24 15:43:21 2013 +1100 (2013-12-24)
parents 3d4d85c41fc6
children 53eb8a11ea2f
files xenvbd_scsiport/xenvbd.c xenvbd_scsiport/xenvbd.h
line diff
     1.1 --- a/xenvbd_scsiport/xenvbd.c	Thu Dec 12 20:06:12 2013 +1100
     1.2 +++ b/xenvbd_scsiport/xenvbd.c	Tue Dec 24 15:43:21 2013 +1100
     1.3 @@ -85,7 +85,7 @@ XenVbd_NotificationBusChangeDetected(PXE
     1.4  #include "..\xenvbd_common\common_miniport.h"
     1.5  
     1.6  
     1.7 -/* called in non-dump mode */
     1.8 +/* called in non-dump & dump mode */
     1.9  static ULONG
    1.10  XenVbd_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again) {
    1.11    PXENVBD_SCSIPORT_DATA xvsd = (PXENVBD_SCSIPORT_DATA)DeviceExtension;
    1.12 @@ -119,6 +119,8 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
    1.13      xvsd->xvdd = xvdd;
    1.14      xvdd->xvsd = xvsd;
    1.15      xvdd->aligned_buffer = (PVOID)((ULONG_PTR)((PUCHAR)xvsd->aligned_buffer_data + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
    1.16 +    /* save hypercall_stubs for crash dump */
    1.17 +    xvsd->hypercall_stubs = XnGetHypercallStubs();
    1.18    } else {
    1.19      /* make a copy of xvdd and use that copy */
    1.20      xvdd = (PXENVBD_DEVICE_DATA)xvsd->aligned_buffer_data;
    1.21 @@ -128,6 +130,8 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
    1.22      xvsd->xvdd = xvdd;
    1.23      xvdd->xvsd = xvsd;
    1.24      xvdd->aligned_buffer = (PVOID)((ULONG_PTR)((PUCHAR)xvsd->aligned_buffer_data + sizeof(XENVBD_DEVICE_DATA) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
    1.25 +    /* restore hypercall_stubs into dump_xenpci */
    1.26 +    XnSetHypercallStubs(xvsd->hypercall_stubs);
    1.27      if (xvsd->xvdd->device_state != DEVICE_STATE_ACTIVE) {
    1.28        /* if we are not connected to the ring when we start dump mode then there is nothing we can do */
    1.29        FUNCTION_MSG("Cannot connect backend in dump mode - state = %d\n", xvsd->xvdd->device_state);
     2.1 --- a/xenvbd_scsiport/xenvbd.h	Thu Dec 12 20:06:12 2013 +1100
     2.2 +++ b/xenvbd_scsiport/xenvbd.h	Tue Dec 24 15:43:21 2013 +1100
     2.3 @@ -66,6 +66,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     2.4  struct {
     2.5    PXENVBD_DEVICE_DATA xvdd;
     2.6    ULONG outstanding;
     2.7 +  PVOID hypercall_stubs;
     2.8    PSCSI_REQUEST_BLOCK stop_srb;
     2.9    /* this is the size of the buffer to allocate at the end of DeviceExtenstion. It includes an extra PAGE_SIZE-1 bytes to assure that we can always align to PAGE_SIZE */
    2.10    #define UNALIGNED_BUFFER_DATA_SIZE ((BLKIF_MAX_SEGMENTS_PER_REQUEST + 1) * PAGE_SIZE - 1)