Alpha update
Hi,
this patch does gp and __op_param handling correctly, following a suggestion from Richard Henderson. Also adds support for PC-relative jumps. I believe the translation engine itself is now complete. And I added an Alpha disassembler lifted from binutils.
However, there are still problems with the ELF loader. It seems like some binaries want a mmaping at an offset that is not divisible by the page size:
./qemu -d /usr/local/qemu-i386/bin/ls-i386 [...]
mmap4k(start = 0x8052000, length = 592, prot = 0x3 (rw),
flags = 0x2102 (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE),
fd = 4, offset = 39040)39040 % 4096 == 2176
Alpha Linux 2.5.69 doesn't seem to handle unaligned offsets. Do other architecures? Or earlier versions? The em86 code doesn't seem to care about this at all. The only thing to handle this I can think of is to mmap anonymously and use read() to fill in the data... or am I missing something?
Signature · 1 line
Falk
Quoted 17 lines · Falk Hueffner
Hi,
this patch does gp and
__op_paramhandling correctly, following a suggestion from Richard Henderson. Also adds support for PC-relative jumps. I believe the translation engine itself is now complete. And I added an Alpha disassembler lifted from binutils.However, there are still problems with the ELF loader. It seems like some binaries want a mmaping at an offset that is not divisible by the page size:
./qemu -d
/usr/local/qemu-i386/bin/ls-i386[...]
mmap4k(start =0x8052000, length = 592, prot =0x3(rw),flags = 0x2102 (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE), fd = 4, offset = 39040)
Quoted 7 lines
39040 % 4096 == 2176
Alpha Linux 2.5.69 doesn't seem to handle unaligned offsets. Do other architecures? Or earlier versions? The em86 code doesn't seem to care about this at all. The only thing to handle this I can think of is to mmap anonymously and use
read()to fill in the data... or am I missing something?
Hi,
I commited your latest patches for Alpha.
For the mmap problem, I will integrate something like mmap4k, but I need to make some patches in it so that the 'pagemap' stuff can be used in the CPU emulator to handle self-modifying code and explicit translation cache invalidation.
BTW, it was mentionned that variable host page size support was necessary. Would a configure time probe be OK or should it be dynamically probed ?
Fabrice.
From: Fabrice Bellard <[email protected]>
Date: Sun, 11 May 2003 15:10:23 +0200
BTW, it was mentionned that variable host page size support was necessary. Would a configure time probe be OK or should it be dynamically probed ?
It must be dynamically probed using get_pagesize().
Quoted 10 lines · Fabrice Bellard
Quoted 10 lines
However, there are still problems with the ELF loader. It seems like some binaries want a mmaping at an offset that is not divisible by the page size:
./qemu -d
/usr/local/qemu-i386/bin/ls-i386[...]
mmap4k(start =0x8052000, length = 592, prot =0x3(rw),flags = 0x2102 (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE), fd = 4, offset = 39040)
Quoted 7 lines
Quoted 7 lines
39040 % 4096 == 2176
Alpha Linux 2.5.69 doesn't seem to handle unaligned offsets. Do other architecures? Or earlier versions? The em86 code doesn't seem to care about this at all. The only thing to handle this I can think of is to mmap anonymously and use
read()to fill in the data... or am I missing something?
I don't see how it is possible in this particular case: the ELF file is built to be mapped directly in memory so it is a bug in the ELF loader logic.
Note: The 2.4.x kernel also refuses unaligned offsets on i386.
Fabrice.