Lines Matching full:stack

154 		 * In child, make sure there's something on the stack and  in TEST()
303 unsigned long *stack; in FIXTURE() local
434 self->stack = (void *)syscall(__NR_map_shadow_stack, 0, in FIXTURE_SETUP()
437 ASSERT_FALSE(self->stack == MAP_FAILED); in FIXTURE_SETUP()
438 ksft_print_msg("Allocated stack from %p-%p\n", self->stack, in FIXTURE_SETUP()
439 self->stack + variant->stack_size); in FIXTURE_SETUP()
446 if (self->stack != MAP_FAILED) { in FIXTURE_TEARDOWN()
447 ret = munmap(self->stack, variant->stack_size); in FIXTURE_TEARDOWN()
452 /* The stack has a cap token */
455 unsigned long *stack = self->stack; in TEST_F() local
473 ASSERT_EQ(stack[cap_index], GCS_CAP(&stack[cap_index])); in TEST_F()
476 /* The top of the stack is 0 */
479 unsigned long *stack = self->stack; in TEST_F() local
487 ASSERT_EQ(stack[term_index], 0); in TEST_F()
493 self->stack[0] = 0; in TEST_F_SIGNAL()
496 /* Put it all together, we can safely switch to and from the stack */
503 /* Skip over the stack terminator and point at the cap */ in TEST_F()
516 pivot_gcspr_el0 = &self->stack[cap_index]; in TEST_F()
531 ASSERT_TRUE((unsigned long)get_gcspr() > (unsigned long)self->stack); in TEST_F()
533 (unsigned long)self->stack + variant->stack_size); in TEST_F()
535 /* We should be able to use all but 2 slots of the new stack */ in TEST_F()
547 /* We fault if we try to go beyond the end of the stack */
554 /* Skip over the stack terminator and point at the cap */ in TEST_F_SIGNAL()
569 pivot_gcspr_el0 = &self->stack[cap_index]; in TEST_F_SIGNAL()
584 ASSERT_TRUE((unsigned long)get_gcspr() > (unsigned long)self->stack); in TEST_F_SIGNAL()
586 (unsigned long)self->stack + variant->stack_size); in TEST_F_SIGNAL()
633 void *stack; in TEST_F() local
635 stack = (void *)syscall(__NR_map_shadow_stack, 0, in TEST_F()
637 ASSERT_TRUE(stack == MAP_FAILED); in TEST_F()
638 if (stack != MAP_FAILED) in TEST_F()
639 munmap(stack, variant->stack_size); in TEST_F()
644 unsigned long *stack; in FIXTURE() local
656 self->stack = (void *)syscall(__NR_map_shadow_stack, 0, in FIXTURE_SETUP()
658 ASSERT_FALSE(self->stack == MAP_FAILED); in FIXTURE_SETUP()
659 ksft_print_msg("Allocated stack from %p-%p\n", self->stack, in FIXTURE_SETUP()
660 self->stack + self->stack_size); in FIXTURE_SETUP()
667 if (self->stack != MAP_FAILED) { in FIXTURE_TEARDOWN()
668 ret = munmap(self->stack, self->stack_size); in FIXTURE_TEARDOWN()
682 ret = mprotect(self->stack, self->stack_size, variant->flags); in TEST_F()
690 ret = mprotect(self->stack, self->stack_size, in TEST_F()
708 * from enabling the stack. in main()