[PATCH 1/3] powerpc: Complete FSCR context switch
Anton Blanchard
anton at samba.org
Wed Apr 13 20:51:12 AEST 2016
Hi Jack,
> Previously we just saved the FSCR, but only restored it in some
> settings, and never copied it thread to thread. This patch always
> restores the FSCR and formalizes new threads inheriting its setting so
> that later we can manipulate FSCR bits in start_thread.
Will this break the existing FSCR_DSCR bit handling?
if (cpu_has_feature(CPU_FTR_DSCR)) {
u64 dscr = get_paca()->dscr_default;
u64 fscr = old_thread->fscr & ~FSCR_DSCR;
if (new_thread->dscr_inherit) {
dscr = new_thread->dscr;
fscr |= FSCR_DSCR;
}
if (old_thread->dscr != dscr)
mtspr(SPRN_DSCR, dscr);
if (old_thread->fscr != fscr)
mtspr(SPRN_FSCR, fscr);
}
If not, we should modify the above so we don't write the FSCR twice.
Anton
More information about the Linuxppc-dev
mailing list