Re: [Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2018-01-24 Thread Yunqiang Su
Signed-off-by: YunQiang Su On Tue, Jan 9, 2018 at 11:39 PM, Richard Henderson wrote: > On 01/08/2018 03:34 PM, Laurent Vivier wrote: >> Peter, Riku, >> >> what do you think of the idea of using the ELF header to select the CPU >> to emulate? > >

Re: [Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2018-01-09 Thread Richard Henderson
On 01/08/2018 03:34 PM, Laurent Vivier wrote: > Peter, Riku, > > what do you think of the idea of using the ELF header to select the CPU > to emulate? I think it's a good way to cut down on mistakes and reduce -- or at least not increase -- the number of binaries we build. r~

Re: [Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2018-01-08 Thread Laurent Vivier
Peter, Riku, what do you think of the idea of using the ELF header to select the CPU to emulate? Thanks, Laurent Le 19/12/2017 à 12:50, YunQiang Su a écrit : > MIPS r6 is not just simple super set for pre-R6, > it also drops some instruction and even changes encoding for some. > But r6 binary

Re: [Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2017-12-24 Thread YunQiang Su
should something like: +int fd, retval; +off_t cur_pos; +bool is_execfd = true; +char bprm_buf[BPRM_BUF_SIZE]; + +fd = qemu_getauxval(AT_EXECFD); +if (fd == 0){ +is_execfd = false; +fd = open(path(filename), O_RDONLY); +if (fd < 0) { +

Re: [Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2017-12-23 Thread Laurent Vivier
Le 19/12/2017 à 12:50, YunQiang Su a écrit : > MIPS r6 is not just simple super set for pre-R6, > it also drops some instruction and even changes encoding for some. > But r6 binary has the same header for binfmt_misc. > So here we need to detect the version of binaries and set > cpu_model for it.

[Qemu-devel] [PATCH] linux-user: MIPS set cpu to r6 CPU if binary is R6

2017-12-19 Thread YunQiang Su
MIPS r6 is not just simple super set for pre-R6, it also drops some instruction and even changes encoding for some. But r6 binary has the same header for binfmt_misc. So here we need to detect the version of binaries and set cpu_model for it. --- include/elf.h| 4