Lines Matching +full:0 +full:x05
1 #define MAGIC_NUM 0xdeadbeefdeadbeefUL
2 #define GS_BASE 0x400000
20 unsigned long memw = 0x123456789abcdeful; in test_push()
22 memset(mem, 0x55, (void *)stack_top - mem); in test_push()
39 report(stack_top[-3] == 0x123456789abcdeful, "push mem"); in test_push()
47 unsigned long memw = 0x123456789abcdeful; in test_pop()
50 memset(mem, 0x55, (void *)stack_top - mem); in test_pop()
90 stack_top[-1] = 0x778899; in test_pop()
101 report(tmp == (ulong)stack_top && tmp3 == 0x778899, "leave"); in test_pop()
103 rbp = 0xaa55aa55bb66bb66ULL; in test_pop()
109 "enter $0x1238, $0 \n\t" in test_pop()
115 report(rsp == (unsigned long)stack_top - 8 - 0x1238 in test_pop()
117 && stack_top[-1] == 0xaa55aa55bb66bb66ULL, in test_pop()
127 asm volatile ("data16 mov %%cs, %0":"=m"(*(m + sizeof(unsigned long)))); in test_ljmp()
128 asm volatile ("rex64 ljmp *%0"::"m"(*m)); in test_ljmp()
129 res = 0; in test_ljmp()
139 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xchg()
141 "mov $0xfedcba9876543210, %%rax\n\t" in test_xchg()
147 report(rax == 0xfedcba98765432ef && *memq == 0x123456789abcd10, in test_xchg()
150 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xchg()
152 "mov $0xfedcba9876543210, %%rax\n\t" in test_xchg()
158 report(rax == 0xfedcba987654cdef && *memq == 0x123456789ab3210, in test_xchg()
161 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xchg()
163 "mov $0xfedcba9876543210, %%rax\n\t" in test_xchg()
169 report(rax == 0x89abcdef && *memq == 0x123456776543210, in test_xchg()
172 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xchg()
174 "mov $0xfedcba9876543210, %%rax\n\t" in test_xchg()
180 report(rax == 0x123456789abcdef && *memq == 0xfedcba9876543210, in test_xchg()
189 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xadd()
191 "mov $0xfedcba9876543210, %%rax\n\t" in test_xadd()
197 report(rax == 0xfedcba98765432ef && *memq == 0x123456789abcdff, in test_xadd()
200 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xadd()
202 "mov $0xfedcba9876543210, %%rax\n\t" in test_xadd()
208 report(rax == 0xfedcba987654cdef && *memq == 0x123456789abffff, in test_xadd()
211 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xadd()
213 "mov $0xfedcba9876543210, %%rax\n\t" in test_xadd()
219 report(rax == 0x89abcdef && *memq == 0x1234567ffffffff, in test_xadd()
222 asm volatile("mov $0x123456789abcdef, %%rax\n\t" in test_xadd()
224 "mov $0xfedcba9876543210, %%rax\n\t" in test_xadd()
230 report(rax == 0x123456789abcdef && *memq == 0xffffffffffffffff, in test_xadd()
239 *mem = 0; a = 1; d = 2; in test_muldiv()
240 asm (ASM_TRY("1f") "divq %3; movb $0, %2; 1:" in test_muldiv()
245 asm (ASM_TRY("1f") "divq %3; movb $0, %2; 1:" in test_muldiv()
247 report(a == 0x1ffffffb1b963b33ul && d == 0x273ba4384ede2ul && !ex, "divq (1)"); in test_muldiv()
249 aa = 0x1111111111111111; dd = 0x2222222222222222; in test_muldiv()
250 *mem = 0x3333333333333333; a = aa; d = dd; in test_muldiv()
252 report(a == 0x1111111111110363 && d == dd, "mulb mem"); in test_muldiv()
253 *mem = 0x3333333333333333; a = aa; d = dd; in test_muldiv()
255 report(a == 0x111111111111c963 && d == 0x2222222222220369, "mulw mem"); in test_muldiv()
256 *mem = 0x3333333333333333; a = aa; d = dd; in test_muldiv()
258 report(a == 0x962fc963 && d == 0x369d036, "mull mem"); in test_muldiv()
259 *mem = 0x3333333333333333; a = aa; d = dd; in test_muldiv()
261 report(a == 0x2fc962fc962fc963 && d == 0x369d0369d0369d0, "mulq mem"); in test_muldiv()
270 v = 0x0102030405060708ULL; in test_mmx()
271 asm("movq %1, %0" : "=m"(*mem) : "y"(v)); in test_mmx()
273 *mem = 0x8070605040302010ull; in test_mmx()
274 asm("movq %1, %0" : "=y"(v) : "m"(*mem)); in test_mmx()
281 insn_ram[0] = 0xc6; in test_rip_relative()
282 insn_ram[1] = 0x05; in test_rip_relative()
284 insn_ram[6] = 0x01; in test_rip_relative()
286 insn_ram[7] = 0xc3; in test_rip_relative()
288 *mem = 0; in test_rip_relative()
290 report(*mem == 0x10000, "movb $imm, 0(%%rip)"); in test_rip_relative()
296 *mem = 0xabcdef12u; in test_cmov()
297 asm ("movq $0x1234567812345678, %%rax\n\t" in test_cmov()
302 report(val == 0x12345678ul, "cmovnel"); in test_cmov()
308 uint16_t fcw = 0; /* all exceptions unmasked */ in test_mmx_movq_mf()
331 asm volatile (ASM_TRY("1f") "jmp *%0; 1:" : : "m"(*mem)); in test_jmp_noncanonical()
338 /* RAX based, should #GP(0) */ in test_reg_noncanonical()
339 asm volatile(ASM_TRY("1f") "orq $0, (%[noncanonical]); 1:" in test_reg_noncanonical()
341 report(exception_vector() == GP_VECTOR && exception_error_code() == 0, in test_reg_noncanonical()
342 "non-canonical memory access, should %s(0), got %s(%u)", in test_reg_noncanonical()
346 /* RSP based, should #SS(0) */ in test_reg_noncanonical()
347 asm volatile(ASM_TRY("1f") "orq $0, (%%rsp,%[noncanonical],1); 1:" in test_reg_noncanonical()
349 report(exception_vector() == SS_VECTOR && exception_error_code() == 0, in test_reg_noncanonical()
350 "non-canonical rsp-based access, should %s(0), got %s(%u)", in test_reg_noncanonical()
354 /* RBP based, should #SS(0) */ in test_reg_noncanonical()
355 asm volatile(ASM_TRY("1f") "orq $0, (%%rbp,%[noncanonical],1); 1:" in test_reg_noncanonical()
357 report(exception_vector() == SS_VECTOR && exception_error_code() == 0, in test_reg_noncanonical()
358 "non-canonical rbp-based access, should %s(0), got %s(%u)", in test_reg_noncanonical()
365 /* mov $0x9090909090909090, %rcx */ in test_movabs()
367 asm(KVM_FEP "mov $0x9090909090909090, %0" : "=c" (rcx) : "0" (0)); in test_movabs()
368 report(rcx == 0x9090909090909090, "64-bit mov imm2"); in test_movabs()
373 asm volatile(KVM_FEP "mov %0, %%fs" :: "r" (KERNEL_CS)); /* RPL=0 */ in load_dpl0_seg()
380 run_in_user((usermode_func)load_dpl0_seg, GP_VECTOR, 0, 0, 0, 0, in test_user_load_dpl0_seg()
383 report(raised_vector, "Wanted #GP on CPL=3 DPL=0 segment load"); in test_user_load_dpl0_seg()
406 *mem = 0; in test_sreg()
407 asm volatile("mov %0, %%ss" : : "m"(*mem)); in test_sreg()
408 report(read_ss() == 0, "mov null, %%ss"); in test_sreg()
412 asm volatile(ASM_TRY("1f") "mov %0, %%ss; 1:" : : "m"(*mem)); in test_sreg()
414 exception_error_code() == 0 && read_ss() == 0, in test_sreg()
419 asm volatile(ASM_TRY("1f") "mov %0, %%ss; 1:" : : "m"(*mem)); in test_sreg()
421 exception_error_code() == KERNEL_DS && read_ss() == 0, in test_sreg()
434 asm volatile("mov %%gs:(%1), %0" : "=r"(ret) : "r"(dummy_ptr)); in usr_gs_mov()
455 0, 0, 0, 0, &raised_vector); in test_iret()