On Wed, Nov 04, 2015 at 04:24:20PM +0100, Laszlo Ersek wrote:
> On 11/04/15 16:19, Ard Biesheuvel wrote:

[...]

> > The problem remains that VA and set/way ops are completely different
> > things. Each by-VA operation handles all copies of the same cacheline
> > throughout the cache hierarchy at once. The set/way ops, on the other
> > hand, traverse each cache level in turn, leaving a time window between
> > the completion of the L1 maintenance and the completion of the L2
> > maintenance where speculative accesses resulting in L1 misses are
> > happily served from the L2 and allocated in L1 -- unless your MMU and
> > I-cache are off. This means the logic that promotes from VA to set/way
> > ops should take MMU and I-cache state into account as well, and I am
> > not sure you would want to go there.
> 
> Thanks for this great summary.
> 
> So, why doesn't ARM provide instructions for flushing / invalidating the
> complete cache? Just curious.

I don't have a an official answer, but there are several factors that
spring to mind.

Because of system-level coherency, dirty cacheline migration, and so on,
performing an operation on the "complete cache" would mean performing
the operation on every cache in the system (e.g. CPUs, system L3,
coherent devices, etc). That's an enormous amount of data and associated
state to keep track of, and it could take an extremely long time for
such maintenance to complete.

It's almost never necessary to clean or invalidate the entire cache
hierarchy in a system. In practically every scenario, maintenance by VA
can be used to provide the necessary guarantees, so the complexity of
implementing the above can be avoided.

Thanks,
Mark.
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to