[POWERPC] Fix Kexec/Kdump for power6
On Power machines supporting VRMA, Kexec/Kdump does not work. VRMA (virtual real-mode area) means that accesses with IR/DR = 0 (i.e. the MMU "off") actually still go through the hash table, using entries put there by the hypervisor. This means that when we clear out the hash table on kexec, we need to make sure these entries are left untouched. This also adds plpar_pte_read_raw() on the lines of plpar_pte_remove_raw(). Signed-off-by : Sachin Sant <sachinp@in.ibm.com> Signed-off-by : Mohan Kumar M <mohan@in.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:

committed by
Paul Mackerras

parent
7ccb4a6624
commit
b7abc5c53e
@@ -373,12 +373,23 @@ 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;
|
||||
unsigned long dummy1, dummy2, dword0;
|
||||
long lpar_rc;
|
||||
int i;
|
||||
|
||||
/* TODO: Use bulk call */
|
||||
for (i = 0; i < hpte_count; i++)
|
||||
plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user