[Qemu-devel] [PULL 02/47] riscv: sivive_u: Add dummy serial clock and aliases entry for uart

2019-09-11 Thread Palmer Dabbelt
with error -2 when trying to boot Linux. Signed-off-by: Guenter Roeck Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index

[Qemu-devel] [PULL 07/47] target/riscv: Create function to test if FP is enabled

2019-09-11 Thread Palmer Dabbelt
oint operations. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christophe de Dinechin Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.h| 6 +- target/riscv/cpu_helper.c | 10 ++ target/riscv/csr.c| 20 +++- 3 fi

[Qemu-devel] [PULL 05/47] target/riscv/pmp: Convert qemu_log_mask(LOG_TRACE) to trace events

2019-09-11 Thread Palmer Dabbelt
cis Signed-off-by: Palmer Dabbelt --- target/riscv/pmp.c| 31 ++- target/riscv/trace-events | 6 ++ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index d836288cb4..d4f1007109 100644 --- a/target/ri

[Qemu-devel] [PULL 01/47] riscv: sifive_u: Add support for loading initrd

2019-09-11 Thread Palmer Dabbelt
From: Guenter Roeck Add support for loading initrd with "-initrd " to the sifive_u machine. This lets us boot into Linux without disk drive. Signed-off-by: Guenter Roeck Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 20 +-

[Qemu-devel] [PULL 04/47] target/riscv/pmp: Restrict priviledged PMP to system-mode emulation

2019-09-11 Thread Palmer Dabbelt
From: Philippe Mathieu-Daudé The RISC-V Physical Memory Protection is restricted to privileged modes. Restrict its compilation to QEMU system builds. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- target/riscv/Makefile.objs | 3

[Qemu-devel] [PULL 10/47] riscv: Add a helper routine for finding firmware

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This adds a helper routine for finding firmware. It is currently used only for "-bios default" case. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/boot.c | 22 +++--- include/hw/riscv/boot.h

[Qemu-devel] [PULL 09/47] riscv: rv32: Root page table address can be larger than 32-bit

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng For RV32, the root page table's PPN has 22 bits hence its address bits could be larger than the maximum bits that target_ulong is able to represent. Use hwaddr instead. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- target/

[Qemu-devel] [PULL 08/47] target/riscv: Update the Hypervisor CSRs to v0.4

2019-09-11 Thread Palmer Dabbelt
From: Alistair Francis Update the Hypervisor CSR addresses to match the v0.4 spec. Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- target/riscv/cpu_bits.h | 35 ++- 1 file changed, 18 insertions(+), 17 deletions

[Qemu-devel] [PULL 06/47] riscv: plic: Remove unused interrupt functions

2019-09-11 Thread Palmer Dabbelt
From: Alistair Francis Signed-off-by: Alistair Francis Reviewed-by: Jonathan Behrens Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Chih-Min Chao Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_plic.c | 12 include/hw/riscv/sifive_plic.h | 3 --- 2 files changed

[Qemu-devel] [PULL 17/47] riscv: hw: Remove not needed PLIC properties in device tree

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This removes "reg-names" and "riscv,max-priority" properties of the PLIC node from device tree. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 2 -- hw/riscv/

[Qemu-devel] [PULL 13/47] riscv: sifive_test: Add reset functionality

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This adds a reset opcode for sifive_test device to trigger a system reset for testing purpose. Signed-off-by: Bin Meng Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_test.c | 4 include/hw/riscv/sifive_test.h | 3 ++- 2 files

[Qemu-devel] [PULL 12/47] riscv: hmp: Add a command to show virtual memory mappings

2019-09-11 Thread Palmer Dabbelt
ng details. Signed-off-by: Bin Meng Acked-by: Dr. David Alan Gilbert Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- hmp-commands-info.hx | 2 +- target/riscv/Makefile.objs | 4 + target/riscv/monitor.c | 229 + 3 files changed, 234

[Qemu-devel] [PULL 11/47] riscv: Resolve full path of the given bios image

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng At present when "-bios image" is supplied, we just use the straight path without searching for the configured data directories. Like "-bios default", we add the same logic so that "-L" actually works. Signed-off-by: Bin Meng Reviewed-by: Alistair

[Qemu-devel] [PULL 20/47] riscv: hw: Remove the unnecessary include of target/riscv/cpu.h

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng The inclusion of "target/riscv/cpu.h" is unnecessary in various sifive model drivers. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_prci.c | 1 - hw/riscv/sifive_test.c | 1 - hw/riscv/sifive_uart.c | 1

