Hi,
--- Quote Start ---
I think at least some support for the aliasing problem is there actually - see cache_flush.c, syscall.c, Documentation/cachetlb.txt.
--- Quote End ---
Oh, I'm sorry that my opinion " there is no mechanism to avoid the alias problem." was an overstatement. There exists the traces of implementation for 'alias problem', but I'm not sure whether these will work well or not. As mentioned in the 'Documentation/cachetlb.txt', the 'alias problem' affects only the D-cache. If we have 'alias' copies of same physical address contents, we must take special care of those flushing from the D-cache. But whether we will have the 'alias' or not depends on the functionality of Linux kernel. So the problem is a little bit difficult. It seems to me that functions 'copy_from_user_page' and 'copy_to_user_page' will work well
void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
unsigned long user_vaddr,
void *dst, void *src, int len)
{
flush_cache_page(vma, user_vaddr, page_to_pfn(page));
memcpy(dst, src, len);
flush_dcache_range((unsigned long)src, (unsigned long)src+len);
if(vma->vm_flags & VM_EXEC) {
flush_icache_range((unsigned long)src, (unsigned long)src+len);
}
}
void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
unsigned long user_vaddr,
void *dst, void *src, int len)
{
flush_cache_page(vma, user_vaddr, page_to_pfn(page));
memcpy(dst, src, len);
flush_dcache_range((unsigned long)dst, (unsigned long)dst+len);
if(vma->vm_flags & VM_EXEC) {
flush_icache_range((unsigned long)dst, (unsigned long)dst+len);
}
}
, beacuse these are only the 'alias problems' between user-land virtual addresses and kernel's ones. But I'm still not sure for the case of shared maps among user-lands.
Kazu