Re: [PATCH] arm: dma-mapping: move consistent_init to early_initcall

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Saravana Kannan
Date: Saturday, December 11, 2010 - 9:58 pm

On 12/10/2010 02:00 AM, Catalin Marinas wrote:

IMHO, trying to keep the cache fully coherent with the secure world 
without using explicit cache flush/invalidate raises the following 
concerns (in decreasing order of importance):
1. Since the secure world would need to enable the MMU to mark the pages 
as NS, it removes the possibility of secure world implementations that 
don't use MMU. The secure world image that's in use for MSM8660 as of 
today doesn't enable its MMU.
2. Even if MMU was enabled in secure world, the same binary needs to 
operate with different non-secure kernels. I'm certainly not a cache 
expert, but if I'm not mistaken, there are other page attributes that 
need to match between virt mem mappings for them to end up on the same 
cache lines (wasn't this a reason that Russell added the "already 
mapped?" check to ioremap). Trying to coordinate this between various 
non-secure kernels would be harder than having the various non-secure 
kernels do a flush/invalidate.
3. *If* a user of the SCM driver wants to pass phys addr of other memory 
pages to a service on the secure world (say, to avoid multiple copies), 
then they will also have to start coordinating on the page attributes. 
That would be harder to maintain than just an "invalidate before reading 
if secure-world service will write to this memory" approach.
4. Coordinating to make sure all the necessary page attributes match 
becomes harder if OEMs decide to make changes to the secure world 
implementation or drop in a new one.

As you and James suggested, having the NS bit set by the secure world is 
definitely a solution that would work. But IMHO, the explicit cache 
flush/invalidate approach keeps the design simple and easy to maintain.

Thanks,
Saravana
-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Russell King - ARM Linux, (Thu Dec 2, 3:19 pm)
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Russell King - ARM Linux, (Fri Dec 3, 1:36 pm)
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Russell King - ARM Linux, (Thu Dec 9, 3:38 am)
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Saravana Kannan, (Sat Dec 11, 9:58 pm)
Re: [PATCH] arm: dma-mapping: move consistent_init to ..., Saravana Kannan, (Thu Dec 16, 7:55 pm)
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Russell King - ARM Linux, (Fri Dec 17, 2:48 am)
Re: [PATCH] arm: dma-mapping: move consistent_init to ..., Saravana Kannan, (Fri Dec 17, 3:26 am)
Re: [PATCH] arm: dma-mapping: move consistent_init to earl ..., Russell King - ARM Linux, (Fri Dec 17, 3:56 am)
Re: [PATCH] arm: dma-mapping: move consistent_init to ..., Saravana Kannan, (Fri Dec 17, 4:09 am)
Re: [PATCH] arm: dma-mapping: move consistent_init to ..., Saravana Kannan, (Fri Dec 17, 4:14 pm)
Re: [PATCH] arm: dma-mapping: move consistent_init to ..., Saravana Kannan, (Mon Dec 20, 4:22 pm)