[Qemu-devel] [PULL 15/47] riscv: hw: Remove superfluous "linux, phandle" property

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng "linux,phandle" property is optional. Remove all instances in the sifive_u, virt and spike machine device trees. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 4 hw/riscv/spike.c| 1 - hw/ri

[Qemu-devel] [PULL 19/47] riscv: hw: Change to use qemu_log_mask(LOG_GUEST_ERROR, ...) instead

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Replace the call to hw_error() with qemu_log_mask(LOG_GUEST_ERROR,...) in various sifive models. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_prci.c | 8 +--- hw/riscv/sifive_test.c | 5 +++-- hw/riscv

[Qemu-devel] [PULL 14/47] riscv: hw: Remove duplicated "hw/hw.h" inclusion

2019-09-11 Thread Palmer Dabbelt
lted in duplicated inclusion of "hw/hw.h". Fixes: a27bd6c779ba ("Include hw/qdev-properties.h less") Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_prci.c | 1 - hw/riscv/sifive_test.c | 1 - 2 files changed, 2

[Qemu-devel] [PULL 16/47] riscv: hw: Use qemu_fdt_setprop_cell() for property with only 1 cell

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Some of the properties only have 1 cell so we should use qemu_fdt_setprop_cell() instead of qemu_fdt_setprop_cells(). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 18 +- hw/riscv/virt.c | 24

[Qemu-devel] [PULL 21/47] riscv: roms: Remove executable attribute of opensbi images

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Like other binary files, the executable attribute of opensbi images should not be set. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin

[Qemu-devel] [PULL 29/47] riscv: hart: Add a "hartid-base" property to RISC-V hart array

2019-09-11 Thread Palmer Dabbelt
ed based on the property value. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/riscv_hart.c | 3 ++- include/hw/riscv/riscv_hart.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/ris

[Qemu-devel] [PULL 26/47] riscv: sifive_e: Drop sifive_mmio_emulate()

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Use create_unimplemented_device() instead. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/Kconfig| 1 + hw/riscv/sifive_e.c | 23 --- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/hw

[Qemu-devel] [PULL 22/47] riscv: sifive_u: Remove the unnecessary include of prci header

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng sifive_u machine does not use PRCI as of today. Remove the prci header inclusion. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv

[Qemu-devel] [PULL 18/47] riscv: hw: Change create_fdt() to return void

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng There is no need to return fdt at the end of create_fdt() because it's already saved in s->fdt. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_

[Qemu-devel] [PULL 30/47] riscv: sifive_u: Set the minimum number of cpus to 2

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng It is not useful if we only have one management CPU. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 4 +++- include/hw/riscv/sifive_u.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PULL 27/47] riscv: Add a sifive_cpu.h to include both E and U cpu type defines

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Group SiFive E and U cpu type defines into one header file. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Palmer Dabbelt --- include/hw/riscv/sifive_cpu.h | 31 +++ include/hw/riscv

[Qemu-devel] [PULL 23/47] riscv: sifive: Rename sifive_prci.{c, h} to sifive_e_prci.{c, h}

2019-09-11 Thread Palmer Dabbelt
ions. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/Makefile.objs | 2 +- hw/riscv/sifive_e.c | 4 +- hw/riscv/{sifive_prci.c => sifive_e_prci.c} | 79 ++--

[Qemu-devel] [PULL 24/47] riscv: sifive_e: prci: Fix a typo of hfxosccfg register programming

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng For hfxosccfg register programming, SIFIVE_E_PRCI_HFXOSCCFG_RDY and SIFIVE_E_PRCI_HFXOSCCFG_EN should be used. Signed-off-by: Bin Meng Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Palmer Dabbelt --- hw/riscv

[Qemu-devel] [PULL 36/47] riscv: sifive_u: Reference PRCI clocks in UART and ethernet nodes

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Now that we have added a PRCI node, update existing UART and ethernet nodes to reference PRCI as their clock sources, to keep in sync with the Linux kernel device tree. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c

[Qemu-devel] [PULL 32/47] riscv: sifive_u: Update PLIC hart topology configuration string

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng With heterogeneous harts config, the PLIC hart topology configuration string are "M,MS,.." because of the monitor hart #0. Suggested-by: Fabien Chouteau Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 7

