uncachable access to physical pages(ARM, xScale)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Guys!

I want to change pgprot(unset L_PTE_CACHEABLE and L_PTE_BUFFERABLE) for
several pages, allocated by alloc_pages, in kernel VM, because this memory
used for sharing data between kernelspace and userland(via .mmap).
For userland VM, i done that successul next way:
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
remap_pfn_range(...);

but for kernelspace VM i has some trouble.

I was trying directly unset L_PTE_CACHEABLE | L_PTE_BUFFERABLE flags from
pte(see below), but it doesn't working, and i has problem with cache cogerency
between userland and kernelspace:

pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;

/* find pte */
addr = page_address(my_page);
pgd = pgd_offset_k(addr & PAGE_MASK);
pmd = pmd_offset(pgd, addr & PAGE_MASK);
pte = pte_offset_kernel(pmd, addr & PAGE_MASK);

/* ok, we get pte, now unset L_PTE_CACHEABLE and
   L_PTE_BUFFERABLE flags
*/
pte_val(*pte) &= ~(L_PTE_CACHEABLE|L_PTE_BUFFERABLE);

The problem descriprion simple, kernel at some time doesn't see
data, which userland writes to shared buffer, without inserting
flush_cache_all after each operation with shared buffer from kernel.

thanks,

Nickolay.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux