Skip to content

RISC-V: Start to remove xlen preprocess

Alistair Francis qemu-devel qemu-riscv 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest16 patches 9 repliesIn review
  2. v315 patches 8 repliesSuperseded
  3. v215 patches 13 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v116 patches21 repliesSuperseded

Changes in v4 from the cover letter

- Add a commit that converts the machine 32-bit check to use the CPU

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16hw/riscv: Expand the is 32-bit check to support more CPUshw/riscv/boot.c+11 -10 replies
2/16target/riscv: Add a TYPE_RISCV_CPU_BASE CPUtarget/riscv/cpu.h+6 -00 replies
3/16riscv: spike: Remove target macro conditionalshw/riscv/spike.c include/hw/riscv/spike.h+1 -70 replies
4/16riscv: virt: Remove target macro conditionalshw/riscv/virt.c include/hw/riscv/virt.h+1 -70 replies
5/16hw/riscv: boot: Remove compile time XLEN checkshw/riscv/boot.c hw/riscv/sifive_u.c hw/riscv/spike.c +2 more+39 -310 replies
6/16hw/riscv: virt: Remove compile time XLEN checkshw/riscv/virt.c+17 -150 replies
7/16hw/riscv: spike: Remove compile time XLEN checkshw/riscv/spike.c+24 -210 replies
8/16hw/riscv: sifive_u: Remove compile time XLEN checkshw/riscv/sifive_u.c+30 -251 reply
9/16target/riscv: fpu_helper: Match function defs in HELPER macrostarget/riscv/fpu_helper.c target/riscv/helper.h+8 -240 replies
10/16target/riscv: Add a riscv_cpu_is_32bit() helper functiontarget/riscv/cpu.c target/riscv/cpu.h+11 -00 replies
11/16target/riscv: Specify the XLEN for CPUstarget/riscv/cpu.c+23 -100 replies
12/16target/riscv: cpu: Remove compile time XLEN checkstarget/riscv/cpu.c+10 -91 reply
13/16target/riscv: cpu_helper: Remove compile time XLEN checkstarget/riscv/cpu_helper.c+7 -51 reply
14/16target/riscv: csr: Remove compile time XLEN checkstarget/riscv/cpu_bits.h target/riscv/csr.c+92 -881 reply
15/16target/riscv: cpu: Set XLEN independently from targettarget/riscv/cpu.c+16 -90 replies
16/16hw/riscv: Use the CPU to determine if 32-bithw/riscv/boot.c hw/riscv/sifive_u.c hw/riscv/spike.c +2 more+29 -375 replies

Reviews trailers per patch

15 of 16 patches have a Reviewed-by or Acked-by.

PatchBin MengPalmer DabbeltRichard Henderson
1/16R-b A-b
2/16R-b T-b R-b A-b
3/16R-b R-b A-b
4/16R-b T-b R-b A-b
5/16R-b T-b R-b A-b
6/16R-b T-b R-b A-b
7/16R-b R-b A-b
8/16R-b T-b R-b A-b
9/16
10/16R-b T-b R-b A-b
11/16R-b T-b R-b A-b R-b
12/16R-b T-b R-b A-b R-b
13/16R-b T-b R-b A-b R-b
14/16R-b T-b R-b A-b
15/16R-b T-b R-b A-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/16] RISC-V: Start to remove xlen preprocess

The RISC-V QEMU port currently has lot of preprocessor directives that check if we are targetting a 32-bit or 64-bit CPU. This means that the 64-bit RISC-V target can not run 32-bit CPUs. This is different to most other QEMU architectures and doesn't allow us to mix xlens (such as when running Hypervisors with different xlen guests).

This series is a step toward removing some of those to allow us to use 32-bit CPUs on 64-bit RISC-V targets.

v4:
- Add a commit that converts the machine 32-bit check to use the CPU
v3:
- Address Richard's comments
v2:
- Rebase on the latest RISC-V tree

Alistair Francis (16):
hw/riscv: Expand the is 32-bit check to support more CPUs target/riscv: Add a TYPE_RISCV_CPU_BASE CPU
riscv: spike: Remove target macro conditionals
riscv: virt: Remove target macro conditionals hw/riscv: boot: Remove compile time XLEN checks hw/riscv: virt: Remove compile time XLEN checks hw/riscv: spike: Remove compile time XLEN checks hw/riscv: sifive_u: Remove compile time XLEN checks target/riscv: fpu_helper: Match function defs in HELPER macros target/riscv: Add a riscv_cpu_is_32bit() helper function target/riscv: Specify the XLEN for CPUs target/riscv: cpu: Remove compile time XLEN checks target/riscv: cpu_helper: Remove compile time XLEN checks target/riscv: csr: Remove compile time XLEN checks target/riscv: cpu: Set XLEN independently from target hw/riscv: Use the CPU to determine if 32-bit

 include/hw/riscv/boot.h   |  14 +--
 include/hw/riscv/spike.h  |   6 --
 include/hw/riscv/virt.h   |   6 --
 target/riscv/cpu.h        |   8 ++
 target/riscv/cpu_bits.h   |   4 +-
 target/riscv/helper.h     |  24 ++----
 hw/riscv/boot.c           |  70 ++++++++-------
 hw/riscv/sifive_u.c       |  59 +++++++------
 hw/riscv/spike.c          |  52 +++++------
 hw/riscv/virt.c           |  39 +++++----
 target/riscv/cpu.c        |  84 ++++++++++++------
 target/riscv/cpu_helper.c |  12 +--
 target/riscv/csr.c        | 176 ++++++++++++++++++++------------------
 target/riscv/fpu_helper.c |   8 --
 14 files changed, 299 insertions(+), 263 deletions(-)
Signature · 1 line
2.29.2