Re: mmap() of /dev/kmem issue

Matthew Wilcox
2004-05-05T15:44:48Z

On Wed, May 05, 2004 at 08:08:21AM -0700, Luck, Tony wrote:
> Mapping kernel memory as uncacheable into a user process
> seems like a recipe for disaster (well at least for an
> MCA when the processor catches you using mixed attributes).

... which is why we don't do that.

See drivers/char/mem.c::mmap_mem(). We call uncached_access() which does:

#elif defined(CONFIG_IA64)
/*
* On ia64, we ignore O_SYNC because we cannot tolerate memory attribute
aliases.
*/
return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain