[PATCH] ppc64: Fix /dev/mem idea of what is memory

This adds a hack to /dev/mem (along with the other ones already there)
to prevent mapping cacheable of the IO hole.

Without this, XFree blows up on machines with enough memory to go past
the IO hole.  It also tries to prevent memory from beeing mapped
uncached.  Cache paradoxes are evil and can kill the CPU.

The necessary page_is_ram() call was added by the previous patch doing
the proper IO hole accounting.
parent eca92b62
...@@ -67,6 +67,14 @@ static inline int uncached_access(struct file *file, unsigned long addr) ...@@ -67,6 +67,14 @@ static inline int uncached_access(struct file *file, unsigned long addr)
* On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases. * On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases.
*/ */
return !(efi_mem_attributes(addr) & EFI_MEMORY_WB); return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
#elif defined(CONFIG_PPC64)
/* On PPC64, we always do non-cacheable access to the IO hole and
* cacheable elsewhere. Cache paradox can checkstop the CPU and
* the high_memory heuristic below is wrong on machines with memory
* above the IO hole... Ah, and of course, XFree86 doesn't pass
* O_SYNC when mapping us to tap IO space. Surprised ?
*/
return !page_is_ram(addr);
#else #else
/* /*
* Accessing memory above the top the kernel knows about or through a file pointer * Accessing memory above the top the kernel knows about or through a file pointer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment