VirtualBox

Changeset 85045 in vbox


Ignore:
Timestamp:
Jul 3, 2020 7:07:42 AM (4 years ago)
Author:
vboxsync
Message:

Network/DevVirtioNet_1_0.cpp: Return virtioCoreVirtqAttach() to virtioCoreR3VirtqAttach() because it otherwise drags a RTStrCopy() reference into VBoxDD0 and breaks things.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevVirtioNet_1_0.cpp

    r85016 r85045  
    28592859            PVIRTIONETVIRTQ pVirtq = &pThis->aVirtqs[uVirtqNbr];
    28602860            pVirtq->idx = uVirtqNbr;
    2861             (void) virtioCoreVirtqAttach(&pThis->Virtio, pVirtq->idx, pVirtq->szName);
     2861            (void) virtioCoreR3VirtqAttach(&pThis->Virtio, pVirtq->idx, pVirtq->szName);
    28622862            pVirtq->fAttachedToVirtioCore = true;
    28632863            if (IS_VIRTQ_EMPTY(pThisCC->pDevIns, &pThis->Virtio, pVirtq->idx))
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r85025 r85045  
    24732473    for (uint16_t uVirtqNbr = 0; uVirtqNbr < VIRTIOSCSI_VIRTQ_CNT; uVirtqNbr++)
    24742474    {
    2475         rc = virtioCoreVirtqAttach(&pThis->Virtio, uVirtqNbr, VIRTQNAME(uVirtqNbr));
     2475        rc = virtioCoreR3VirtqAttach(&pThis->Virtio, uVirtqNbr, VIRTQNAME(uVirtqNbr));
    24762476        if (RT_FAILURE(rc))
    24772477            continue;
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r85025 r85045  
    296296 * @param   pDevIns     The device instance.
    297297 * @param   pVirtio     Pointer to the shared virtio state.
    298  * @param   uVirtqNbr    Virtq number
     298 * @param   uVirtqNbr   Virtq number
    299299 *
    300300 * @returns how many entries have been added to ring as a delta of the consumer's
     
    657657}
    658658
    659 int virtioCoreVirtqAttach(PVIRTIOCORE pVirtio, uint16_t uVirtqNbr, const char *pcszName)
     659#ifdef IN_RING3
     660
     661int virtioCoreR3VirtqAttach(PVIRTIOCORE pVirtio, uint16_t uVirtqNbr, const char *pcszName)
    660662{
    661663    LogFunc(("%s\n", pcszName));
     
    668670    return VINF_SUCCESS;
    669671}
    670 
    671 #ifdef IN_RING3
    672672
    673673/** API Fuunction: See header file */
     
    749749}
    750750
    751 
    752751/** API Function: See header file */
    753752int virtioCoreR3VirtqAvailBufGet(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtqNbr,
     
    10981097}
    10991098
    1100 
    11011099/**
     1100 * This is called from the MMIO callback code when the guest does an MMIO access to the
     1101 * mapped queue notification capability area corresponding to a particular queue, to notify
     1102 * the queue handler of available data in the avail ring of the queue (VirtIO 1.0, 4.1.4.4.1)
     1103 *
     1104 * @param   pDevIns     The device instance.
     1105 * @param   pVirtio     Pointer to the shared virtio state.
     1106 * @param   uVirtqNbr   Virtq to check for guest interrupt handling preference
     1107 * @param   uNotifyIdx  Notification index
    11021108 */
    11031109static void virtioCoreVirtqNotified(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtqNbr, uint16_t uNotifyIdx)
    11041110{
    1105 
    11061111    PVIRTIOCORECC pVirtioCC = PDMDEVINS_2_DATA_CC(pDevIns, PVIRTIOCORECC);
    11071112
     
    11331138 * @param   pDevIns     The device instance.
    11341139 * @param   pVirtio     Pointer to the shared virtio state.
    1135  * @param   uVirtqNbr    Virtq to check for guest interrupt handling preference
     1140 * @param   uVirtqNbr   Virtq to check for guest interrupt handling preference
    11361141 */
    11371142static void virtioCoreNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtqNbr)
    11381143{
    1139 
    11401144    Assert(uVirtqNbr < RT_ELEMENTS(pVirtio->aVirtqState));
    11411145    PVIRTQSTATE pVirtqState = &pVirtio->aVirtqState[uVirtqNbr];
     
    12651269/**
    12661270 * Invoked by this implementation when guest driver resets the device.
    1267  * The driver itself will not  until the device has read the status change.
     1271 * The driver itself will not until the device has read the status change.
    12681272 */
    12691273static void virtioGuestR3WasReset(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, PVIRTIOCORECC pVirtioCC)
     
    13041308            VIRTIO_DEV_CONFIG_LOG_ACCESS(uDeviceFeatures, VIRTIO_PCI_COMMON_CFG_T, uOffsetOfAccess);
    13051309            LogFunc(("... WARNING: Guest attempted to write readonly virtio_pci_common_cfg.device_feature (ignoring)\n"));
    1306 //            return VINF_SUCCESS;
    1307             return VINF_IOM_MMIO_UNUSED_00; /** @todo which is right this or VINF_SUCCESS? */
     1310            return VINF_IOM_MMIO_UNUSED_00;
    13081311        }
    13091312        else /* Guest READ pCommonCfg->uDeviceFeatures */
     
    17901793}
    17911794
    1792 
    17931795/*********************************************************************************************************************************
    17941796*   Device Level                                                                                                                 *
     
    20152017    if (pVirtioCC->pbDevSpecificCfg)
    20162018    {
    2017         /* Following capability (via VirtIO 1.0, section 4.1.4.6). Client defines the
    2018          * device-specific config fields struct and passes size to this constructor */
     2019        /* Device specific config capability (via VirtIO 1.0, section 4.1.4.6).
     2020         * Client defines the device-specific config struct and passes size to virtioCoreR3Init()
     2021         * to inform this. */
    20192022        pCfg = (PVIRTIO_PCI_CAP_T)&pPciDev->abConfig[pCfg->uCapNext];
    20202023        pCfg->uCfgType = VIRTIO_PCI_CAP_DEVICE_CFG;
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.h

    r85032 r85045  
    424424 * @returns VBox status code.
    425425 */
    426 int  virtioCoreVirtqAttach(PVIRTIOCORE pVirtio, uint16_t uVirtqNbr, const char *pcszName);
     426int  virtioCoreR3VirtqAttach(PVIRTIOCORE pVirtio, uint16_t uVirtqNbr, const char *pcszName);
    427427
    428428/**
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