Lines Matching full:stack
155 * In child, make sure there's something on the stack and in TEST()
304 unsigned long *stack; in FIXTURE() local
435 self->stack = (void *)syscall(__NR_map_shadow_stack, 0, in FIXTURE_SETUP()
438 ASSERT_FALSE(self->stack == MAP_FAILED); in FIXTURE_SETUP()
439 ksft_print_msg("Allocated stack from %p-%p\n", self->stack, in FIXTURE_SETUP()
440 self->stack + variant->stack_size); in FIXTURE_SETUP()
447 if (self->stack != MAP_FAILED) { in FIXTURE_TEARDOWN()
448 ret = munmap(self->stack, variant->stack_size); in FIXTURE_TEARDOWN()
453 /* The stack has a cap token */
456 unsigned long *stack = self->stack; in TEST_F() local
474 ASSERT_EQ(stack[cap_index], GCS_CAP(&stack[cap_index])); in TEST_F()
477 /* The top of the stack is 0 */
480 unsigned long *stack = self->stack; in TEST_F() local
488 ASSERT_EQ(stack[term_index], 0); in TEST_F()
494 self->stack[0] = 0; in TEST_F_SIGNAL()
497 /* Put it all together, we can safely switch to and from the stack */
504 /* Skip over the stack terminator and point at the cap */ in TEST_F()
517 pivot_gcspr_el0 = &self->stack[cap_index]; in TEST_F()
532 ASSERT_TRUE((unsigned long)get_gcspr() > (unsigned long)self->stack); in TEST_F()
534 (unsigned long)self->stack + variant->stack_size); in TEST_F()
536 /* We should be able to use all but 2 slots of the new stack */ in TEST_F()
548 /* We fault if we try to go beyond the end of the stack */
555 /* Skip over the stack terminator and point at the cap */ in TEST_F_SIGNAL()
570 pivot_gcspr_el0 = &self->stack[cap_index]; in TEST_F_SIGNAL()
585 ASSERT_TRUE((unsigned long)get_gcspr() > (unsigned long)self->stack); in TEST_F_SIGNAL()
587 (unsigned long)self->stack + variant->stack_size); in TEST_F_SIGNAL()
634 void *stack; in TEST_F() local
636 stack = (void *)syscall(__NR_map_shadow_stack, 0, in TEST_F()
638 ASSERT_TRUE(stack == MAP_FAILED); in TEST_F()
639 if (stack != MAP_FAILED) in TEST_F()
640 munmap(stack, variant->stack_size); in TEST_F()
645 unsigned long *stack; in FIXTURE() local
657 self->stack = (void *)syscall(__NR_map_shadow_stack, 0, in FIXTURE_SETUP()
659 ASSERT_FALSE(self->stack == MAP_FAILED); in FIXTURE_SETUP()
660 ksft_print_msg("Allocated stack from %p-%p\n", self->stack, in FIXTURE_SETUP()
661 self->stack + self->stack_size); in FIXTURE_SETUP()
668 if (self->stack != MAP_FAILED) { in FIXTURE_TEARDOWN()
669 ret = munmap(self->stack, self->stack_size); in FIXTURE_TEARDOWN()
683 ret = mprotect(self->stack, self->stack_size, variant->flags); in TEST_F()
691 ret = mprotect(self->stack, self->stack_size, in TEST_F()
709 * from enabling the stack. in main()