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

linux-user: fix O_TMPFILE handling

Since O_TMPFILE might differ between guest and host,
add it to the bitmask_transtbl. While at it, fix the definitions
of O_DIRECTORY etc which should arm32 according to kernel sources.

This fixes open14 and openat03 ltp testcases. Fixes:

https://bugs.launchpad.net/qemu/+bug/1709170

+14 -1
+4
linux-user/strace.c
··· 838 838 #ifdef O_PATH 839 839 FLAG_TARGET(O_PATH), 840 840 #endif 841 + #ifdef O_TMPFILE 842 + FLAG_TARGET(O_TMPFILE), 843 + FLAG_TARGET(__O_TMPFILE), 844 + #endif 841 845 FLAG_END, 842 846 }; 843 847
+3
linux-user/syscall.c
··· 342 342 #if defined(O_PATH) 343 343 { TARGET_O_PATH, TARGET_O_PATH, O_PATH, O_PATH }, 344 344 #endif 345 + #if defined(O_TMPFILE) 346 + { TARGET_O_TMPFILE, TARGET_O_TMPFILE, O_TMPFILE, O_TMPFILE }, 347 + #endif 345 348 /* Don't terminate the list prematurely on 64-bit host+guest. */ 346 349 #if TARGET_O_LARGEFILE != 0 || O_LARGEFILE != 0 347 350 { TARGET_O_LARGEFILE, TARGET_O_LARGEFILE, O_LARGEFILE, O_LARGEFILE, },
+7 -1
linux-user/syscall_defs.h
··· 2416 2416 #define TARGET_O_CLOEXEC 010000000 2417 2417 #define TARGET___O_SYNC 000100000 2418 2418 #define TARGET_O_PATH 020000000 2419 - #elif defined(TARGET_ARM) || defined(TARGET_M68K) 2419 + #elif defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_AARCH64) 2420 2420 #define TARGET_O_DIRECTORY 040000 /* must be a directory */ 2421 2421 #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ 2422 2422 #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ ··· 2512 2512 #endif 2513 2513 #ifndef TARGET_O_PATH 2514 2514 #define TARGET_O_PATH 010000000 2515 + #endif 2516 + #ifndef TARGET___O_TMPFILE 2517 + #define TARGET___O_TMPFILE 020000000 2518 + #endif 2519 + #ifndef TARGET_O_TMPFILE 2520 + #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY) 2515 2521 #endif 2516 2522 #ifndef TARGET_O_NDELAY 2517 2523 #define TARGET_O_NDELAY TARGET_O_NONBLOCK