Page 1 of 1

Endpoint writes to Root Complex

PostPosted:
by Guest
Your articles have been very helpful. I have another question that I can't find an answer too.

How does an endpoint get valid host CPU addresses to write too? No where in the enumeration process does it indicate an address range that an endpoint is allowed to write too. Do I have to post a mem write to an agreed upon endpoint address that contains a host base address for endpoint memory writes or did I miss something in the configuration/enumeration process?

It seems strange that an endpoint would be allowed to just write anywhere in host memory space.

thanks again,

gary

Re: Endpoint writes to Root Complex

PostPosted:
by support
Hi,

There is no specification on how the peripheral knows the addresses it can write to. But the common (well, probably only) way it's done is that the host informs the peripheral's logic about the bus address range it's allowed to write to by writing to registers in the endpoint's BAR space. How exactly is implementation specific.

And yes, in practice, any endpoint can write to any address on the bus (including to the BAR addresses of other endpoints for peer-to-peer communication). Relatively recent memory controllers have a unit called IOMMU, which translates and possibly denies access to certain memory regions, but these are usually not activated on common desktop computer. So yes, a faulty endpoint can easily trash the entire system.

Eli

Re: Endpoint writes to Root Complex

PostPosted:
by Guest
Thanks!, that clears that up and yes I have an MMU for inbound mem writes that I will have to use.

gary