Are the addresses generated from GetScatterGatherList in a
SCATTER_GATHER_LIST physical or logical? That is, are they already
bus addresses that can be passed to a device?

(The old-style DMA part of the DDK docs referred to bus addresses as
"logical" addresses, then when scatter/gather DMA was introduced I saw
"physical" with no mention of a conversion routine for platforms where
physical != logical)

Re: SCATTER_GATHER_LIST "physical" or logical? by Mark

Mark
Sat Oct 14 11:47:03 CDT 2006

On Fri, 13 Oct 2006 19:45:41 -0400, BubbaGump <> wrote:

>Are the addresses generated from GetScatterGatherList in a
>SCATTER_GATHER_LIST physical or logical? That is, are they already
>bus addresses that can be passed to a device?
>
>(The old-style DMA part of the DDK docs referred to bus addresses as
>"logical" addresses, then when scatter/gather DMA was introduced I saw
>"physical" with no mention of a conversion routine for platforms where
>physical != logical)

Consider this a doc bug. I've never liked that particular confusion
anyhow. The SGL addresses are the correct ones to feed directly to
your hardware.


=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com

Re: SCATTER_GATHER_LIST "physical" or logical? by Maxim

Maxim
Sat Oct 14 14:23:53 CDT 2006

> Are the addresses generated from GetScatterGatherList in a
> SCATTER_GATHER_LIST physical or logical? That is, are they already
> bus addresses that can be passed to a device?

Logical.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Re: SCATTER_GATHER_LIST "physical" or logical? by theo

theo
Mon Oct 16 07:37:06 CDT 2006

I personally think of the SGL to be physical because they are the
physical addresses your hardware uses.
Also on wikipedia it refers to logical addressing as synonymous with
virtual addressing.


Re: SCATTER_GATHER_LIST "physical" or logical? by Maxim

Maxim
Mon Oct 16 07:42:48 CDT 2006

> I personally think of the SGL to be physical because they are the
> physical addresses your hardware uses.

Physical address is what RAM uses. The busmaster hardware uses _logical_
addresses - passed via possible bounce buffers or bridge address translators
(like AGP GART).

> Also on wikipedia it refers to logical addressing as synonymous with
> virtual addressing.

Wikipedia's terminology is different from Windows one.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Re: SCATTER_GATHER_LIST "physical" or logical? by theo

theo
Mon Oct 16 09:16:45 CDT 2006

> Wikipedia's terminology is different from Windows one.

I guess it just needs to be made clearer in the MSDN documentation (it
confused me).

For example the snippet below is from MSDN scatter gather element
documentation (it refers to physical addresses).
----------
Each element is of type SCATTER_GATHER_ELEMENT, defined as follows:

typedef struct _SCATTER_GATHER_ELEMENT {
PHYSICAL_ADDRESS Address;
ULONG Length;
ULONG_PTR Reserved;
} SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT;


Each entry in the Elements array consists of the length of a physically
contiguous scatter/gather region and its starting physical address
---------------


Re: SCATTER_GATHER_LIST "physical" or logical? by BubbaGump

BubbaGump
Mon Oct 16 10:50:16 CDT 2006

On Mon, 16 Oct 2006 16:42:48 +0400, "Maxim S. Shatskih"
<maxim@storagecraft.com> wrote:

>> I personally think of the SGL to be physical because they are the
>> physical addresses your hardware uses.
>
>Physical address is what RAM uses. The busmaster hardware uses _logical_
>addresses - passed via possible bounce buffers or bridge address translators
>(like AGP GART).

I think the term "bus address" could make the term "logical address"
more clear. If I understand right a "bus address" is an address
accessible only by a device and maps to some a physical address, and a
"logical address" is a bus address that due to some software
abstraction may map to either the original physical address to which
some user-mode virtual address refers or to the physical address of a
bounce buffer:

virtual -> physical <-> (optional bounce physical) <- bus

(I'm still left wondering if this is the sort of "bus address" meant
in "Capabilities Provided by SCSI Port" in the DDK)