Commit bf49e6b4 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Fix problem with casting out the segment for our kernel stack

parent ff315945
......@@ -197,11 +197,23 @@ void make_slbe(unsigned long esid, unsigned long vsid, int large)
PMC_SW_PROCESSOR(stab_capacity_castouts);
/*
* Never cast out the segment for our kernel stack. Since we
* dont invalidate the ERAT we could have a valid translation
* for the kernel stack during the first part of exception exit
* which gets invalidated due to a tlbie from another cpu at a
* non recoverable point (after setting srr0/1) - Anton
*/
castout_entry = get_paca()->xStab_data.next_round_robin;
entry = castout_entry;
castout_entry++;
if (castout_entry >= naca->slb_size)
castout_entry = 1;
do {
entry = castout_entry;
castout_entry++;
if (castout_entry >= naca->slb_size)
castout_entry = 1;
asm volatile("slbmfee %0,%1" : "=r" (esid_data) : "r" (entry));
} while (esid_data.data.esid == GET_ESID((unsigned long)_get_SP()) &&
esid_data.data.v);
get_paca()->xStab_data.next_round_robin = castout_entry;
/* slbie not needed as the previous mapping is still valid. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment