My question is just for curiosity, I'm not a developer of MacOS Thunderbolt drivers so I have no experience with that.
I've come across this page about thunderbolt drivers and IOMMU on MacOS. From what I've understood, when the driver asks for a memory address, the address obtained is not physical but it is a virtual address mapped by the IOMMU. I think this is due to the security risks of using DMA without a IOMMU. However there are some option for a driver to bypass remapping, for example calling an IODMACommand object’s initWithSpecification method with mappingOptions set to kBypassed. However in the page it is said that calling a method like that to obtain an unmapped physical address and use that for DMA will break the driver.
So my question is: in a thunderbolt driver, what's the purpose of asking for unmapped physical address if that address cannot be used for DMA?
Sorry if this question may seem dumb, but like I said I've no experience with this kind of stuffs, I'm just very curious.
What's the purpose of bypassing remapping in Thunderbolt driver?
273 Views Asked by namerand At
1
There are 1 best solutions below
Related Questions in MACOS
- How do I customize NSOutlineView to have border color?
- Force sublime text to use PATH from the shell value
- Do executable files always open a terminal window on MacOS?
- setting OpenGL version in objective-C
- C std library don't appear to be linked in object file
- Cross compile simple standard C program on Linux for Mac
- How to generate request format for WCF web service method for Mac and iPhone
- Bundle Multiple Xamarin apps in one pkg installer
- How to Handle Command Line Prompt from a Cocoa App
- AVFoundation - Process each image separately
- CMYK NSImage get pixel data
- how i get the mac of ibeacon or BLE
- Set JAVA_HOME on Mac
- Finding active IPv6 interfaces under Mac OS (using Python)
- OSX: Why is my launchd agent running my script twice?
Related Questions in DMA
- STM32F4 Handling peripheral error while making a DMA Transfer (RX)
- disabling CONFIG_NET_DMA
- how is DMA-capable memory defined?
- Need Help to Develop Linux PCIe Driver using DMA Concept
- STM32F4 TIM6 interruption doesn't happen while DMA working
- Linux DMA from User Space Bus Error
- What does DMA Channel virtualization mean?
- What is the use of the DMA controller in a processor?
- C++: Using dynamic memory allocation to write a function similar to the C realloc() function (i.e. change it's size)
- Is there a way to read a file into memory using DMA in Linux?
- Direct Memory Access with JTAG in Trust Zone
- FAST DMA benefit from FPGA using threads in C++
- I'm looking for sample code to service the USCI (UART) on an MSP430 via DMA not interrupts
- UART DMA for varying sized arrays
- How to benchmark PCIe and DMA?
Related Questions in IOKIT
- OSX kext: Can't open IOResouces in ::start() due to owned by some other
- IOKit: Not receiving HID interrupt reports from DualShock 4 controller connected with Bluetooth
- IOServiceOpen returns kIOReturnUnsupported despite driver's user client instantiation
- HID Device Interface in macOS
- I wanna debug mac driver on a different machine, but I can't create symbol file. It alway fail, can anyone have an idea?
- Reading audio from a usb synth
- Get callback using IOKit using an Interrupt Input Endpoint
- Which KPI Library Is IODeviceMemory Declared In?
- How to import IOPMLib.h from IO kit?
- Listing all connected iDevices in Cocoa
- Acessing a serial to USB device with I/O kit
- How can i delete a file using vnode?
- Unable to find symbol links for IOKit kext
- How to map memory in DriverKit using IOMemoryDescriptor::CreateMapping?
- DriverKit - Access to hub for SuspendDevice() equivalent
Related Questions in KERNEL-EXTENSION
- OSX kext: Can't open IOResouces in ::start() due to owned by some other
- BLE interfce mac OS 10.12 class porting
- Kext driver cannot find symbol OSPrintBacktrace
- IOServiceOpen returns kIOReturnUnsupported despite driver's user client instantiation
- I can't find file "/usr/lib/kernex.exp" in my AIX 6.1 when I write a Kernel Extension
- Kernel extension not removed from /Library/StagedExtension in High Sierra OSX
- Network Kernel Extensions case Mac Kernel Panic
- Which KPI Library Is IODeviceMemory Declared In?
- Permission Problems with KextManagerLoadKextWithIdentifier
- Unable to find symbol links for IOKit kext
- how to monitor operation on mac platform
- how come osx kernel get so many times of file operations
- Packages installer how to detect if user consent to kext
- Xcode: Link kernel framework to kernel extension?
- trying to run kextutil on kext file returns permissions error
Related Questions in IOMMU
- Cannot open /dev/vfio/noiommu-0: Operation not permitted
- Linux DMA 32-bit dma_alloc_coherent wrong behavior when intel_iommu=on
- INTEL VT-D Root table and context table relationship
- Is an address in a PCI transaction translated by IOMMU by default on x86 platform?
- What's the purpose of bypassing remapping in Thunderbolt driver?
- Address Translation in a Bus hierarchy
- how is 'stream ID' or 'iommu specifier' determined in PCIe root complex mode?
- Reading 0 when reading SMMUv2 registers from user space in Linux
- How to add VFIO-IOMMU in KVM virtual machine (Aarch64)?
- No Host Display After GPU Passthrough
- check for IOMMU support on linux
- IOMMU initialization without BIOS support
- with IOMMU, why don't we have to pin the DMA buffer pages?
- kernelstub can't find kernel or initrd image on Ubuntu 21.04
- Why does my host OS experience high system cpu usage on cores performing networking when using SR-IOV?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There's really no reason to do this in a Thunderbolt driver because as you say the Thunderbolt device only gets to "see" addresses in the IOMMU's virtual address space.
You'd use unmapped addresses if you were writing a driver for something that interfaces with system memory using real physical addresses from the perspective of the CPU. There's not much opportunity for 3rd party developers to do this type of thing on a real Mac, but when writing drivers for (para-)virtualised "hardware" in VMs, or presumably, when writing drivers for Hackintoshes, there are certainly situations where you're talking to a real or virtual device or service which is not "behind" an IOMMU - usually, this means anything not on any PCIe bus.
For example, I used the
kIOMemoryMapperNoneoption toIOMemoryDescriptor:: getPhysicalSegment()in my driver for the Virtio memory balloon. The memory balloon device is really some code on the VM host which operates on VM-CPU-physical page addresses, so if there's a (virtualised) IOMMU in the virtual machine system, sending the memory balloon "mapped" physical addresses would not have the intended result.