[Qemu-devel] [PULL 25/47] riscv: sifive_e: prci: Update the PRCI register block size

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Currently the PRCI register block size is set to 0x8000, but in fact 0x1000 is enough, which is also what the manual says. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_e_prci.c | 2

[Qemu-devel] [PULL 28/47] riscv: hart: Extract hart realize to a separate routine

2019-09-11 Thread Palmer Dabbelt
the file header says the RISC-V hart array holds the state of a heterogeneous array of RISC-V harts, which is not true. Update the comment to mention homogeneous array of RISC-V harts. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/riscv_hart.c

[Qemu-devel] [PULL 43/47] riscv: sifive_u: Remove handcrafted clock nodes for UART and ethernet

2019-09-11 Thread Palmer Dabbelt
hem any more. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 24 +--- include/hw/riscv/sifive_u.h | 3 +-- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/hw/riscv/sifive_u.c b/

[Qemu-devel] [PULL 40/47] riscv: sifive: Implement a model for SiFive FU540 OTP

2019-09-11 Thread Palmer Dabbelt
Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/Makefile.objs | 1 + hw/riscv/sifive_u_otp.c | 191 include/hw/riscv/sifive_u_otp.h | 80 + 3 files changed, 272 insertions(+) create mode 100644 hw/riscv/sifive_u_otp.c create mode

[Qemu-devel] [PULL 31/47] riscv: sifive_u: Update hart configuration to reflect the real FU540 SoC

2019-09-11 Thread Palmer Dabbelt
heterogeneous harts. The cpu nodes in the generated DTS have been updated as well. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 92 +++-- include/hw/riscv/sifive_u.h | 6 ++- 2 files changed

[Qemu-devel] [PULL 35/47] riscv: sifive_u: Add PRCI block to the SoC

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng Add PRCI mmio base address and size mappings to sifive_u machine, and generate the corresponding device tree node. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 24 +++- include/hw

[Qemu-devel] [PULL 44/47] riscv: sifive_u: Update model and compatible strings in device tree

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This updates model and compatible strings to use the same strings as used in the Linux kernel device tree (hifive-unleashed-a00.dts). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 5 +++-- 1 file changed, 3

[Qemu-devel] [PULL 39/47] riscv: roms: Update default bios for sifive_u machine

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng With the support of heterogeneous harts and PRCI model, it's now possible to use the OpenSBI image (PLATFORM=sifive/fu540) built for the real hardware. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- pc-bios/opensbi-riscv64-sif

[Qemu-devel] [PULL 37/47] riscv: sifive_u: Update UART base addresses and IRQs

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This updates the UART base address and IRQs to match the hardware. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 4 ++-- include/hw/riscv/sifive_u.h

[Qemu-devel] [PULL 34/47] riscv: sifive_u: Generate hfclk and rtcclk nodes

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng To keep in sync with Linux kernel device tree, generate hfclk and rtcclk nodes in the device tree, to be referenced by PRCI node. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 23

[Qemu-devel] [PULL 46/47] target/riscv: Fix mstatus dirty mask

2019-09-11 Thread Palmer Dabbelt
From: Alistair Francis This is meant to mask off the hypervisor bits, but a typo caused it to mask MPP instead. Fixes: 1f0419cb04 ("target/riscv: Allow setting mstatus virtulisation bits") Signed-off-by: Alistair Francis Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt --- ta

[Qemu-devel] [PULL 33/47] riscv: sifive: Implement PRCI model for FU540

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This adds a simple PRCI model for FU540 (sifive_u). It has different register layout from the existing PRCI model for FE310 (sifive_e). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/Makefile.objs | 1 + hw/riscv

[Qemu-devel] [PULL 38/47] riscv: sifive_u: Change UART node name in device tree

2019-09-11 Thread Palmer Dabbelt
e name as "/soc/uart@...", causing U-Boot fail to find the serial node in DT. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.

[Qemu-devel] [PULL 47/47] target/riscv: Use TB_FLAGS_MSTATUS_FS for floating point

2019-09-11 Thread Palmer Dabbelt
From: Alistair Francis Use the TB_FLAGS_MSTATUS_FS macro when enabling floating point in the tb flags. Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target

[Qemu-devel] [PULL 42/47] riscv: sifive_u: Fix broken GEM support

