qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

linux-user: Fix i386 safe-syscall.S

Clang insists that "cmp" is ambiguous with a memory destination,
requiring an explicit size suffix.

There was a true error in the use of .cfi_def_cfa_offset in the
epilogue, but changing to use the proper .cfi_adjust_cfa_offset
runs afoul of a clang bug wrt .cfi_restore_state. Better to
fold the two epilogues so that we don't trigger the bug.

Signed-off-by: Richard Henderson <rth@twiddle.net>

+6 -18
+6 -18
linux-user/host/i386/safe-syscall.inc.S
··· 69 69 safe_syscall_start: 70 70 /* if signal_pending is non-zero, don't do the call */ 71 71 mov 4+16(%esp), %eax /* signal_pending */ 72 - cmp $0, (%eax) 72 + cmpl $0, (%eax) 73 73 jnz 1f 74 74 mov 8+16(%esp), %eax /* syscall number */ 75 75 int $0x80 ··· 77 77 /* code path for having successfully executed the syscall */ 78 78 pop %ebx 79 79 .cfi_remember_state 80 - .cfi_def_cfa_offset -4 80 + .cfi_adjust_cfa_offset -4 81 81 .cfi_restore ebx 82 82 pop %edi 83 - .cfi_def_cfa_offset -4 83 + .cfi_adjust_cfa_offset -4 84 84 .cfi_restore edi 85 85 pop %esi 86 - .cfi_def_cfa_offset -4 86 + .cfi_adjust_cfa_offset -4 87 87 .cfi_restore esi 88 88 pop %ebp 89 - .cfi_def_cfa_offset -4 89 + .cfi_adjust_cfa_offset -4 90 90 .cfi_restore ebp 91 91 ret 92 92 ··· 94 94 /* code path when we didn't execute the syscall */ 95 95 .cfi_restore_state 96 96 mov $-TARGET_ERESTARTSYS, %eax 97 - pop %ebx 98 - .cfi_def_cfa_offset -4 99 - .cfi_restore ebx 100 - pop %edi 101 - .cfi_def_cfa_offset -4 102 - .cfi_restore edi 103 - pop %esi 104 - .cfi_def_cfa_offset -4 105 - .cfi_restore esi 106 - pop %ebp 107 - .cfi_def_cfa_offset -4 108 - .cfi_restore ebp 109 - ret 97 + jmp safe_syscall_end 110 98 .cfi_endproc 111 99 112 100 .size safe_syscall_base, .-safe_syscall_base