// SPDX-License-Identifier: GPL-2.0 /* Test context switching to see if the DSCR SPR is correctly preserved * when within a transaction. * * Note: We assume that the DSCR has been left at the default value (0) * for all CPUs. * * Method: * * Set a value into the DSCR. * * Start a transaction, and suspend it (*). * * Hard loop checking to see if the transaction has become doomed. * * Now that we *may* have been preempted, record the DSCR and TEXASR SPRS. * * If the abort was because of a context switch, check the DSCR value. * Otherwise, try again. * * (*) If the transaction is not suspended we can't see the problem because * the transaction abort handler will restore the DSCR to it's checkpointed * value before we regain control.
*/
printf("Check DSCR TM context switch: ");
fflush(stdout); for (;;) { asm __volatile__ ( /* set a known value into the DSCR */ "ld 3, %[dscr1];" "mtspr %[sprn_dscr], 3;"
"li %[rv], 1;" /* start and suspend a transaction */ "tbegin.;" "beq 1f;" "tsuspend.;"
/* hard loop until the transaction becomes doomed */ "2: ;" "tcheck 0;" "bc 4, 0, 2b;"
/* record DSCR and TEXASR */ "mfspr 3, %[sprn_dscr];" "std 3, %[dscr2];" "mfspr 3, %[sprn_texasr];" "std 3, %[texasr];"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.