// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2015, Sam Bobroff, IBM Corp. * * Test the kernel's system call code to ensure that a system call * made from within an active HTM transaction is aborted with the * correct failure code. * Conversely, ensure that a system call made from within a * suspended transaction can succeed.
*/
for (count = 0; timercmp(&now, &end, <); count++) { /* * Test a syscall within a suspended transaction and verify * that it succeeds.
*/
FAIL_IF(getppid_tm(false, true) == -1); /* Should succeed. */
/* * Test a syscall within an active transaction and verify that * it fails with the correct failure code.
*/
FAIL_IF(getppid_tm(false, false) != -1); /* Should fail... */
FAIL_IF(!failure_is_persistent()); /* ...persistently... */
FAIL_IF(!failure_is_syscall()); /* ...with code syscall. */
/* Now do it all again with scv if it is available. */ if (have_hwcap2(PPC_FEATURE2_SCV)) {
FAIL_IF(getppid_tm(true, true) == -1); /* Should succeed. */
FAIL_IF(getppid_tm(true, false) != -1); /* Should fail... */
FAIL_IF(!failure_is_persistent()); /* ...persistently... */
FAIL_IF(!failure_is_syscall()); /* ...with code syscall. */
}
gettimeofday(&now, 0);
}
printf("%d active and suspended transactions behaved correctly.\n", count);
printf("(There were %d transaction retries.)\n", retries);
return 0;
}
int main(void)
{ return test_harness(tm_syscall, "tm_syscall");
}
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.