The implementation of copy_user_enhanced_fast_string
in the Linux Kernel copy routine uses stac
/clac
in the epilog and prolog. perf annotate
shows the following code:
stac
cmp $0x40,%edx
jb 0xffffffff91281f5c
mov %edx,%ecx
rep movsb %ds:(%rsi),%es:(%rdi)
xor %eax,%eax
clac
retq
AC
is "Alignment check (or access control) flag".
What is the reason stac
/clac
are used in the routine? What would be the consequences if we simply remove them?