2019-09-11 Thread Palmer Dabbelt
reg base & size to the property encoding. Tested with upstream U-Boot and Linux kernel MACB drivers. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/Kconfig| 1 + hw/riscv/sifive_u.c | 24 includ

[Qemu-devel] [PULL 41/47] riscv: sifive_u: Instantiate OTP memory with a serial number

2019-09-11 Thread Palmer Dabbelt
From: Bin Meng This adds an OTP memory with a given serial number to the sifive_u machine. With such support, the upstream U-Boot for sifive_fu540 boots out of the box on the sifive_u machine. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv

[Qemu-devel] [PULL 45/47] target/riscv: Use both register name and ABI name

2019-09-11 Thread Palmer Dabbelt
From: Atish Patra Use both the generic register name and ABI name for the general purpose registers and floating point registers. Signed-off-by: Atish Patra Signed-off-by: Alistair Francis Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.c | 19

Re: [Qemu-devel] [PATCH v1 11/28] target/riscv: Add background register swapping function

2019-09-11 Thread Palmer Dabbelt
On Fri, 23 Aug 2019 16:38:18 PDT (-0700), Alistair Francis wrote: Signed-off-by: Alistair Francis --- target/riscv/cpu.h| 24 --- target/riscv/cpu_bits.h | 7 target/riscv/cpu_helper.c | 88 +++ 3 files changed, 113 insertions(+), 6 de

[Qemu-devel] [PULL 02/34] target/riscv: Convert RVXI branch insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Palmer Dabbelt Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 19 ++ target/riscv/insn_trans

[Qemu-devel] [PULL 03/34] target/riscv: Convert RV32I load/store insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 10 ++ target/riscv/insn_trans/trans_rvi.inc.c | 48

[Qemu-devel] [PULL 05/34] target/riscv: Convert RVXI arithmetic insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann we cannot remove the call to gen_arith() in decode_RV32_64G() since it is used to translate multiply instructions. Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt

[Qemu-devel] [PULL] target/riscv: Convert to decodetree

2019-03-01 Thread Palmer Dabbelt
staging (2019-03-01 11:20:49 +) are available in the Git repository at: git://github.com/palmer-dabbelt/qemu.git tags/riscv-for-master-4.0-sf2 for you to fetch changes up to 0bcba29464ea9969fc69cd729e4c8bddfb2e18e3: target/riscv: Remaining rvc insn reuse 32 bit translators (2019-0

[Qemu-devel] [PULL 06/34] target/riscv: Convert RVXI fence insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 2 ++ target/riscv/insn_trans/trans_rvi.inc.c | 19

[Qemu-devel] [PULL 09/34] target/riscv: Convert RV32A insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 17 +++ target/riscv/insn_trans/trans_rva.inc.c | 160

[Qemu-devel] [PULL 07/34] target/riscv: Convert RVXI csr insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 8 +++ target/riscv/insn_trans/trans_rvi.inc.c | 79

[Qemu-devel] [PULL 01/34] target/riscv: Activate decodetree and implemnt LUI & AUIPC

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann for now only LUI & AUIPC are decoded and translated. If decodetree fails, we fall back to the old decoder. Reviewed-by: Richard Henderson Acked-by: Alistair Francis Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dab

[Qemu-devel] [PULL 04/34] target/riscv: Convert RV64I load/store insns to decodetree

2019-03-01 Thread Palmer Dabbelt
: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/Makefile.objs | 8 +--- target/riscv/insn32-64.decode | 25 + target/riscv/insn_trans/trans_rvi.inc.c | 20 target/riscv/translate.c| 7 --- 4

[Qemu-devel] [PULL 17/34] target/riscv: Convert quadrant 1 of RVXC insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn16.decode | 43 +++ target/riscv/insn_trans/trans_rvc.inc.c | 151 target/riscv

[Qemu-devel] [PULL 10/34] target/riscv: Convert RV64A insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32-64.decode | 13 +++ target/riscv/insn_trans/trans_rva.inc.c | 58

[Qemu-devel] [PULL 08/34] target/riscv: Convert RVXM insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32-64.decode | 7 ++ target/riscv/insn32.decode | 10 +++ target/riscv

[Qemu-devel] [PULL 16/34] target/riscv: Convert quadrant 0 of RVXC insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/Makefile.objs | 9 ++- target/riscv/insn16.decode | 55 ++ target/riscv/insn_trans

