VirtualBox

Changeset 88827 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 3, 2021 11:46:01 AM (4 years ago)
Author:
vboxsync
Message:

Storage/DevVirtioSCSI: Fix a few things to get code working on Windows again well enough to see vscsi disks in Windows Disk formatting utility, see @BugRef(9440), comment #150

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r85415 r88827  
    1212
    1313/*
    14  * Copyright (C) 2006-2020 Oracle Corporation
     14 * Copyright (C) 2006-2021 Oracle Corporation
    1515 *
    1616 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8484#define VIRTIOSCSI_VIRTQ_CNT                        (VIRTIOSCSI_REQ_VIRTQ_CNT + 2)
    8585#define VIRTIOSCSI_MAX_TARGETS                      256         /**< T.B.D. Figure out a a good value for this.      */
    86 #define VIRTIOSCSI_MAX_LUN                          256         /**< VirtIO specification, section 5.6.4             */
     86#define VIRTIOSCSI_MAX_LUN                                   /**< VirtIO specification, section 5.6.4             */
    8787#define VIRTIOSCSI_MAX_COMMANDS_PER_LUN             128         /**< T.B.D. What is a good value for this?           */
    8888#define VIRTIOSCSI_MAX_SEG_COUNT                    126         /**< T.B.D. What is a good value for this?           */
     
    12701270    }
    12711271
     1272#if 0
    12721273    if (RT_LIKELY(!cbDataIn || !cbDataOut || pThis->fHasInOutBufs)) /* VirtIO 1.0, 5.6.6.1.1 */
    12731274    { /*  likely */ }
     
    12801281                                   VIRTIOSCSI_S_FAILURE, abSense, sizeof(abSense), cbSenseCfg);
    12811282    }
    1282 
     1283#endif
    12831284    /*
    12841285     * Have underlying driver allocate a req of size set during initialization of this device.
     
    17101711        for (unsigned i = 0; i < VIRTIOSCSI_VIRTQ_CNT; i++)
    17111712            pThis->afVirtqAttached[i] = false;
    1712     }
     1713
     1714        /*
     1715         * BIOS may change these values. When the OS comes up, and KVM driver accessed
     1716         * through the Windows, assumes they are the default size. So as per the VirtIO 1.0 spec,
     1717         * 5.6.4, these device configuration values must be set to default upon device reset.
     1718         */
     1719        pThis->virtioScsiConfig.uSenseSize = VIRTIOSCSI_SENSE_SIZE_DEFAULT;
     1720        pThis->virtioScsiConfig.uCdbSize   = VIRTIOSCSI_CDB_SIZE_DEFAULT;
     1721    }
     1722
     1723
    17131724}
    17141725
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r85819 r88827  
    974974static void virtioCoreVirtqNotified(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtq, uint16_t uNotifyIdx)
    975975{
    976     PVIRTIOCORECC pVirtioCC = PDMDEVINS_2_DATA_CC(pDevIns, PVIRTIOCORECC);
     976    PVIRTIOCORECC pVirtioCC = PDMINS_2_DATA_CC(pDevIns, PVIRTIOCORECC);
     977
    977978
    978979    /* See VirtIO 1.0, section 4.1.5.2 It implies that uVirtq and uNotifyIdx should match.
     
    14081409        return virtioCommonCfgAccessed(pDevIns, pVirtio, pVirtioCC, false /* fWrite */, uOffset, cb, pv);
    14091410
    1410     if (MATCHES_VIRTIO_CAP_STRUCT(off, cb, uOffset, pVirtio->LocIsrCap) && cb == sizeof(uint8_t))
     1411    if (MATCHES_VIRTIO_CAP_STRUCT(off, cb, uOffset, pVirtio->LocIsrCap))
    14111412    {
    14121413        *(uint8_t *)pv = pVirtio->uISR;
    14131414        Log6Func(("Read and clear ISR\n"));
    1414         pVirtio->uISR = 0; /* VirtIO specification requires reads of ISR to clear it */
     1415        pVirtio->uISR = 0; /* VirtIO spec requires reads of ISR to clear it */
    14151416        virtioLowerInterrupt(pDevIns, 0);
    14161417        return VINF_SUCCESS;
    14171418    }
    14181419
    1419     ASSERT_GUEST_MSG_FAILED(("Bad read access to mapped capabilities region: off=%RGp cb=%u\n", off, cb));
     1420    ASSERT_GUEST_MSG_FAILED(("Bad read access to mapped capabilities region: off=%RGp cb=%u\n"));
    14201421    return VINF_IOM_MMIO_UNUSED_00;
    14211422}
     
    15001501
    15011502        if (  (uLength != 1 && uLength != 2 && uLength != 4)
    1502             || cb != uLength
    15031503            || pPciCap->uBar != VIRTIO_REGION_PCI_CAP)
    15041504        {
Note: See TracChangeset for help on using the changeset viewer.

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