Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196666
b: refs/heads/master
c: d504bed
h: refs/heads/master
v: v3
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed May 21, 2010
1 parent dea2e8c commit 8bcb3b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f90ece28c1f5b3ec13fe481406857fe92f4bc7d1
refs/heads/master: d504bed676caad29a3dba3d3727298c560628f5c
33 changes: 20 additions & 13 deletions trunk/arch/powerpc/platforms/pseries/lpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,21 +367,28 @@ static void pSeries_lpar_hptab_clear(void)
{
unsigned long size_bytes = 1UL << ppc64_pft_size;
unsigned long hpte_count = size_bytes >> 4;
unsigned long dummy1, dummy2, dword0;
struct {
unsigned long pteh;
unsigned long ptel;
} ptes[4];
long lpar_rc;
int i;
int i, j;

/* TODO: Use bulk call */
for (i = 0; i < hpte_count; i++) {
/* dont remove HPTEs with VRMA mappings */
lpar_rc = plpar_pte_remove_raw(H_ANDCOND, i, HPTE_V_1TB_SEG,
&dummy1, &dummy2);
if (lpar_rc == H_NOT_FOUND) {
lpar_rc = plpar_pte_read_raw(0, i, &dword0, &dummy1);
if (!lpar_rc && ((dword0 & HPTE_V_VRMA_MASK)
!= HPTE_V_VRMA_MASK))
/* Can be hpte for 1TB Seg. So remove it */
plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
/* Read in batches of 4,
* invalidate only valid entries not in the VRMA
* hpte_count will be a multiple of 4
*/
for (i = 0; i < hpte_count; i += 4) {
lpar_rc = plpar_pte_read_4_raw(0, i, (void *)ptes);
if (lpar_rc != H_SUCCESS)
continue;
for (j = 0; j < 4; j++){
if ((ptes[j].pteh & HPTE_V_VRMA_MASK) ==
HPTE_V_VRMA_MASK)
continue;
if (ptes[j].pteh & HPTE_V_VALID)
plpar_pte_remove_raw(0, i + j, 0,
&(ptes[j].pteh), &(ptes[j].ptel));
}
}
}
Expand Down

0 comments on commit 8bcb3b9

Please sign in to comment.