[Qemu-devel] [PULL 20/34] target/riscv: Remove manual decoding from gen_branch()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann We now utilizes argument-sets of decodetree such that no manual decoding is necessary. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.inc.c | 46

[Qemu-devel] [PULL 23/34] target/riscv: Move gen_arith_imm() decoding into trans_* functions

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann gen_arith_imm() does a lot of decoding manually, which was hard to read in case of the shift instructions and is not necessary anymore with decodetree. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer

[Qemu-devel] [PULL 11/34] target/riscv: Convert RV32F insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 35 +++ target/riscv/insn_trans/trans_rvf.inc.c | 379

[Qemu-devel] [PULL 12/34] target/riscv: Convert RV64F insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32-64.decode | 6 +++ target/riscv/insn_trans/trans_rvf.inc.c | 60

[Qemu-devel] [PULL 24/34] target/riscv: make ADD/SUB/OR/XOR/AND insn use arg lists

2019-03-01 Thread Palmer Dabbelt
Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 3 +- target/riscv/insn_trans/trans_rvi.inc.c | 21 + target/riscv/translate.c| 40 +++-- 3 files changed, 34

[Qemu-devel] [PULL 14/34] target/riscv: Convert RV64D insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32-64.decode | 8 + target/riscv/insn_trans/trans_rvd.inc.c | 82 target/riscv

[Qemu-devel] [PULL 15/34] target/riscv: Convert RV priv insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode| 15 +++ .../riscv/insn_trans/trans_privileged.inc.c | 110

[Qemu-devel] [PULL 22/34] target/riscv: Remove manual decoding from gen_store()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann With decodetree we don't need to convert RISC-V opcodes into to MemOps as the old gen_store() did. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.

[Qemu-devel] [PULL 27/34] target/riscv: Rename trans_arith to gen_arith

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.inc.c | 18 +- target/riscv/insn_trans/trans_rvm.inc.c | 14 +++--- target/riscv/translate.c

[Qemu-devel] [PULL 28/34] target/riscv: Remove gen_system()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann with all 16 bit insns moved to decodetree no path is falling back to gen_system(), so we can remove it. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/translate.c | 34

[Qemu-devel] [PULL 19/34] target/riscv: Remove gen_jalr()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann trans_jalr() is the only caller, so move the code into trans_jalr(). Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.inc.c

[Qemu-devel] [PULL 30/34] target/riscv: Convert @cs_2 insns to share translation functions

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann These all expand simply to R format instructions. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/Makefile.objs | 10 +++--- target/riscv/insn16-64.decode | 24

[Qemu-devel] [PULL 32/34] target/riscv: Splice fsw_sd and flw_ld for riscv32 vs riscv64

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann this finally removes the old decoder functions that we carried along with it. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/Makefile.objs | 1 + target/riscv/insn16-32.decode

[Qemu-devel] [PULL 33/34] target/riscv: Splice remaining compressed insn pairs for riscv32 vs riscv64

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann it splices flwsp_ldsp, fswsp_sdsp, and jal_addiw and makes each of them reuse the code generator used for the non compressed insns. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/insn16-32.decode

[Qemu-devel] [PULL 31/34] target/riscv: Convert @cl_d, @cl_w, @cs_d, @cs_w insns

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/insn16.decode | 20 ++-- target/riscv/insn32.decode | 3 ++- target/riscv/insn_trans/trans_rvc.inc.c | 24

[Qemu-devel] [PULL 29/34] target/riscv: Remove decode_RV32_64G()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann decodetree handles all instructions now so the fallback is not necessary anymore. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/translate.c | 21 + 1

[Qemu-devel] [PULL 25/34] target/riscv: Remove shift and slt insn manual decoding

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.inc.c | 93 + target/riscv/translate.c| 59 +--- 2

[Qemu-devel] [PULL 21/34] target/riscv: Remove manual decoding from gen_load()

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann With decodetree we don't need to convert RISC-V opcodes into to MemOps as the old gen_load() did. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvi.

[Qemu-devel] [PULL 18/34] target/riscv: Convert quadrant 2 of RVXC insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn16.decode | 31 target/riscv/insn_trans/trans_rvc.inc.c | 101 target/riscv

