win-pvdrivers

changeset 1076:0243e3b47f36

Get hypercall_stubs on xenvbd init, and restore them on crash.
author James Harper <james.harper@bendigoit.com.au>
date Mon Dec 09 13:30:47 2013 +1100 (2013-12-09)
parents 5e8aeb18279c
children ebf4d299224b
files xenvbd_storport/xenvbd.c xenvbd_storport/xenvbd.h
line diff
     1.1 --- a/xenvbd_storport/xenvbd.c	Mon Dec 09 13:30:14 2013 +1100
     1.2 +++ b/xenvbd_storport/xenvbd.c	Mon Dec 09 13:30:47 2013 +1100
     1.3 @@ -141,6 +141,9 @@ XenVbd_VirtualHwStorFindAdapter(PVOID De
     1.4    FUNCTION_MSG("aligned_buffer_data = %p\n", xvdd->aligned_buffer_data);
     1.5    FUNCTION_MSG("aligned_buffer = %p\n", xvdd->aligned_buffer);
     1.6  
     1.7 +  /* save hypercall_stubs for crash dump */
     1.8 +  xvdd->hypercall_stubs = XnGetHypercallStubs();
     1.9 +
    1.10    ConfigInfo->MaximumTransferLength = 4 * 1024 * 1024; //BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE;
    1.11    ConfigInfo->NumberOfPhysicalBreaks = ConfigInfo->MaximumTransferLength >> PAGE_SHIFT; //BLKIF_MAX_SEGMENTS_PER_REQUEST - 1;
    1.12    FUNCTION_MSG("ConfigInfo->MaximumTransferLength = %d\n", ConfigInfo->MaximumTransferLength);
    1.13 @@ -193,6 +196,8 @@ XenVbd_HwStorFindAdapter(PVOID DeviceExt
    1.14    if (xvdd->device_state != DEVICE_STATE_ACTIVE) {
    1.15      return SP_RETURN_ERROR;
    1.16    }
    1.17 +  /* restore hypercall_stubs into dump_xenpci */
    1.18 +  XnSetHypercallStubs(xvdd->hypercall_stubs);
    1.19    /* make sure original xvdd is set to DISCONNECTED or resume will not work */
    1.20    ((PXENVBD_DEVICE_DATA)ConfigInfo->Reserved)->device_state = DEVICE_STATE_DISCONNECTED;
    1.21    InitializeListHead(&xvdd->srb_list);
     2.1 --- a/xenvbd_storport/xenvbd.h	Mon Dec 09 13:30:14 2013 +1100
     2.2 +++ b/xenvbd_storport/xenvbd.h	Mon Dec 09 13:30:47 2013 +1100
     2.3 @@ -100,6 +100,7 @@ struct {
     2.4    BOOLEAN aligned_buffer_in_use;
     2.5    STOR_POWER_ACTION power_action;
     2.6    STOR_DEVICE_POWER_STATE power_state;
     2.7 +  PVOID hypercall_stubs;
     2.8    ULONG aligned_buffer_size;
     2.9    PVOID aligned_buffer;
    2.10  /*