Fix RISU build for i386
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | risu_i386: move reginfo_t and related defines to risu_reginfo_i386.hrisu_i386.c risu_reginfo_i386.h | +38 | 1 reply | |
| 2/5 | risu_i386: move reginfo-related code to risu_reginfo_i386.crisu_i386.c risu_reginfo_i386.c | +68 | 1 reply | |
| 3/5 | risu_reginfo_i386: implement arch-specific reginfo interfacerisu_reginfo_i386.c | +42 | 1 reply | |
| 4/5 | risu_i386: implement missing CPU-specific functionsrisu_i386.c risu_reginfo_i386.h | +31 | 0 replies | |
| 5/5 | risu_i386: remove old unused coderisu_i386.c | +0 | 1 reply |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Alex Bennée |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386
Hi all,
here's a patch series that tries to fix the (currently broken) build of RISU for i386. With the patches applied, I am able to successfully cross-compile and run RISU for i386 on my x86_64 laptop running Debian 10 with:
$ CC='cc -m32 -std=c99' LD='ld -m32' AS='nasm -f elf32' ARCH=i386 ./configure $ make $ ./risu --master --trace test_i386.trace test_i386.bin $ ./risu --trace test_i386.trace test_i386.bin
There's a couple of points that I'd like to mention/highlight:
1. Most of it is just moving stuff around, however I've implemented reginfo_dump_mismatch (based on reginfo_dump and code in other architectures) and defined EAX as the param register. There is no support for more registers yet, that will need to be added later.
2. Note the '-std=c99' switch in the command-line above; without it, GCC defines the symbol 'i386' to 1 and the preprocessor magic for including arch-specific headers in risu.h breaks. Does anyone have an idea how to fix this in a more robust way?
3. gas (the GNU assembler) chokes on the syntax of test_i386.s; that's why I'm using nasm as the assembler above. Is that intentional? I haven't found the nasm dependency mentioned anywhere.
Also, nasm will happily emit the UD1 opcode (0F B9) with no operands (see test_i386.s). That's a bit surprising to me, since Intel's Software Developer's Manual says UD1 has two operands; I'd expect at least a follow-up ModR/M byte. gas refuses to assemble UD1 with no operands, and gdb's disassembler gets confused when I load up the nasm's binary into risu. Is there something obvious that I'm missing?
Thanks,
-Jan Bobek
P.S. This is my first time using git send-email, so please bear with
me if something goes wrong and/or let me know how I can improve my future submissions. Thank you!
Jan Bobek (5):
risu_i386: move reginfo_t and related defines to risu_reginfo_i386.h
risu_i386: move reginfo-related code to risu_reginfo_i386.c
risu_reginfo_i386: implement arch-specific reginfo interface
risu_i386: implement missing CPU-specific functions
risu_i386: remove old unused code
risu_i386.c | 140 ++++++-------------------------------------- risu_reginfo_i386.c | 104 ++++++++++++++++++++++++++++++++ risu_reginfo_i386.h | 38 ++++++++++++ 3 files changed, 160 insertions(+), 122 deletions(-) create mode 100644 risu_reginfo_i386.c create mode 100644 risu_reginfo_i386.h
Signature · 1 line
2.20.1