All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nickolay <nickolay@protei.ru>
To: linux-kernel@vger.kernel.org
Subject: uncachable access to physical pages(ARM, xScale)
Date: Wed, 15 Mar 2006 00:31:56 +0300	[thread overview]
Message-ID: <4417364C.6020609@protei.ru> (raw)

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.

             reply	other threads:[~2006-03-14 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 21:31 Nickolay [this message]
2006-03-14 22:10 ` uncachable access to physical pages(ARM, xScale) Russell King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4417364C.6020609@protei.ru \
    --to=nickolay@protei.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.