Re: Clarification needed for PCI address translation

Pankaj Bansal

On Mon, 11 May 2020 at 05:36, Pankaj Bansal <> wrote:

But won't it?

There can be only two scenarios :
1. PCI address space coincides with CPU address space.
In this case host address = device address and translation = 0
2. PCI address space lies at some offset in CPU address space. Like the
example I mention in LX2160A
In this case host address = device address + translation, where translation >

Can there be a scenario where translation < 0 ? I don't think so
I don't see how this matters.

Translation uses unsigned 64-bit integer arithmetic, so if you need
the translation to go the other way, just subtract from
That is what confuses me. Why is this convoluted logic needed altogether ?
Why can't we use direct translation values (instead of MAX_UINT64 + 1 - translation) ?

Pankaj Bansal

Join to automatically receive all group messages.