[Qemu-devel] [PULL 13/34] target/riscv: Convert RV32D insns to decodetree

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Acked-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn32.decode | 28 ++ target/riscv/insn_trans/trans_rvd.inc.c | 360

[Qemu-devel] [PULL 26/34] target/riscv: Remove manual decoding of RV32/64M insn

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt Signed-off-by: Palmer Dabbelt --- target/riscv/insn_trans/trans_rvm.inc.c | 55 ++-- target/riscv/translate.c| 320 ++-- 2 files changed

[Qemu-devel] [PULL 34/34] target/riscv: Remaining rvc insn reuse 32 bit translators

2019-03-01 Thread Palmer Dabbelt
From: Bastian Koppelmann only one translate functions of rvc needs to handle special cases. For the other rvc insns we can remove the extra layer of indirection. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Palmer Dabbelt --- target/riscv/insn16.decode

Re: [Qemu-devel] [PULL] target/riscv: Convert to decodetree

2019-03-04 Thread Palmer Dabbelt
On Mon, 04 Mar 2019 11:30:21 PST (-0800), richard.hender...@linaro.org wrote: On 3/4/19 4:52 AM, Bastian Koppelmann wrote: This looks like an unforeseen decodetree problem (CC' Richard). As these 16/32 instructions share the same trans_* function, we emit the same typedef once for 16 bit and onc

Re: [Qemu-devel] [PATCH 5/5 v3] RISC-V: Add hooks to use the gdb xml files.

2019-02-11 Thread Palmer Dabbelt
On Fri, 08 Feb 2019 11:28:48 PST (-0800), alistai...@gmail.com wrote: On Fri, Feb 8, 2019 at 11:09 AM Jim Wilson wrote: On Fri, Feb 8, 2019 at 10:17 AM Alistair Francis wrote: > Can we just write a wrapper function then that sets and unsets the variable? > Something like this: > > riscv_csrrw

Re: [Qemu-devel] [PATCH v6 00/35] target/riscv: Convert to decodetree

2019-02-12 Thread Palmer Dabbelt
On Wed, 23 Jan 2019 01:25:03 PST (-0800), Bastian Koppelmann wrote: Hi, this patchset converts the RISC-V decoder to decodetree in four major steps: 1) Convert 32-bit instructions to decodetree [Patch 1-16]: Many of the gen_* functions are called by the decode functions for 16-bit and 3

Re: [Qemu-devel] [PATCH v6 00/35] target/riscv: Convert to decodetree

2019-02-12 Thread Palmer Dabbelt
On Tue, Feb 12, 2019 at 3:21 PM Palmer Dabbelt wrote: > On Wed, 23 Jan 2019 01:25:03 PST (-0800), Bastian Koppelmann wrote: > > Hi, > > > > this patchset converts the RISC-V decoder to decodetree in four major > steps: > > > > 1) Convert 32-bit in

Re: [Qemu-devel] [PATCH v6 00/35] target/riscv: Convert to decodetree

2019-02-13 Thread Palmer Dabbelt
On Wed, 13 Feb 2019 01:06:41 PST (-0800), Bastian Koppelmann wrote: On 2/13/19 3:15 AM, Palmer Dabbelt wrote: On Tue, Feb 12, 2019 at 3:21 PM Palmer Dabbelt wrote: [snip] Do you, by any chance, have a v7? It looks like there's quite a few merge conflicts here, and while I'm OK f

[Qemu-devel] [PULL 01/11] RISC-V: Split out mstatus_fs from tb_flags

2019-02-13 Thread Palmer Dabbelt
From: Richard Henderson Signed-off-by: Michael Clark Reviewed-by: Michael Clark Signed-off-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.h | 6 +++--- target/riscv/translate.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a

[Qemu-devel] [PULL 06/11] RISC-V: Add misa to DisasContext

2019-02-13 Thread Palmer Dabbelt
From: Michael Clark gen methods should access state from DisasContext. Add misa field to the DisasContext struct and remove CPURISCVState argument from all gen methods. Signed-off-by: Michael Clark Reviewed-by: Richard Henderson Signed-off-by: Alistair Francis Signed-off-by: Palmer Dabbelt

[Qemu-devel] [PULL] RISC-V Patches for the 4.0 Soft Freeze, Part 1

