On 29/02/2024 17:56, Alex Bennée wrote:

I think there is some scope to re-factor some code that is shared with
cpu_memory_rw_debug. In fact rather than using this to feed
mcd_read_write_memory() maybe you really just want a
cpu_physical_memory_rw_debug()?

Although as you are going from vaddr anyway where does
cpu_memory_rw_debug() fail for you?

Hi Alex, thanks for your feedback!

The reason I wrote the memory access the way I did is the following: Regardless of the state of the CPU, MCD always wants to be able to access all memory spaces (here secure and non-secure).

For example, if the CPU is currently in secure mode I still want to be able to perform a memory access via the non-secure memory space. This access should be successful, if a non-secure memory address is requested and unsuccessful, if a secure memory address is requested.

I could not get this decoupled memory access to work using the existing cpu_memory_rw_debug(). It only works properly when using the current main memory space (e.g. secure when the CPU is in secure mode).

I did not want to make changes to the existing memory functions because I think I could not have checked for all repercussions.

Best regards

Nicolas

Reply via email to