Lines Matching defs:cr4
357 unsigned long cr4;
360 cr4 = native_read_cr4();
362 if ((cr4 & X86_CR4_SMEP) != X86_CR4_SMEP) {
366 cr4 &= ~(X86_CR4_SMEP);
369 native_write_cr4(cr4);
370 if (cr4 == native_read_cr4()) {
372 cr4 |= X86_CR4_SMEP;
374 native_write_cr4(cr4);
382 * cr4 write happens, skipping any pinning. This searches for
383 * the cr4 writing instruction.
387 /* mov %rdi, %cr4 */
390 /* mov %rdi,%rax; mov %rax, %cr4 */
397 pr_info("ok: cannot locate cr4 writing call gadget\n");
403 direct_write_cr4(cr4);
408 cr4 |= X86_CR4_SMEP;
410 native_write_cr4(cr4);