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

linux-user: MIPS set cpu to r6 CPU if binary is R6

So here we need to detect the version of binaries and set
cpu_model for it.

Signed-off-by: YunQiang Su <syq@debian.org>
[lv: original patch modified to move code into cpu_get_model()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180220173307.25125-5-laurent@vivier.eu>

authored by

YunQiang Su and committed by
Laurent Vivier
45506bdd 33dff5ff

+13
+7
include/elf.h
··· 33 33 34 34 /* Flags in the e_flags field of the header */ 35 35 /* MIPS architecture level. */ 36 + #define EF_MIPS_ARCH 0xf0000000 37 + 38 + /* Legal values for MIPS architecture level. */ 36 39 #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ 37 40 #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ 38 41 #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ ··· 40 43 #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ 41 44 #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ 42 45 #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ 46 + #define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32r2 code. */ 47 + #define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64r2 code. */ 48 + #define EF_MIPS_ARCH_32R6 0x90000000 /* MIPS32r6 code. */ 49 + #define EF_MIPS_ARCH_64R6 0xa0000000 /* MIPS64r6 code. */ 43 50 44 51 /* The ABI of a file. */ 45 52 #define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */
+3
linux-user/mips/target_elf.h
··· 9 9 #define MIPS_TARGET_ELF_H 10 10 static inline const char *cpu_get_model(uint32_t eflags) 11 11 { 12 + if ((eflags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6) { 13 + return "mips32r6-generic"; 14 + } 12 15 return "24Kf"; 13 16 } 14 17 #endif
+3
linux-user/mips64/target_elf.h
··· 9 9 #define MIPS64_TARGET_ELF_H 10 10 static inline const char *cpu_get_model(uint32_t eflags) 11 11 { 12 + if ((eflags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64R6) { 13 + return "I6400"; 14 + } 12 15 return "5KEf"; 13 16 } 14 17 #endif