Hi,So this has historically caused problems since the linear kernel map has been accessed while prefetching, even if it's never used. Some processors like AMD athlon actually even wrote back the prefetched contents without ever using it.
I think so, yes.+ if (!shmem->map_cached)
+ prot = pgprot_writecombine(prot);
shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT,
- VM_MAP, pgprot_writecombine(PAGE_KERNEL));
+ VM_MAP, prot)
Wouldn't a vmap with pgprot_writecombine() create conflicting mappings with
the linear kernel map which is not write-combined?
Or do you change the linear kernel map of the shmem pages somewhere?Havn't seen anything doing so while browsing the code.
vmap bypassess at least theWell, I don't think the linear kernel map is ever used to access the
x86 PAT core mapping consistency check and this could potentially cause
spuriously overwritten memory.
shmem gem objects. So while this isn't exactly clean it shouldn't
cause problems in practice.
Suggestions how to fix that?