diff options
author | Sam Nelson <sam.nelson@ti.com> | 2017-12-15 13:36:40 -0500 |
---|---|---|
committer | Angela Stegmaier <angelabaker@ti.com> | 2017-12-21 12:59:25 -0600 |
commit | 2eb91078f54dd0c02ec9d1709ffa82e5df571fd8 (patch) | |
tree | e8e879ad86d6c9a76a1c22fb1001bebb881d7c5c | |
parent | 5f3751f632ef92b8370cbc22af927dd32e2302d8 (diff) | |
download | ipc-2eb91078f54dd0c02ec9d1709ffa82e5df571fd8.tar.gz |
GateMP: Add cache operation to make sure the SR0 contents are synced up
Before opening the shared region, make sure the cache is
invalidated. Even though the memory was not accessed before, because of
speculative execution the memory may be in the cache line already.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rw-r--r-- | packages/ti/sdo/ipc/GateMP.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/ti/sdo/ipc/GateMP.c b/packages/ti/sdo/ipc/GateMP.c index fd7a91e..41739bb 100644 --- a/packages/ti/sdo/ipc/GateMP.c +++ b/packages/ti/sdo/ipc/GateMP.c @@ -872,6 +872,13 @@ Int ti_sdo_ipc_GateMP_attach(UInt16 remoteProcId, Ptr sharedAddr) if ((entry.ownerProcId != MultiProc_self()) && (entry.ownerProcId != MultiProc_INVALIDID)) { + + /* Make sure to invalidate cache before using shared memory content */ + if (entry.cacheEnable) { + Cache_inv(sharedAddr, ti_sdo_ipc_GateMP_getRegion0ReservedSize(), + Cache_Type_ALL, TRUE); + } + /* if not the owner of the SharedRegion */ ti_sdo_ipc_GateMP_openRegion0Reserved(sharedAddr); |