Lines Matching refs:base

136 	unsigned long base;  in check_gs_value()  local
144 base = read_base(GS); in check_gs_value()
145 if (base == value) { in check_gs_value()
151 base, sel); in check_gs_value()
154 if (syscall(SYS_arch_prctl, ARCH_GET_GS, &base) != 0) in check_gs_value()
156 if (base == value) { in check_gs_value()
162 base, sel); in check_gs_value()
168 unsigned long base, arch_base; in mov_0_gs() local
178 base = read_base(GS); in mov_0_gs()
181 if (base == arch_base) { in mov_0_gs()
182 printf("[OK]\tGSBASE is 0x%lx\n", base); in mov_0_gs()
185 printf("[FAIL]\tGSBASE changed to 0x%lx but kernel reports 0x%lx\n", base, arch_base); in mov_0_gs()
281 void test_wrbase(unsigned short index, unsigned long base) in test_wrbase() argument
286 printf("[RUN]\tGS = 0x%hx, GSBASE = 0x%lx\n", index, base); in test_wrbase()
289 wrgsbase(base); in test_wrbase()
300 if (newindex == index && newbase == base) { in test_wrbase()
340 unsigned long base; in set_gs_and_switch_to() local
384 base = read_base(GS); in set_gs_and_switch_to()
385 if (base == local && sel_pre_sched == sel_post_sched) { in set_gs_and_switch_to()
388 } else if (base == local && sel_pre_sched >= 1 && sel_pre_sched <= 3 && in set_gs_and_switch_to()
395 sel_pre_sched, local, sel_post_sched, base); in set_gs_and_switch_to()
399 sel_pre_sched, local, sel_post_sched, base); in set_gs_and_switch_to()
405 unsigned long base; in test_unexpected_base() local
417 base = read_base(GS); in test_unexpected_base()
418 if (base == 0) { in test_unexpected_base()
422 printf("[FAIL]\tGSBASE changed to 0x%lx\n", base); in test_unexpected_base()
453 unsigned long base; in test_ptrace_write_gs_read_base() local
458 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL); in test_ptrace_write_gs_read_base()
459 if (base == 1) { in test_ptrace_write_gs_read_base()
463 printf("[FAIL]\tGSBASE started at 0x%lx\n", base); in test_ptrace_write_gs_read_base()
473 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL); in test_ptrace_write_gs_read_base()
475 if (base == 0 || base == 1) { in test_ptrace_write_gs_read_base()
476 printf("[OK]\tGSBASE reads as 0x%lx with invalid GS\n", base); in test_ptrace_write_gs_read_base()
479 printf("[FAIL]\tGSBASE=0x%lx (should be 0 or 1)\n", base); in test_ptrace_write_gs_read_base()
513 unsigned long gs, base; in test_ptrace_write_gsbase() local
529 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL); in test_ptrace_write_gsbase()
551 } else if (have_fsgsbase && (base != 0xFF)) { in test_ptrace_write_gsbase()
553 printf("[FAIL]\tGSBASE changed to %lx\n", base); in test_ptrace_write_gsbase()