Query on StorPortGetUncachedExtension ??

Will StorPortGetUncachedExtension allocate contiguous DMA memory when the value of NumberOfPhysicalBreaks parameter is more than 1

Yes, StorPortGetUncachedExtension always allocates contiguous memory.

-scott
OSR
@OSRDrivers

  1. So if the storportgetuncachedextension always allocate continious DMA able memory(either in cpu physical address space or the enddevice’s IO virtual address space), I assume the NumberOfPhysicalBreaks parameter is unused within the function ?

  2. So if the system’s physical memory becomes too much fragmented, this function is more likely to fail for larger allocations, if no address remapping hardware(IOMMU) is present between the enddevice and memory subsystem?

  3. Any particular reason for not using the NumberOfPhysicalBreaks parameter within this function?

Thanks scott.

The implementation is better explained in its SCSI equivalent. "
https://msdn.microsoft.com/en-us/library/windows/hardware/ff564639(v=vs.85).aspx
".

On Wed, Nov 29, 2017 at 10:51 PM, xxxxx@gmail.com
wrote:

> 1. So if the storportgetuncachedextension always allocate continious DMA
> able memory(either in cpu physical address space or the enddevice’s IO
> virtual address space), I assume the NumberOfPhysicalBreaks parameter is
> unused within the function ?
>
> 2. So if the system’s physical memory becomes too much fragmented, this
> function is more likely to fail for larger allocations, if no address
> remapping hardware(IOMMU) is present between the enddevice and memory
> subsystem?
>
> 3. Any particular reason for not using the NumberOfPhysicalBreaks
> parameter within this function?
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


Regards
Sachindranath
http:</http:></http:></http:>

[quote]

  1. So if the storportgetuncachedextension always allocate continious DMA
    able memory(either in cpu physical address space or the enddevice’s IO
    virtual address space), I assume the NumberOfPhysicalBreaks parameter is
    unused within the function ?

[quote] >

Correct. NumberOfPhysicalBreaks just indicates how many S/G elements the
storage adapter can support per-transfer.

Correct.

StorPortGetUncachedExtension allocates a common buffer.
NumberOfPhysicalBreaks relates to I/O buffers.

-scott
OSR
@OSRDrivers

Note that modern Windows makes an effort to rearrange assignment of physical page to free up a contiguous range, when necessary.

Thanks scott.

[quote]
Note that modern Windows makes an effort to rearrange assignment of physical
page to free up a contiguous range, when necessary.

[quote]

Does that mean windows is capable to simultaneously modify
Virtual address -> CPU physical address mappings
and
IO virtual address -> CPU physical address mappings, for the common buffer DMA pages allocated for a device, while the device is using those pages(may be by blocking the page table entries during the modification, invalidating ATC cache within the end device etc.), to avoid the memory fragmentation?.

xxxxx@gmail.com wrote:

[quote]
Note that modern Windows makes an effort to rearrange assignment of physical
page to free up a contiguous range, when necessary.

[quote]

Does that mean windows is capable to simultaneously modify
Virtual address -> CPU physical address mappings
and
IO virtual address -> CPU physical address mappings, for the common buffer DMA pages allocated for a device, while the device is using those pages(may be by blocking the page table entries during the modification, invalidating ATC cache within the end device etc.), to avoid the memory fragmentation?.

No.  Common buffers, locked buffers, and mapped IO buffers cannot
change.  Their physical addresses are sacred.

However, all the pages in the working set for a process that is not
currently in a CPU can easily be changed without affecting anyone, at
the cost of some copies.  That includes, for example, all of your
executable code.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.