Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


DMA is not happening to NVME when DMARemappingCompatible Flag is enabled on driver

Shashi140Shashi140 Member Posts: 3
edited November 16 in NTDEV

Storport Miniport driver is installed based on number of NVME connected to system. A large chunk of WdfCommonbuffer is created on one of the instance and it is shared to other instances of driver for DMA to NVME. When DMARemappingCompatible is set to 1 , the DMA is working only on the instance where common buffer is created. On other two instances the data is read as zeroes. Anyway to solve this issue..?

Post edited by Shashi140 on

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,403

    That's how it's supposed to work, right? With DMA remapping, the address is unique to the driver.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Shashi140Shashi140 Member Posts: 3

    Agreed.. Can't this commonbuffer shared with other driver as well..?. This commonbuffer is mainly used between multiple NMVE for various purposes like caching. I tried to map the physical address( Get a physical address of common buffer by using virtual address) for other drivers by using DMA_IOMMU_INTERFACE_V2 functions but its not working.

  • Shashi140Shashi140 Member Posts: 3

    I tried to join the same dma domain(JoinDmaDomain) in other drivers where common buffer created by using DMA_OPERATIOSN callback functions. But that also doesnt work. The function joinDma Domain return status as invalid parameter. Any information why JoinDmaDomain, LeaveDmaDoimain, AllocateDomainCommonBuffer functions are used...?

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 9,043

    Hmmm... well, you don't say HOW you're undertaking this.

    The who DMA Domain handling thing is currently not well documented. So, all we can really do at this point is experiment and guess, based on the function definitions and descriptions provided. HOWEVER... what IS clear is that there are several steps necessary to get multiple devices registered within a DMA Domain, and all these steps are (currently) WDM only. So, it's not likely to be a matter of simply taking your WDF driver and calling "join this DMA domain" -- it certainly seems to ME that you'd need to (currently) use a fully WDM DMA path in your code (which CAN, indeed, be added to your WDF driver).

    But, as Mr. Roberts alluded to... the behavior you're seeing is almost certainly by design. I think you're looking in the right place by trying to use DMA Domains to solve your problem, but it sure looks to be more complicated than simply calling JoinDmaDomain from your WDF driver.

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 January 2023 Live, Online
Developing Minifilters 20 March 2023 Live, Online
Writing WDF Drivers TBD 2023 Live, Online
Internals & Software Drivers 17 April 2023 Live, Online