Kanoj,
we've got one left problem with my new implementation of flush_icache_page().
This function receives a vma ptr and a struct page ptr as arguments.
That means we don't know the virtual address of the userspace mapping
when flushing. We could either pass the virtual address as a new
additional argument or could move the icache flushing stuff into
update_mmu_cache() which already has all these arguments. flush_icache_page()
doesn't properly cover all code paths also, see for example this
fragment of handle_pte_fault:
[...]
tatic inline int handle_pte_fault(struct mm_struct *mm,
struct vm_area_struct * vma, unsigned long address,
int write_access, pte_t * pte)
{
pte_t entry;
entry = *pte;
if (!pte_present(entry)) {
if (pte_none(entry))
return do_no_page(mm, vma, address, write_access, pte);
return do_swap_page(mm, vma, address, pte,
pte_to_swp_entry(entry), write_access);
}
[...]
which could bring a codepage in without properly flushing the icache.
I'm not sure why things are as they are but afair flush_icache_page() was
added due to some sparc problem. So I see three approaches now:
- sprinkle some more flush_icache_pages over generic mm and add a third
vaddr argument.
- move icache flushing into update_mmu_cache.
- handle the cache flushing thing in do_page_fault in fault.c.
What do you think?
Ralf
|