Changeset 36400 in vbox
- Timestamp:
- Mar 24, 2011 1:14:26 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/rawpci.h
r36340 r36400 27 27 #define ___VBox_rawpci_h 28 28 29 #include <iprt/types.h> 29 #include <VBox/types.h> 30 #include <VBox/sup.h> 30 31 31 32 RT_C_DECLS_BEGIN … … 35 36 */ 36 37 typedef uint32_t PCIRAWDEVHANDLE; 38 39 /** 40 * Physical memory action enumeration. 41 */ 42 typedef enum PCIRAWMEMINFOACTION 43 { 44 /* Pages mapped. */ 45 PCIRAW_MEMINFO_MAP, 46 /* Pages unmapped. */ 47 PCIRAW_MEMINFO_UNMAP, 48 /** The usual 32-bit type blow up. */ 49 PCIRAW_MEMINFO_32BIT_HACK = 0x7fffffff 50 } PCIRAWMEMINFOACTION; 51 52 /** 53 * Callback to notify raw PCI subsystem about mapping/unmapping of 54 * host pages to the guest. Typical usecase is to register physical 55 * RAM pages with IOMMU, so that it could allow DMA for PCI devices 56 * directly from the guest RAM. 57 * Region shall be one or more contigous (both host and guest) pages 58 * of physical memory. 59 * 60 * @param pVM VM pointer. 61 * @param HostStart Physical address of region start on the host. 62 * @param GuestStart Physical address of region start on the guest. 63 * @param cMemSize Region size in bytes. 64 * @param Action Action performed. 65 66 */ 67 typedef DECLCALLBACK(void) FNRAWPCICONTIGPHYSMEMINFO(PVM pVM, RTHCPHYS HostStart, RTGCPHYS GuestStart, uint64_t cMemSize, PCIRAWMEMINFOACTION Action); 68 typedef FNRAWPCICONTIGPHYSMEMINFO *PFNRAWPCICONTIGPHYSMEMINFO; 37 69 38 70 /** Data being part of the VM structure. */ … … 40 72 { 41 73 /* Shall only be interpreted by the host PCI driver. */ 42 RTR0PTR pDriverData; 74 RTR0PTR pDriverData; 75 /* Callback called when mapping of host pages to the guest changes. */ 76 PFNRAWPCICONTIGPHYSMEMINFO pfnContigMemInfo; 43 77 } RAWPCIVM; 44 78 typedef RAWPCIVM *PRAWPCIVM; -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r36340 r36400 83 83 84 84 DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis) 85 { 86 RTSemFastMutexRelease(pThis->hFastMtx); 87 } 88 89 DECLINLINE(int) vboxPciVmLock(PVBOXRAWPCIDRVVM pThis) 90 { 91 int rc = RTSemFastMutexRequest(pThis->hFastMtx); 92 AssertRC(rc); 93 return rc; 94 } 95 96 DECLINLINE(void) vboxPciVmUnlock(PVBOXRAWPCIDRVVM pThis) 85 97 { 86 98 RTSemFastMutexRelease(pThis->hFastMtx); … … 380 392 381 393 rc = vboxPciOsDevPowerStateChange(pThis, aState); 382 394 383 395 vboxPciDevUnlock(pThis); 384 396 -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h
r36343 r36400 100 100 #ifdef RT_OS_LINUX 101 101 # ifdef VBOX_WITH_IOMMU 102 struct iommu_domain* iommu_domain;102 struct iommu_domain* pIommuDomain; 103 103 # endif 104 104 #endif 105 int32_t fFlags; 105 106 } VBOXRAWPCIDRVVM; 106 107 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r36260 r36400 509 509 510 510 if (assignments.size() > 0) 511 { 511 512 InsertConfigNode(pDevices, "pciraw", &pPciDevs); 513 514 /* 515 * Currently, using IOMMU needed for PCI passthrough 516 * requires RAM preallocation. 517 * @todo: check if we can lift this requirement 518 */ 519 PCFGMNODE pRoot = CFGMR3GetParent(pDevices); 520 Assert(pRoot); 521 CFGMR3RemoveValue(pRoot, "RamPreAlloc"); 522 CFGMR3InsertInteger(pRoot, "RamPreAlloc", 1); 523 } 512 524 513 525 for (size_t iDev = 0; iDev < assignments.size(); iDev++) -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r35917 r36400 151 151 *******************************************************************************/ 152 152 #define LOG_GROUP LOG_GROUP_GMM 153 #include <VBox/rawpci.h> 153 154 #include <VBox/vmm/vm.h> 154 155 #include <VBox/vmm/gmm.h> … … 2092 2093 pPage->Private.pfn = GMM_PAGE_PFN_UNSHAREABLE; 2093 2094 /* else: NIL_RTHCPHYS nothing */ 2095 #if 0 2096 #ifdef VBOX_WITH_PCI_PASSTHROUGH 2097 if (pVM->rawpci.s.pfnContigMemInfo) 2098 pVM->rawpci.s.pfnContigMemInfo(pVM, paPages[iPage].HCPhysGCPhys, 0, PAGE_SIZE, PCIRAW_MEMINFO_MAP); 2099 #endif 2100 #endif 2094 2101 2095 2102 paPages[iPage].idPage = NIL_GMM_PAGEID;
Note:
See TracChangeset
for help on using the changeset viewer.