2019-02-13 Thread Palmer Dabbelt
02-11 17:04:57 +) are available in the Git repository at: git://github.com/palmer-dabbelt/qemu.git tags/riscv-for-master-4.0-sf1 for you to fetch changes up to 40e46e516d90c2dfe8e8de3741c1c65f1b526502: riscv: Ensure the kernel start address is correctly cast (2019-0

[Qemu-devel] [PULL 05/11] RISC-V: Add priv_ver to DisasContext

2019-02-13 Thread Palmer Dabbelt
From: Alistair Francis The gen methods should access state from DisasContext. Add priv_ver field to the DisasContext struct. Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Palmer Dabbelt --- target/riscv/translate.c | 7 +-- 1 file changed, 5 insertions

[Qemu-devel] [PULL 10/11] target/riscv: fix counter-enable checks in ctr()

2019-02-13 Thread Palmer Dabbelt
From: Xi Wang Access to a counter in U-mode is permitted only if the corresponding bit is set in both mcounteren and scounteren. The current code ignores mcounteren and checks scounteren only for U-mode access. Signed-off-by: Xi Wang Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt

[Qemu-devel] [PULL 03/11] RISC-V: Implement mstatus.TSR/TW/TVM

2019-02-13 Thread Palmer Dabbelt
From: Michael Clark This adds the necessary minimum to support S-mode virtualization for priv ISA >= v1.10 Signed-off-by: Michael Clark Signed-off-by: Alistair Francis Co-authored-by: Matthew Suozzo Co-authored-by: Michael Clark Signed-off-by: Palmer Dabbelt --- target/riscv/cs

[Qemu-devel] [PULL 02/11] RISC-V: Mark mstatus.fs dirty

2019-02-13 Thread Palmer Dabbelt
tatus.FS so the bug in the first spin of this patch has been fixed in a prior commit. Signed-off-by: Michael Clark Reviewed-by: Michael Clark Signed-off-by: Alistair Francis Co-authored-by: Richard Henderson Co-authored-by: Michael Clark Signed-off-by: Palmer Dabbelt --- target/riscv/csr.c

[Qemu-devel] [PULL 04/11] RISC-V: Use riscv prefix consistently on cpu helpers

2019-02-13 Thread Palmer Dabbelt
* rename riscv_set_mode to riscv_cpu_set_mode Signed-off-by: Michael Clark Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Palmer Dabbelt --- linux-user/riscv/signal.c | 4 ++-- target/riscv/cpu.h| 21 ++--- target/riscv/cpu_helper.c | 10

[Qemu-devel] [PULL 11/11] riscv: Ensure the kernel start address is correctly cast

2019-02-13 Thread Palmer Dabbelt
. The reason is that the binary was loaded to a negative address. Signed-off-by: Alistair Francis Suggested-by: Alexander Graf Reported-by: Alexander Graf Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_e.c | 2 +- hw/riscv/sifive_u.c | 2 +- hw/riscv

[Qemu-devel] [PULL 07/11] RISC-V: Add misa.MAFD checks to translate

2019-02-13 Thread Palmer Dabbelt
Signed-off-by: Palmer Dabbelt --- target/riscv/translate.c | 158 +++ 1 file changed, 158 insertions(+) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index bb80387088e2..b7176cbf98e1 100644 --- a/target/riscv/translate.c +++ b/target/riscv

[Qemu-devel] [PULL 09/11] MAINTAINERS: Remove Michael Clark as a RISC-V Maintainer

2019-02-13 Thread Palmer Dabbelt
Michael is no longer employed by SiFive and does not want to continue maintianing the RISC-V port. Signed-off-by: Palmer Dabbelt --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a2da141a928f..e170a4c73376 100644 --- a/MAINTAINERS +++ b

[Qemu-devel] [PULL 08/11] RISC-V: Add misa runtime write support

2019-02-13 Thread Palmer Dabbelt
A conservative approach to consistency is taken by flushing the translation cache on misa writes. misa_mask is added to the CPU struct to store the original set of extensions. Signed-off-by: Michael Clark Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- t

[Qemu-devel] [PATCH v7 02/35] target/riscv: Activate decodetree and implemnt LUI & AUIPC

2019-02-13 Thread Palmer Dabbelt
From: Bastian Koppelmann for now only LUI & AUIPC are decoded and translated. If decodetree fails, we fall back to the old decoder. Reviewed-by: Richard Henderson Acked-by: Alistair Francis Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt --- target/riscv/Makefile.objs

<    2   3   4   5   6   7   8   9   10   11   >