VirtualBox

Changeset 81367 in vbox


Ignore:
Timestamp:
Oct 18, 2019 7:24:25 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134080
Message:

Storage/DevVirtioSCSI.cpp: While trying to diagnose issue seen with EFI boot, fixed problem it had working on Windows. At least Windows was able to find and format a disk

Location:
trunk/src/VBox/Devices
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r81267 r81367  
    14921492                pThis->szMsg[pThis->iMsg] = '\0';
    14931493                if (pThis->iMsg)
    1494                     LogRel2(("efi: %s\n", pThis->szMsg));
     1494                    LogRel(("efi: %s\n", pThis->szMsg));
    14951495                pThis->iMsg = 0;
    14961496            }
     
    15001500                {
    15011501                    pThis->szMsg[pThis->iMsg] = '\0';
    1502                     LogRel2(("efi: %s\n", pThis->szMsg));
     1502                    LogRel(("efi: %s\n", pThis->szMsg));
    15031503                    pThis->iMsg = 0;
    15041504                }
  • trunk/src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/VolInfo/VolInfo.c

    r80721 r81367  
    3838#include "ParseInf.h"
    3939#include "PeCoffLib.h"
     40/*
    4041
    4142#ifdef __GNUC__
    4243#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
    4344#endif
    44 
     45*/
    4546//
    4647// Utility global variables
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/VirtioScsiDxe/VirtioScsi.c

    r80721 r81367  
    338338  // response code
    339339  //
     340  DEBUG((DEBUG_VERBOSE, "virtio: Response = %d\n", Response->Response));
     341
    340342  switch (Response->Response) {
    341343  case VIRTIO_SCSI_S_OK:
  • trunk/src/VBox/Devices/EFI/Firmware/vbox-tools_def.txt

    r80935 r81367  
    241241*_*_*_DTC_PATH                     = DEF(DTC_BIN)
    242242
    243 DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
     243DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Wno-array-bounds -include AutoGen.h -fno-common
    244244DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe @VBOX_MINGW32_Wno@
    245245DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe @VBOX_MINGW32_Wno@
     
    259259DEFINE GCC_X64_RC_FLAGS            = -I binary -O elf64-x86-64        -B i386    --rename-section .data=.hii
    260260
    261 DEFINE GCC48_ALL_CC_FLAGS            = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
     261DEFINE GCC48_ALL_CC_FLAGS            = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
    262262DEFINE GCC48_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
    263263DEFINE GCC48_IA32_CC_FLAGS           = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -fno-pie -fno-pic
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r81349 r81367  
    9292#define VIRTIOSCSI_REQ_QUEUE_CNT                    1            /**< Number of req queues exposed by dev.            */
    9393#define VIRTIOSCSI_QUEUE_CNT                        VIRTIOSCSI_REQ_QUEUE_CNT + 2
    94 #define VIRTIOSCSI_MAX_LUN                          256          /* < VirtIO specification, section 5.6.4             */
    95 #define VIRTIOSCSI_MAX_COMMANDS_PER_LUN             128            /* < T.B.D. What is a good value for this?           */
    96 #define VIRTIOSCSI_MAX_SEG_COUNT                    126         /* < T.B.D. What is a good value for this?           */
     94#define VIRTIOSCSI_MAX_LUN                                    /* < VirtIO specification, section 5.6.4             */
     95#define VIRTIOSCSI_MAX_COMMANDS_PER_LUN             128          /* < T.B.D. What is a good value for this?           */
     96#define VIRTIOSCSI_MAX_SEG_COUNT                    126          /* < T.B.D. What is a good value for this?           */
    9797#define VIRTIOSCSI_MAX_SECTORS_HINT                 0x10000      /* < VirtIO specification, section 5.6.4             */
    9898#define VIRTIOSCSI_MAX_CHANNEL_HINT                 0            /* < VirtIO specification, section 5.6.4 should be 0 */
     
    781781    RT_NOREF(pszCtrlRespText);
    782782
    783     RTSGSEG aReqSegs[2];
    784     aReqSegs[0].cbSeg = sizeof(pRespHdr);
    785     aReqSegs[0].pvSeg = pRespHdr;
    786     aReqSegs[1].cbSeg = pThis->virtioScsiConfig.uSenseSize;
    787     aReqSegs[1].pvSeg = abSenseBuf;
     783    RTSGSEG aRespSegs[2];
     784    aRespSegs[0].cbSeg = sizeof(struct REQ_RESP_HDR);
     785    aRespSegs[0].pvSeg = pRespHdr;
     786    aRespSegs[1].cbSeg = pThis->virtioScsiConfig.uSenseSize;
     787    aRespSegs[1].pvSeg = abSenseBuf;
    788788
    789789    if (pbSense && pRespHdr->uSenseLen)
     
    792792        pRespHdr->uSenseLen = 0;
    793793
    794     RTSGBUF reqSegBuf;
    795     RTSgBufInit(&reqSegBuf, aReqSegs, RT_ELEMENTS(aReqSegs));
     794    RTSGBUF respSegBuf;
     795    RTSgBufInit(&respSegBuf, aRespSegs, RT_ELEMENTS(aRespSegs));
    796796
    797797    if (pThis->fResetting)
    798798        pRespHdr->uResponse = VIRTIOSCSI_S_RESET;
    799799
    800     virtioQueuePut(pThis->hVirtio, qIdx, &reqSegBuf, pDescChain, true /* fFence */);
     800    virtioQueuePut(pThis->hVirtio, qIdx, &respSegBuf, pDescChain, true /* fFence */);
    801801    virtioQueueSync(pThis->hVirtio, qIdx);
    802802
     
    966966        RTSGSEG aReqSegs[4];
    967967        aReqSegs[cSegs].pvSeg = &respHdr;
    968         aReqSegs[cSegs++].cbSeg = sizeof(respHdr);
     968        aReqSegs[cSegs++].cbSeg = sizeof(x);
    969969
    970970        aReqSegs[cSegs].pvSeg = pReq->pbSense;
     
    11451145    }
    11461146    else
     1147    if (RT_UNLIKELY(uTarget >= pThis->cTargets || !pTarget->fPresent))
     1148    {
     1149        Log2Func(("Error submitting request, target not present!!\n"));
     1150        uint8_t abSense[] = { RT_BIT(7) | SCSI_SENSE_RESPONSE_CODE_CURR_FIXED,
     1151                              0, SCSI_SENSE_NOT_READY, 0, 0, 0, 0, 10, 0, 0, 0 };
     1152        struct REQ_RESP_HDR respHdr = { 0 };
     1153        respHdr.uSenseLen = sizeof(abSense);
     1154        respHdr.uStatus   = SCSI_STATUS_CHECK_CONDITION;
     1155        respHdr.uResponse = VIRTIOSCSI_S_BAD_TARGET;
     1156        respHdr.uResidual = cbDataIn + cbDataOut;
     1157        virtioScsiReqErr(pThis, qIdx, pDescChain, &respHdr , abSense);
     1158        return VINF_SUCCESS;
     1159    }
     1160    else
    11471161    if (RT_UNLIKELY(uScsiLun != 0))
    11481162    {
    1149         Log2Func(("Error submitting request to bad target (%d) or bad LUN (%d)\n", uTarget, uScsiLun));
     1163        Log2Func(("Error submitting request to bad LUN (%d)\n", uScsiLun));
    11501164        uint8_t abSense[] = { RT_BIT(7) | SCSI_SENSE_RESPONSE_CODE_CURR_FIXED,
    11511165                              0, SCSI_SENSE_ILLEGAL_REQUEST,
     
    11571171        respHdr.uResidual = cbDataOut + cbDataIn;
    11581172        virtioScsiReqErr(pThis, qIdx, pDescChain, &respHdr, abSense);
    1159         return VINF_SUCCESS;
    1160     }
    1161     else
    1162     if (RT_UNLIKELY(uTarget >= pThis->cTargets || !pTarget->fPresent))
    1163     {
    1164         Log2Func(("Error submitting request, target not present!!\n"));
    1165         uint8_t abSense[] = { RT_BIT(7) | SCSI_SENSE_RESPONSE_CODE_CURR_FIXED,
    1166                               0, SCSI_SENSE_NOT_READY, 0, 0, 0, 0, 10, 0, 0, 0 };
    1167         struct REQ_RESP_HDR respHdr = { 0 };
    1168         respHdr.uSenseLen = sizeof(abSense);
    1169         respHdr.uStatus   = SCSI_STATUS_CHECK_CONDITION;
    1170         respHdr.uResponse = VIRTIOSCSI_S_BAD_TARGET;
    1171         respHdr.uResidual = cbDataIn + cbDataOut;
    1172         virtioScsiReqErr(pThis, qIdx, pDescChain, &respHdr , abSense);
    11731173        return VINF_SUCCESS;
    11741174    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette