mbox series

[RFC,v1,00/23] Add RISC-V TCG backend support

Message ID cover.1542321076.git.alistair.francis@wdc.com
Headers show
Series Add RISC-V TCG backend support | expand

Message

Alistair Francis Nov. 15, 2018, 10:33 p.m. UTC
This patch set adds RISC-V backend support to QEMU. This is based on
Michael Clark's original work with some patches ontop.

This has been slightly tested and can run other architecture softmmu
code for a number of instructions but eventually QEMU will either
seg fault or generate an illigal instruction (depending on the guest
architecture).

I haven't tested linux user support at all yet. I think Michael had that
working reliably though and hopefully my changes haven't broken it. I'll
test both a lot more before I send a full patchset.

My hope of submitting an RFC is that some extra eyes on the code might
help catch what is wrong. Comparing the guest CPU state to a working
version hasn't given any hints as the states match, even up until the
generated code segfaults.

This branch can be found here:
https://github.com/alistair23/qemu/tree/mainline/alistair/tcg-backend-upstream.next

The working version with Michael's orignal patch and work ontop can be
found here:
https://github.com/alistair23/qemu/tree/mainline/alistair/tcg-backend.next


Alistair Francis (23):
  elf.h: Add the RISCV ELF magic numbers
  linux-user: Add host dependency for RISC-V 32-bit
  linux-user: Add host dependency for RISC-V 64-bit
  exec: Add RISC-V GCC poison macro
  riscv: Add the tcg-target header file
  riscv: Add the tcg target registers
  riscv: tcg-target: Regiser the JIT
  riscv: tcg-target: Add support for the constraints
  riscv: tcg-target: Add the immediate encoders
  riscv: tcg-target: Add the instruction emitters
  riscv: tcg-target: Add the relocation functions
  riscv: tcg-target: Add the mov and movi instruction
  riscv: tcg-target: Add the extract instructions
  riscv: tcg-target: Add the out load and store instructions
  riscv: tcg-target: Add branch and jump instructions
  riscv: tcg-target: Add slowpath load and store instructions
  riscv: tcg-target: Add direct load and store instructions
  riscv: tcg-target: Add the out op decoder
  riscv: tcg-target: Add the prologue generation
  riscv: tcg-target: Add the target init code
  tcg: Add RISC-V cpu signal handler
  dias: Add RISC-V support
  configure: Add support for building RISC-V host

 accel/tcg/user-exec.c             |   48 +
 configure                         |   12 +-
 disas.c                           |   10 +-
 include/elf.h                     |   55 +
 include/exec/poison.h             |    1 +
 linux-user/host/riscv32/hostdep.h |   11 +
 linux-user/host/riscv64/hostdep.h |   11 +
 tcg/riscv/tcg-target.h            |  173 +++
 tcg/riscv/tcg-target.inc.c        | 1728 +++++++++++++++++++++++++++++
 9 files changed, 2045 insertions(+), 4 deletions(-)
 create mode 100644 linux-user/host/riscv32/hostdep.h
 create mode 100644 linux-user/host/riscv64/hostdep.h
 create mode 100644 tcg/riscv/tcg-target.h
 create mode 100644 tcg/riscv/tcg-target.inc.c

Comments

no-reply@patchew.org Nov. 16, 2018, 8:31 a.m. UTC | #1
Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: cover.1542321076.git.alistair.francis@wdc.com
Type: series
Subject: [Qemu-devel] [RFC v1 00/23]  Add RISC-V TCG backend support

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
e0946be configure: Add support for building RISC-V host
769ab2a dias: Add RISC-V support
88c2947 tcg: Add RISC-V cpu signal handler
19e47a6 riscv: tcg-target: Add the target init code
506445c riscv: tcg-target: Add the prologue generation
496bf6b riscv: tcg-target: Add the out op decoder
7d5359d riscv: tcg-target: Add direct load and store instructions
25c5371 riscv: tcg-target: Add slowpath load and store instructions
4ca5f0c riscv: tcg-target: Add branch and jump instructions
cd8821b riscv: tcg-target: Add the out load and store instructions
58bb3e0 riscv: tcg-target: Add the extract instructions
a9dc143 riscv: tcg-target: Add the mov and movi instruction
4cf20d8 riscv: tcg-target: Add the relocation functions
78c1eb9 riscv: tcg-target: Add the instruction emitters
e277371 riscv: tcg-target: Add the immediate encoders
dcdb8bc riscv: tcg-target: Add support for the constraints
6a691a5 riscv: tcg-target: Regiser the JIT
b2165c4 riscv: Add the tcg target registers
243a714 riscv: Add the tcg-target header file
c2feca77 exec: Add RISC-V GCC poison macro
19ca815 linux-user: Add host dependency for RISC-V 64-bit
e84813f linux-user: Add host dependency for RISC-V 32-bit
a62d116 elf.h: Add the RISCV ELF magic numbers

=== OUTPUT BEGIN ===
Checking PATCH 1/23: elf.h: Add the RISCV ELF magic numbers...
Checking PATCH 2/23: linux-user: Add host dependency for RISC-V 32-bit...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

total: 0 errors, 1 warnings, 11 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 3/23: linux-user: Add host dependency for RISC-V 64-bit...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

total: 0 errors, 1 warnings, 11 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 4/23: exec: Add RISC-V GCC poison macro...
Checking PATCH 5/23: riscv: Add the tcg-target header file...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

WARNING: architecture specific defines should be avoided
#43: FILE: tcg/riscv/tcg-target.h:28:
+#if __riscv_xlen == 32

total: 0 errors, 2 warnings, 173 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 6/23: riscv: Add the tcg target registers...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

total: 0 errors, 1 warnings, 120 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 7/23: riscv: tcg-target: Regiser the JIT...
Checking PATCH 8/23: riscv: tcg-target: Add support for the constraints...
Checking PATCH 9/23: riscv: tcg-target: Add the immediate encoders...
Checking PATCH 10/23: riscv: tcg-target: Add the instruction emitters...
Checking PATCH 11/23: riscv: tcg-target: Add the relocation functions...
Checking PATCH 12/23: riscv: tcg-target: Add the mov and movi instruction...
Checking PATCH 13/23: riscv: tcg-target: Add the extract instructions...
Checking PATCH 14/23: riscv: tcg-target: Add the out load and store instructions...
Checking PATCH 15/23: riscv: tcg-target: Add branch and jump instructions...
Checking PATCH 16/23: riscv: tcg-target: Add slowpath load and store instructions...
Checking PATCH 17/23: riscv: tcg-target: Add direct load and store instructions...
ERROR: spaces required around that '*' (ctx:WxV)
#68: FILE: tcg/riscv/tcg-target.inc.c:1011:
+    tcg_insn_unit *label_ptr[1];
                   ^

ERROR: spaces required around that '*' (ctx:WxV)
#133: FILE: tcg/riscv/tcg-target.inc.c:1076:
+    tcg_insn_unit *label_ptr[1];
                   ^

total: 2 errors, 0 warnings, 151 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 18/23: riscv: tcg-target: Add the out op decoder...
Checking PATCH 19/23: riscv: tcg-target: Add the prologue generation...
Checking PATCH 20/23: riscv: tcg-target: Add the target init code...
Checking PATCH 21/23: tcg: Add RISC-V cpu signal handler...
Checking PATCH 22/23: dias: Add RISC-V support...
Checking PATCH 23/23: configure: Add support for building RISC-V host...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com