diff options
author | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2008-07-09 11:28:07 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-14 22:24:59 -0400 |
commit | 443dcac4d89622cbfc61f53523007979879d6f8e (patch) | |
tree | 8cf25bd652135b0079a9e73f79095434c70906c4 | |
parent | 0f47331475201c7785454030a9976c8ac902a35d (diff) |
powerpc: Remove unnecessary condition when sanity-checking WIMG bits
It is okay for both _PAGE_GUARDED and _PAGE_COHERENT (G and M) to be set
in the same pte. In fact, even if that were not the case, there doesn't
seem to be any place where G is set without also setting I (_PAGE_NO_CACHE),
so the test for I is sufficient as a condition to clear _PAGE_COHERENT
when filling the hash table.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/cell/beat_htab.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c index 81467ff055c8..2e67bd840e01 100644 --- a/arch/powerpc/platforms/cell/beat_htab.c +++ b/arch/powerpc/platforms/cell/beat_htab.c | |||
@@ -112,7 +112,7 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group, | |||
112 | if (!(vflags & HPTE_V_BOLTED)) | 112 | if (!(vflags & HPTE_V_BOLTED)) |
113 | DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); | 113 | DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); |
114 | 114 | ||
115 | if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) | 115 | if (rflags & _PAGE_NO_CACHE) |
116 | hpte_r &= ~_PAGE_COHERENT; | 116 | hpte_r &= ~_PAGE_COHERENT; |
117 | 117 | ||
118 | spin_lock(&beat_htab_lock); | 118 | spin_lock(&beat_htab_lock); |
@@ -334,7 +334,7 @@ static long beat_lpar_hpte_insert_v3(unsigned long hpte_group, | |||
334 | if (!(vflags & HPTE_V_BOLTED)) | 334 | if (!(vflags & HPTE_V_BOLTED)) |
335 | DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); | 335 | DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); |
336 | 336 | ||
337 | if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) | 337 | if (rflags & _PAGE_NO_CACHE) |
338 | hpte_r &= ~_PAGE_COHERENT; | 338 | hpte_r &= ~_PAGE_COHERENT; |
339 | 339 | ||
340 | /* insert into not-volted entry */ | 340 | /* insert into not-volted entry */ |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 38b5927b3629..52a80e5840e8 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -305,8 +305,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
305 | flags = 0; | 305 | flags = 0; |
306 | 306 | ||
307 | /* Make pHyp happy */ | 307 | /* Make pHyp happy */ |
308 | if ((rflags & _PAGE_GUARDED) || | 308 | if ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU)) |
309 | ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU))) | ||
310 | hpte_r &= ~_PAGE_COHERENT; | 309 | hpte_r &= ~_PAGE_COHERENT; |
311 | 310 | ||
312 | lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); | 311 | lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); |