All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386
@ 2019-04-08 18:27 ` Jan Bobek
  0 siblings, 0 replies; 27+ messages in thread
From: Jan Bobek @ 2019-04-08 18:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jan Bobek, Richard Henderson, Alex Bennée, Peter Maydell,
	Stefan Hajnoczi

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

-- 
2.20.1

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-05-15 14:33 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 18:27 [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386 Jan Bobek
2019-04-08 18:27 ` Jan Bobek
2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 1/5] risu_i386: move reginfo_t and related defines to risu_reginfo_i386.h Jan Bobek
2019-04-08 18:27   ` Jan Bobek
2019-04-25 13:39   ` Alex Bennée
2019-04-25 13:39     ` Alex Bennée
2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 2/5] risu_i386: move reginfo-related code to risu_reginfo_i386.c Jan Bobek
2019-04-08 18:27   ` Jan Bobek
2019-04-25 13:39   ` Alex Bennée
2019-04-25 13:39     ` Alex Bennée
2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 3/5] risu_reginfo_i386: implement arch-specific reginfo interface Jan Bobek
2019-04-08 18:27   ` Jan Bobek
2019-04-25 13:42   ` Alex Bennée
2019-04-25 13:42     ` Alex Bennée
2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 4/5] risu_i386: implement missing CPU-specific functions Jan Bobek
2019-04-08 18:27   ` Jan Bobek
2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 5/5] risu_i386: remove old unused code Jan Bobek
2019-04-08 18:27   ` Jan Bobek
2019-04-25 13:43   ` Alex Bennée
2019-04-25 13:43     ` Alex Bennée
2019-04-08 22:18 ` [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386 Richard Henderson
2019-04-08 22:18   ` Richard Henderson
2019-04-12  1:43   ` Jan Bobek
2019-04-12  1:43     ` Jan Bobek
2019-04-25 13:45 ` Alex Bennée
2019-04-25 13:45   ` Alex Bennée
2019-05-15 14:32   ` Jan Bobek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.