2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 12:46:49 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-27 13:44:50 +10:00
|
|
|
|
2007-10-31 16:42:19 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 12:46:49 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-06 13:11:04 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-11 15:26:41 -08:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2014-09-17 14:39:39 +10:00
|
|
|
|
2007-05-04 16:47:51 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2014-09-17 14:39:39 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-05-27 13:44:50 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-27 13:50:33 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-27 13:44:50 +10:00
|
|
|
|
2009-05-27 13:50:33 +10:00
|
|
|
|
2009-05-27 13:44:50 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2009-05-27 13:44:50 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
2009-09-01 15:48:42 +00:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
2008-09-24 11:01:24 -05:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-19 19:34:09 +00:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-16 15:54:21 -05:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-24 11:01:24 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2009-03-10 17:53:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2014-09-19 10:36:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 17:04:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-19 10:36:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-19 10:36:09 +02:00
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-31 16:42:19 +11:00
|
|
|
|
2009-08-18 19:00:34 +00:00
|
|
|
|
2007-10-31 16:42:19 +11:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
|
|
|
|
|
2008-07-14 08:08:45 -05:00
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
|
|
|
|
|
2007-10-31 16:42:19 +11:00
|
|
|
|
2009-08-18 19:00:34 +00:00
|
|
|
|
2007-10-31 16:42:19 +11:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2008-07-08 15:54:40 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
2008-06-14 09:12:44 +10:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 17:04:38 +01:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
powerpc: Add 64 bit version of huge_ptep_set_wrprotect
The implementation of huge_ptep_set_wrprotect() directly calls
ptep_set_wrprotect() to mark a hugepte write protected. However this
call is not appropriate on ppc64 kernels as this is a small page only
implementation. This can lead to the hash not being flushed correctly
when a mapping is being converted to COW, allowing processes to continue
using the original copy.
Currently huge_ptep_set_wrprotect() unconditionally calls
ptep_set_wrprotect(). This is fine on ppc32 kernels as this call is
generic. On 64 bit this is implemented as:
pte_update(mm, addr, ptep, _PAGE_RW, 0);
On ppc64 this last parameter is the page size and is passed directly on
to hpte_need_flush():
hpte_need_flush(mm, addr, ptep, old, huge);
And this directly affects the page size we pass to flush_hash_page():
flush_hash_page(vaddr, rpte, psize, ssize, 0);
As this changes the way the hash is calculated we will flush the wrong
pages, potentially leaving live hashes to the original page.
Move the definition of huge_ptep_set_wrprotect() to the 32/64 bit specific
headers.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-06-26 19:55:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
powerpc/mm: Rework I$/D$ coherency (v3)
This patch reworks the way we do I and D cache coherency on PowerPC.
The "old" way was split in 3 different parts depending on the processor type:
- Hash with per-page exec support (64-bit and >= POWER4 only) does it
at hashing time, by preventing exec on unclean pages and cleaning pages
on exec faults.
- Everything without per-page exec support (32-bit hash, 8xx, and
64-bit < POWER4) does it for all page going to user space in update_mmu_cache().
- Embedded with per-page exec support does it from do_page_fault() on
exec faults, in a way similar to what the hash code does.
That leads to confusion, and bugs. For example, the method using update_mmu_cache()
is racy on SMP where another processor can see the new PTE and hash it in before
we have cleaned the cache, and then blow trying to execute. This is hard to hit but
I think it has bitten us in the past.
Also, it's inefficient for embedded where we always end up having to do at least
one more page fault.
This reworks the whole thing by moving the cache sync into two main call sites,
though we keep different behaviours depending on the HW capability. The call
sites are set_pte_at() which is now made out of line, and ptep_set_access_flags()
which joins the former in pgtable.c
The base idea for Embedded with per-page exec support, is that we now do the
flush at set_pte_at() time when coming from an exec fault, which allows us
to avoid the double fault problem completely (we can even improve the situation
more by implementing TLB preload in update_mmu_cache() but that's for later).
If for some reason we didn't do it there and we try to execute, we'll hit
the page fault, which will do a minor fault, which will hit ptep_set_access_flags()
to do things like update _PAGE_ACCESSED or _PAGE_DIRTY if needed, we just make
this guys also perform the I/D cache sync for exec faults now. This second path
is the catch all for things that weren't cleaned at set_pte_at() time.
For cpus without per-pag exec support, we always do the sync at set_pte_at(),
thus guaranteeing that when the PTE is visible to other processors, the cache
is clean.
For the 64-bit hash with per-page exec support case, we keep the old mechanism
for now. I'll look into changing it later, once I've reworked a bit how we
use _PAGE_EXEC.
This is also a first step for adding _PAGE_EXEC support for embedded platforms
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-02-10 16:02:37 +00:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
2015-01-19 17:04:38 +01:00
|
|
|
|
2009-08-18 19:00:34 +00:00
|
|
|
|
2015-01-19 17:04:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-09 09:35:00 +00:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-16 05:52:30 +10:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-26 14:21:52 -07:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-16 16:00:18 -08:00
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 10:57:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 10:57:34 +01:00
|
|
|
|
2007-04-30 16:30:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|