Lines Matching refs:base
161 unsigned long base;
169 base = read_base(GS);
170 if (base == value) {
176 base, sel);
179 if (syscall(SYS_arch_prctl, ARCH_GET_GS, &base) != 0)
181 if (base == value) {
187 base, sel);
193 unsigned long base, arch_base;
203 base = read_base(GS);
206 if (base == arch_base) {
207 printf("[OK]\tGSBASE is 0x%lx\n", base);
210 printf("[FAIL]\tGSBASE changed to 0x%lx but kernel reports 0x%lx\n", base, arch_base);
307 void test_wrbase(unsigned short index, unsigned long base)
312 printf("[RUN]\tGS = 0x%hx, GSBASE = 0x%lx\n", index, base);
315 wrgsbase(base);
326 if (newindex == index && newbase == base) {
327 printf("[OK]\tIndex and base were preserved\n");
366 unsigned long base;
410 base = read_base(GS);
411 if (base == local && sel_pre_sched == sel_post_sched) {
417 sel_pre_sched, local, sel_post_sched, base);
423 unsigned long base;
435 base = read_base(GS);
436 if (base == 0) {
440 printf("[FAIL]\tGSBASE changed to 0x%lx\n", base);
471 unsigned long base;
475 /* Read the initial base. It should be 1. */
476 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL);
477 if (base == 1) {
481 printf("[FAIL]\tGSBASE started at 0x%lx\n", base);
490 /* And read the base. */
491 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL);
493 if (base == 0 || base == 1) {
494 printf("[OK]\tGSBASE reads as 0x%lx with invalid GS\n", base);
497 printf("[FAIL]\tGSBASE=0x%lx (should be 0 or 1)\n", base);
531 unsigned long gs, base;
547 base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL);
561 * base would zero the selector. On newer kernels,
562 * this behavior has changed -- poking the base
563 * changes only the base and, if FSGSBASE is not
569 } else if (have_fsgsbase && (base != 0xFF)) {
571 printf("[FAIL]\tGSBASE changed to %lx\n", base);