Re: [PATCHv8 00/12] Contiguous Memory Allocator

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Russell King - ARM Linux
Date: Tuesday, January 4, 2011 - 10:19 am

On Tue, Jan 04, 2011 at 05:23:37PM +0100, Johan MOSSBERG wrote:

Here's the extracts from the architecture reference manual:

* If the same memory locations are marked as having different
  cacheability attributes, for example by the use of aliases in a
  virtual to physical address mapping, behavior is UNPREDICTABLE.

A3.5.7 Memory access restrictions

Behavior is UNPREDICTABLE if the same memory location:
* is marked as Shareable Normal and Non-shareable Normal
* is marked as having different memory types (Normal, Device, or
  Strongly-ordered)
* is marked as having different cacheability attributes
* is marked as being Shareable Device and Non-shareable Device memory.

Such memory marking contradictions can occur, for example, by the use of
aliases in a virtual to physical address mapping.

Glossary:
UNPREDICTABLE
Means the behavior cannot be relied upon. UNPREDICTABLE behavior must not
represent security holes.  UNPREDICTABLE behavior must not halt or hang
the processor, or any parts of the system. UNPREDICTABLE behavior must not
be documented or promoted as having a defined effect.


Given the extract from the architecture reference manual, do you want
to run a system where you can't predict what the behaviour will be if
you have two mappings present, one which is cacheable and one which is
non-cacheable, and you're relying on the non-cacheable mapping to never
return data from the cache?

What if during your testing, it appears to work correctly, but out in
the field, someone's loaded a different application to your setup
resulting in different memory access patterns, causing cache lines to
appear in the non-cacheable mapping, and then the CPU hits them on
subsequent accesses corrupting data...

You can't say that will never happen if you're relying on this
unpredictable behaviour.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHv8 00/12] Contiguous Memory Allocator, Michal Nazarewicz, (Wed Dec 15, 1:34 pm)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Kyungmin Park, (Thu Dec 23, 2:30 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 3:06 am)
RE: [PATCHv8 00/12] Contiguous Memory Allocator, Marek Szyprowski, (Thu Dec 23, 3:58 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 5:19 am)
RE: [PATCHv8 00/12] Contiguous Memory Allocator, Marek Szyprowski, (Thu Dec 23, 6:09 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Tomasz Fujak, (Thu Dec 23, 6:35 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Michal Nazarewicz, (Thu Dec 23, 6:41 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 6:44 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 6:48 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 6:51 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Tomasz Fujak, (Thu Dec 23, 7:04 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Tomasz Fujak, (Thu Dec 23, 7:08 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 7:16 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Thu Dec 23, 7:20 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Felipe Contreras, (Thu Dec 23, 7:42 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Michal Nazarewicz, (Thu Dec 23, 8:02 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Tomasz Fujak, (Thu Dec 23, 8:35 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, David Brown, (Thu Dec 23, 11:04 am)
RE: [PATCHv8 00/12] Contiguous Memory Allocator, Johan MOSSBERG, (Tue Jan 4, 9:23 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Michał Nazarewicz, (Tue Jan 4, 9:59 am)
Re: [PATCHv8 00/12] Contiguous Memory Allocator, Russell King - ARM Linux, (Tue Jan 4, 10:19 am)
RE: [PATCHv8 00/12] Contiguous Memory Allocator, Santosh Shilimkar, (Tue Jan 4, 10:31 am)