Re: [PATCH 1/1] x86: restore the write back cache of reserved RAM in iounmap()

From: Thomas Gleixner
Date: Thu Nov 19 2020 - 16:01:26 EST


On Thu, Nov 19 2020 at 12:59, Andrea Arcangeli wrote:
> If reserved memory is mapped with ioremap_noncache() or ioremap_wc(),
> the kernel correctly splits the direct mapping and marks the PAGE_SIZE
> granular region uncached, so both the virtual direct mapping and the
> second virtual mapping in vmap space will be both marked uncached or
> write through (i.e. _PAGE_PCD/PWT set on the pagetable).
>
> However when iounmap is called later, nothing restores the direct
> mapping write back memtype.

Darn. This was discussed in 2008 already and survived that long?

https://lore.kernel.org/lkml/20080205011357.GA14712@xxxxxxxxxxxxxxxxxxxxx/

No idea how that happened to slip through...

Thanks,

tglx