All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL] RISC-V Patches for the 4.1 Soft Freeze, Part 2
@ 2019-06-27 15:19 ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel

merged tag 'mips-queue-jun-21-2019'
The following changes since commit 474f3938d79ab36b9231c9ad3b5a9314c2aeacde:

  Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-jun-21-2019' into staging (2019-06-21 15:40:50 +0100)

are available in the Git repository at:

  git://github.com/palmer-dabbelt/qemu.git tags/riscv-for-master-4.1-sf1

for you to fetch changes up to c08a8317e31033ec76b8460a0b75cbcdaeeef481:

  hw/riscv: Load OpenSBI as the default firmware (2019-06-27 02:47:06 -0700)

----------------------------------------------------------------
RISC-V Patches for the 4.1 Soft Freeze, Part 2

This pull request contains a handful of patches that I'd like to target
for the 4.1 soft freeze.  There are a handful of new features:

* The -bios option now works sanely, including both a built-in copy of
  OpenSBI and the ability to load external versions.  Users no longer
  need to figure out how to build their own firmware.
* Support for the 1.11.0, the latest privileged specification.
* Support for reading and writing the PRCI registers.
* Better control over the ISA of the target machine.
* Support for the cpu-topology device tree node.

Additionally, there are a handful of bug fixes including:

* Load reservations are now broken by both store conditional and by
  scheduling, which fixes issues with parallel applications.
* Various fixes to the PMP implementation.
* Fixes to the 32-bit linux-user syscall ABI.
* Various fixes for instruction decodeing.
* A fix to the PCI device tree "bus-range" property.

This boots 32-bit and 64-bit OpenEmbedded.

----------------------------------------------------------------
Alistair Francis (14):
      target/riscv: Allow setting ISA extensions via CPU props
      target/riscv: Restructure deprecatd CPUs
      target/riscv: Add the privledge spec version 1.11.0
      target/riscv: Add the mcountinhibit CSR
      target/riscv: Set privledge spec 1.11.0 as default
      qemu-deprecated.texi: Deprecate the RISC-V privledge spec 1.09.1
      target/riscv: Require either I or E base extension
      target/riscv: Remove user version information
      target/riscv: Add support for disabling/enabling Counters
      hw/riscv: Split out the boot functions
      hw/riscv: Add support for loading a firmware
      hw/riscv: Extend the kernel loading support
      roms: Add OpenSBI version 0.3
      hw/riscv: Load OpenSBI as the default firmware

Atish Patra (1):
      riscv: virt: Add cpu-topology DT node.

Bin Meng (3):
      riscv: virt: Correct pci "bus-range" encoding
      riscv: sifive_u: Do not create hard-coded phandles in DT
      riscv: sifive_u: Update the plic hart config to support multicore

Dayeol Lee (1):
      target/riscv: Fix PMP range boundary address bug

Hesham Almatary (6):
      RISC-V: Only Check PMP if MMU translation succeeds
      RISC-V: Raise access fault exceptions on PMP violations
      RISC-V: Check for the effective memory privilege mode during PMP checks
      RISC-V: Check PMP during Page Table Walks
      RISC-V: Fix a PMP bug where it succeeds even if PMP entry is off
      RISC-V: Fix a PMP check with the correct access size

Jim Wilson (1):
      RISC-V: Update syscall list for 32-bit support.

Joel Sing (1):
      RISC-V: Clear load reservations on context switch and SC

Michael Clark (2):
      target/riscv: Implement riscv_cpu_unassigned_access
      disas/riscv: Disassemble reserved compressed encodings as illegal

Nathaniel Graff (1):
      sifive_prci: Read and write PRCI registers

Palmer Dabbelt (3):
      RISC-V: Fix a memory leak when realizing a sifive_e
      RISC-V: Add support for the Zifencei extension
      RISC-V: Add support for the Zicsr extension

Wladimir J. van der Laan (1):
      disas/riscv: Fix `rdinstreth` constraint

 .gitmodules                                    |   3 +
 Makefile                                       |   5 +-
 disas/riscv.c                                  |  65 ++++++++---
 hw/riscv/Makefile.objs                         |   1 +
 hw/riscv/boot.c                                | 154 +++++++++++++++++++++++++
 hw/riscv/sifive_e.c                            |  30 ++---
 hw/riscv/sifive_prci.c                         |  49 ++++++--
 hw/riscv/sifive_u.c                            |  55 +++++----
 hw/riscv/spike.c                               |  21 +---
 hw/riscv/virt.c                                |  84 ++++++--------
 include/hw/riscv/boot.h                        |  32 +++++
 include/hw/riscv/sifive_e.h                    |   2 +
 include/hw/riscv/sifive_prci.h                 |  32 +++++
 linux-user/riscv/syscall_nr.h                  |  15 ++-
 pc-bios/opensbi-riscv32-virt-fw_jump.bin       | Bin 0 -> 28848 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin   | Bin 0 -> 28904 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin       | Bin 0 -> 28904 bytes
 qemu-deprecated.texi                           |  28 +++++
 roms/Makefile                                  |  48 ++++++--
 roms/opensbi                                   |   1 +
 target/riscv/cpu.c                             | 137 ++++++++++++++++------
 target/riscv/cpu.h                             |  33 ++++--
 target/riscv/cpu_bits.h                        |   1 +
 target/riscv/cpu_helper.c                      |  55 ++++++++-
 target/riscv/csr.c                             |  30 ++++-
 target/riscv/insn_trans/trans_privileged.inc.c |   2 +-
 target/riscv/insn_trans/trans_rva.inc.c        |   8 +-
 target/riscv/insn_trans/trans_rvi.inc.c        |   4 +
 target/riscv/pmp.c                             |  17 +--
 target/riscv/pmp.h                             |   2 +-
 target/riscv/translate.c                       |   3 +
 31 files changed, 705 insertions(+), 212 deletions(-)
 create mode 100644 hw/riscv/boot.c
 create mode 100644 include/hw/riscv/boot.h
 create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
 create mode 160000 roms/opensbi



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

* [Qemu-riscv] [PULL] RISC-V Patches for the 4.1 Soft Freeze, Part 2
@ 2019-06-27 15:19 ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel

merged tag 'mips-queue-jun-21-2019'
The following changes since commit 474f3938d79ab36b9231c9ad3b5a9314c2aeacde:

  Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-jun-21-2019' into staging (2019-06-21 15:40:50 +0100)

are available in the Git repository at:

  git://github.com/palmer-dabbelt/qemu.git tags/riscv-for-master-4.1-sf1

for you to fetch changes up to c08a8317e31033ec76b8460a0b75cbcdaeeef481:

  hw/riscv: Load OpenSBI as the default firmware (2019-06-27 02:47:06 -0700)

----------------------------------------------------------------
RISC-V Patches for the 4.1 Soft Freeze, Part 2

This pull request contains a handful of patches that I'd like to target
for the 4.1 soft freeze.  There are a handful of new features:

* The -bios option now works sanely, including both a built-in copy of
  OpenSBI and the ability to load external versions.  Users no longer
  need to figure out how to build their own firmware.
* Support for the 1.11.0, the latest privileged specification.
* Support for reading and writing the PRCI registers.
* Better control over the ISA of the target machine.
* Support for the cpu-topology device tree node.

Additionally, there are a handful of bug fixes including:

* Load reservations are now broken by both store conditional and by
  scheduling, which fixes issues with parallel applications.
* Various fixes to the PMP implementation.
* Fixes to the 32-bit linux-user syscall ABI.
* Various fixes for instruction decodeing.
* A fix to the PCI device tree "bus-range" property.

This boots 32-bit and 64-bit OpenEmbedded.

----------------------------------------------------------------
Alistair Francis (14):
      target/riscv: Allow setting ISA extensions via CPU props
      target/riscv: Restructure deprecatd CPUs
      target/riscv: Add the privledge spec version 1.11.0
      target/riscv: Add the mcountinhibit CSR
      target/riscv: Set privledge spec 1.11.0 as default
      qemu-deprecated.texi: Deprecate the RISC-V privledge spec 1.09.1
      target/riscv: Require either I or E base extension
      target/riscv: Remove user version information
      target/riscv: Add support for disabling/enabling Counters
      hw/riscv: Split out the boot functions
      hw/riscv: Add support for loading a firmware
      hw/riscv: Extend the kernel loading support
      roms: Add OpenSBI version 0.3
      hw/riscv: Load OpenSBI as the default firmware

Atish Patra (1):
      riscv: virt: Add cpu-topology DT node.

Bin Meng (3):
      riscv: virt: Correct pci "bus-range" encoding
      riscv: sifive_u: Do not create hard-coded phandles in DT
      riscv: sifive_u: Update the plic hart config to support multicore

Dayeol Lee (1):
      target/riscv: Fix PMP range boundary address bug

Hesham Almatary (6):
      RISC-V: Only Check PMP if MMU translation succeeds
      RISC-V: Raise access fault exceptions on PMP violations
      RISC-V: Check for the effective memory privilege mode during PMP checks
      RISC-V: Check PMP during Page Table Walks
      RISC-V: Fix a PMP bug where it succeeds even if PMP entry is off
      RISC-V: Fix a PMP check with the correct access size

Jim Wilson (1):
      RISC-V: Update syscall list for 32-bit support.

Joel Sing (1):
      RISC-V: Clear load reservations on context switch and SC

Michael Clark (2):
      target/riscv: Implement riscv_cpu_unassigned_access
      disas/riscv: Disassemble reserved compressed encodings as illegal

Nathaniel Graff (1):
      sifive_prci: Read and write PRCI registers

Palmer Dabbelt (3):
      RISC-V: Fix a memory leak when realizing a sifive_e
      RISC-V: Add support for the Zifencei extension
      RISC-V: Add support for the Zicsr extension

Wladimir J. van der Laan (1):
      disas/riscv: Fix `rdinstreth` constraint

 .gitmodules                                    |   3 +
 Makefile                                       |   5 +-
 disas/riscv.c                                  |  65 ++++++++---
 hw/riscv/Makefile.objs                         |   1 +
 hw/riscv/boot.c                                | 154 +++++++++++++++++++++++++
 hw/riscv/sifive_e.c                            |  30 ++---
 hw/riscv/sifive_prci.c                         |  49 ++++++--
 hw/riscv/sifive_u.c                            |  55 +++++----
 hw/riscv/spike.c                               |  21 +---
 hw/riscv/virt.c                                |  84 ++++++--------
 include/hw/riscv/boot.h                        |  32 +++++
 include/hw/riscv/sifive_e.h                    |   2 +
 include/hw/riscv/sifive_prci.h                 |  32 +++++
 linux-user/riscv/syscall_nr.h                  |  15 ++-
 pc-bios/opensbi-riscv32-virt-fw_jump.bin       | Bin 0 -> 28848 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin   | Bin 0 -> 28904 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin       | Bin 0 -> 28904 bytes
 qemu-deprecated.texi                           |  28 +++++
 roms/Makefile                                  |  48 ++++++--
 roms/opensbi                                   |   1 +
 target/riscv/cpu.c                             | 137 ++++++++++++++++------
 target/riscv/cpu.h                             |  33 ++++--
 target/riscv/cpu_bits.h                        |   1 +
 target/riscv/cpu_helper.c                      |  55 ++++++++-
 target/riscv/csr.c                             |  30 ++++-
 target/riscv/insn_trans/trans_privileged.inc.c |   2 +-
 target/riscv/insn_trans/trans_rva.inc.c        |   8 +-
 target/riscv/insn_trans/trans_rvi.inc.c        |   4 +
 target/riscv/pmp.c                             |  17 +--
 target/riscv/pmp.h                             |   2 +-
 target/riscv/translate.c                       |   3 +
 31 files changed, 705 insertions(+), 212 deletions(-)
 create mode 100644 hw/riscv/boot.c
 create mode 100644 include/hw/riscv/boot.h
 create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
 create mode 160000 roms/opensbi



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

* [Qemu-devel] [PULL 01/34] target/riscv: Allow setting ISA extensions via CPU props
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <Alistair.Francis@wdc.com>

This patch allows us to enable/disable the RISC-V ISA extensions from
the QEMU command line. This works with the rv32 and rv64 machines. The
idea is that in the future we can now add extensions and leave them
disabled by default until enabled by the user.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 70 ++++++++++++++++++++++++++++++++++++++++++++--
 target/riscv/cpu.h | 11 ++++++++
 2 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 6f2b64422086..0632ac08cf35 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "qapi/error.h"
+#include "qemu/error-report.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 
@@ -119,7 +120,8 @@ static void riscv_any_cpu_init(Object *obj)
 static void riscv_base32_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
-    set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
+    /* We set this in the realise function */
+    set_misa(env, 0);
 }
 
 static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
@@ -156,7 +158,8 @@ static void rv32imacu_nommu_cpu_init(Object *obj)
 static void riscv_base64_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
-    set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
+    /* We set this in the realise function */
+    set_misa(env, 0);
 }
 
 static void rv64gcsu_priv1_09_1_cpu_init(Object *obj)
@@ -315,6 +318,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
     int priv_version = PRIV_VERSION_1_10_0;
     int user_version = USER_VERSION_2_02_0;
+    target_ulong target_misa = 0;
     Error *local_err = NULL;
 
     cpu_exec_realizefn(cs, &local_err);
@@ -358,6 +362,58 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         set_feature(env, RISCV_FEATURE_PMP);
     }
 
+    /* If misa isn't set (rv32 and rv64 machines) set it here */
+    if (!env->misa) {
+        /* Do some ISA extension error checking */
+        if (cpu->cfg.ext_i && cpu->cfg.ext_e) {
+            error_setg(errp,
+                       "I and E extensions are incompatible");
+                       return;
+       }
+
+       if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m &
+                               cpu->cfg.ext_a & cpu->cfg.ext_f &
+                               cpu->cfg.ext_d)) {
+            warn_report("Setting G will also set IMAFD");
+            cpu->cfg.ext_i = true;
+            cpu->cfg.ext_m = true;
+            cpu->cfg.ext_a = true;
+            cpu->cfg.ext_f = true;
+            cpu->cfg.ext_d = true;
+        }
+
+        /* Set the ISA extensions, checks should have happened above */
+        if (cpu->cfg.ext_i) {
+            target_misa |= RVI;
+        }
+        if (cpu->cfg.ext_e) {
+            target_misa |= RVE;
+        }
+        if (cpu->cfg.ext_m) {
+            target_misa |= RVM;
+        }
+        if (cpu->cfg.ext_a) {
+            target_misa |= RVA;
+        }
+        if (cpu->cfg.ext_f) {
+            target_misa |= RVF;
+        }
+        if (cpu->cfg.ext_d) {
+            target_misa |= RVD;
+        }
+        if (cpu->cfg.ext_c) {
+            target_misa |= RVC;
+        }
+        if (cpu->cfg.ext_s) {
+            target_misa |= RVS;
+        }
+        if (cpu->cfg.ext_u) {
+            target_misa |= RVU;
+        }
+
+        set_misa(env, RVXLEN | target_misa);
+    }
+
     riscv_cpu_register_gdb_regs_for_features(cs);
 
     qemu_init_vcpu(cs);
@@ -379,6 +435,16 @@ static const VMStateDescription vmstate_riscv_cpu = {
 };
 
 static Property riscv_cpu_properties[] = {
+    DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
+    DEFINE_PROP_BOOL("e", RISCVCPU, cfg.ext_e, false),
+    DEFINE_PROP_BOOL("g", RISCVCPU, cfg.ext_g, true),
+    DEFINE_PROP_BOOL("m", RISCVCPU, cfg.ext_m, true),
+    DEFINE_PROP_BOOL("a", RISCVCPU, cfg.ext_a, true),
+    DEFINE_PROP_BOOL("f", RISCVCPU, cfg.ext_f, true),
+    DEFINE_PROP_BOOL("d", RISCVCPU, cfg.ext_d, true),
+    DEFINE_PROP_BOOL("c", RISCVCPU, cfg.ext_c, true),
+    DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
+    DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_STRING("user_spec", RISCVCPU, cfg.user_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 6c5de37b2520..b47cde501766 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -211,6 +211,17 @@ typedef struct RISCVCPU {
 
     /* Configuration Settings */
     struct {
+        bool ext_i;
+        bool ext_e;
+        bool ext_g;
+        bool ext_m;
+        bool ext_a;
+        bool ext_f;
+        bool ext_d;
+        bool ext_c;
+        bool ext_s;
+        bool ext_u;
+
         char *priv_spec;
         char *user_spec;
         bool mmu;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 01/34] target/riscv: Allow setting ISA extensions via CPU props
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Alistair Francis,
	Palmer Dabbelt

From: Alistair Francis <Alistair.Francis@wdc.com>

This patch allows us to enable/disable the RISC-V ISA extensions from
the QEMU command line. This works with the rv32 and rv64 machines. The
idea is that in the future we can now add extensions and leave them
disabled by default until enabled by the user.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 70 ++++++++++++++++++++++++++++++++++++++++++++--
 target/riscv/cpu.h | 11 ++++++++
 2 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 6f2b64422086..0632ac08cf35 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "qapi/error.h"
+#include "qemu/error-report.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 
@@ -119,7 +120,8 @@ static void riscv_any_cpu_init(Object *obj)
 static void riscv_base32_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
-    set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
+    /* We set this in the realise function */
+    set_misa(env, 0);
 }
 
 static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
@@ -156,7 +158,8 @@ static void rv32imacu_nommu_cpu_init(Object *obj)
 static void riscv_base64_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
-    set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
+    /* We set this in the realise function */
+    set_misa(env, 0);
 }
 
 static void rv64gcsu_priv1_09_1_cpu_init(Object *obj)
@@ -315,6 +318,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
     int priv_version = PRIV_VERSION_1_10_0;
     int user_version = USER_VERSION_2_02_0;
+    target_ulong target_misa = 0;
     Error *local_err = NULL;
 
     cpu_exec_realizefn(cs, &local_err);
@@ -358,6 +362,58 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         set_feature(env, RISCV_FEATURE_PMP);
     }
 
+    /* If misa isn't set (rv32 and rv64 machines) set it here */
+    if (!env->misa) {
+        /* Do some ISA extension error checking */
+        if (cpu->cfg.ext_i && cpu->cfg.ext_e) {
+            error_setg(errp,
+                       "I and E extensions are incompatible");
+                       return;
+       }
+
+       if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m &
+                               cpu->cfg.ext_a & cpu->cfg.ext_f &
+                               cpu->cfg.ext_d)) {
+            warn_report("Setting G will also set IMAFD");
+            cpu->cfg.ext_i = true;
+            cpu->cfg.ext_m = true;
+            cpu->cfg.ext_a = true;
+            cpu->cfg.ext_f = true;
+            cpu->cfg.ext_d = true;
+        }
+
+        /* Set the ISA extensions, checks should have happened above */
+        if (cpu->cfg.ext_i) {
+            target_misa |= RVI;
+        }
+        if (cpu->cfg.ext_e) {
+            target_misa |= RVE;
+        }
+        if (cpu->cfg.ext_m) {
+            target_misa |= RVM;
+        }
+        if (cpu->cfg.ext_a) {
+            target_misa |= RVA;
+        }
+        if (cpu->cfg.ext_f) {
+            target_misa |= RVF;
+        }
+        if (cpu->cfg.ext_d) {
+            target_misa |= RVD;
+        }
+        if (cpu->cfg.ext_c) {
+            target_misa |= RVC;
+        }
+        if (cpu->cfg.ext_s) {
+            target_misa |= RVS;
+        }
+        if (cpu->cfg.ext_u) {
+            target_misa |= RVU;
+        }
+
+        set_misa(env, RVXLEN | target_misa);
+    }
+
     riscv_cpu_register_gdb_regs_for_features(cs);
 
     qemu_init_vcpu(cs);
@@ -379,6 +435,16 @@ static const VMStateDescription vmstate_riscv_cpu = {
 };
 
 static Property riscv_cpu_properties[] = {
+    DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
+    DEFINE_PROP_BOOL("e", RISCVCPU, cfg.ext_e, false),
+    DEFINE_PROP_BOOL("g", RISCVCPU, cfg.ext_g, true),
+    DEFINE_PROP_BOOL("m", RISCVCPU, cfg.ext_m, true),
+    DEFINE_PROP_BOOL("a", RISCVCPU, cfg.ext_a, true),
+    DEFINE_PROP_BOOL("f", RISCVCPU, cfg.ext_f, true),
+    DEFINE_PROP_BOOL("d", RISCVCPU, cfg.ext_d, true),
+    DEFINE_PROP_BOOL("c", RISCVCPU, cfg.ext_c, true),
+    DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
+    DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_STRING("user_spec", RISCVCPU, cfg.user_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 6c5de37b2520..b47cde501766 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -211,6 +211,17 @@ typedef struct RISCVCPU {
 
     /* Configuration Settings */
     struct {
+        bool ext_i;
+        bool ext_e;
+        bool ext_g;
+        bool ext_m;
+        bool ext_a;
+        bool ext_f;
+        bool ext_d;
+        bool ext_c;
+        bool ext_s;
+        bool ext_u;
+
         char *priv_spec;
         char *user_spec;
         bool mmu;
-- 
2.21.0



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

* [Qemu-devel] [PULL 02/34] sifive_prci: Read and write PRCI registers
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Nathaniel Graff, Michael Clark, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Nathaniel Graff <nathaniel.graff@sifive.com>

Writes to the SiFive PRCI registers are preserved while leaving the
ready bits set for the HFX/HFR oscillators and the lock bit set for the
PLL.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_prci.c         | 49 ++++++++++++++++++++++++++++------
 include/hw/riscv/sifive_prci.h | 32 ++++++++++++++++++++++
 2 files changed, 73 insertions(+), 8 deletions(-)

diff --git a/hw/riscv/sifive_prci.c b/hw/riscv/sifive_prci.c
index fa136b5a9fe9..f406682c91f1 100644
--- a/hw/riscv/sifive_prci.c
+++ b/hw/riscv/sifive_prci.c
@@ -24,15 +24,18 @@
 #include "target/riscv/cpu.h"
 #include "hw/riscv/sifive_prci.h"
 
-/* currently implements enough to mock freedom-e-sdk BSP clock programming */
-
 static uint64_t sifive_prci_read(void *opaque, hwaddr addr, unsigned int size)
 {
-    if (addr == 0 /* PRCI_HFROSCCFG */) {
-        return 1 << 31; /* ROSC_RDY */
-    }
-    if (addr == 8 /* PRCI_PLLCFG    */) {
-        return 1 << 31; /* PLL_LOCK */
+    SiFivePRCIState *s = opaque;
+    switch (addr) {
+    case SIFIVE_PRCI_HFROSCCFG:
+        return s->hfrosccfg;
+    case SIFIVE_PRCI_HFXOSCCFG:
+        return s->hfxosccfg;
+    case SIFIVE_PRCI_PLLCFG:
+        return s->pllcfg;
+    case SIFIVE_PRCI_PLLOUTDIV:
+        return s->plloutdiv;
     }
     hw_error("%s: read: addr=0x%x\n", __func__, (int)addr);
     return 0;
@@ -41,7 +44,30 @@ static uint64_t sifive_prci_read(void *opaque, hwaddr addr, unsigned int size)
 static void sifive_prci_write(void *opaque, hwaddr addr,
            uint64_t val64, unsigned int size)
 {
-    /* discard writes */
+    SiFivePRCIState *s = opaque;
+    switch (addr) {
+    case SIFIVE_PRCI_HFROSCCFG:
+        s->hfrosccfg = (uint32_t) val64;
+        /* OSC stays ready */
+        s->hfrosccfg |= SIFIVE_PRCI_HFROSCCFG_RDY;
+        break;
+    case SIFIVE_PRCI_HFXOSCCFG:
+        s->hfxosccfg = (uint32_t) val64;
+        /* OSC stays ready */
+        s->hfxosccfg |= SIFIVE_PRCI_HFXOSCCFG_RDY;
+        break;
+    case SIFIVE_PRCI_PLLCFG:
+        s->pllcfg = (uint32_t) val64;
+        /* PLL stays locked */
+        s->pllcfg |= SIFIVE_PRCI_PLLCFG_LOCK;
+        break;
+    case SIFIVE_PRCI_PLLOUTDIV:
+        s->plloutdiv = (uint32_t) val64;
+        break;
+    default:
+        hw_error("%s: bad write: addr=0x%x v=0x%x\n",
+                 __func__, (int)addr, (int)val64);
+    }
 }
 
 static const MemoryRegionOps sifive_prci_ops = {
@@ -61,6 +87,13 @@ static void sifive_prci_init(Object *obj)
     memory_region_init_io(&s->mmio, obj, &sifive_prci_ops, s,
                           TYPE_SIFIVE_PRCI, 0x8000);
     sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
+
+    s->hfrosccfg = (SIFIVE_PRCI_HFROSCCFG_RDY | SIFIVE_PRCI_HFROSCCFG_EN);
+    s->hfxosccfg = (SIFIVE_PRCI_HFROSCCFG_RDY | SIFIVE_PRCI_HFROSCCFG_EN);
+    s->pllcfg = (SIFIVE_PRCI_PLLCFG_REFSEL | SIFIVE_PRCI_PLLCFG_BYPASS |
+                SIFIVE_PRCI_PLLCFG_LOCK);
+    s->plloutdiv = SIFIVE_PRCI_PLLOUTDIV_DIV1;
+
 }
 
 static const TypeInfo sifive_prci_info = {
diff --git a/include/hw/riscv/sifive_prci.h b/include/hw/riscv/sifive_prci.h
index b6f4c486cc1e..bd51c4af3c1c 100644
--- a/include/hw/riscv/sifive_prci.h
+++ b/include/hw/riscv/sifive_prci.h
@@ -19,6 +19,34 @@
 #ifndef HW_SIFIVE_PRCI_H
 #define HW_SIFIVE_PRCI_H
 
+enum {
+    SIFIVE_PRCI_HFROSCCFG   = 0x0,
+    SIFIVE_PRCI_HFXOSCCFG   = 0x4,
+    SIFIVE_PRCI_PLLCFG      = 0x8,
+    SIFIVE_PRCI_PLLOUTDIV   = 0xC
+};
+
+enum {
+    SIFIVE_PRCI_HFROSCCFG_RDY   = (1 << 31),
+    SIFIVE_PRCI_HFROSCCFG_EN    = (1 << 30)
+};
+
+enum {
+    SIFIVE_PRCI_HFXOSCCFG_RDY   = (1 << 31),
+    SIFIVE_PRCI_HFXOSCCFG_EN    = (1 << 30)
+};
+
+enum {
+    SIFIVE_PRCI_PLLCFG_PLLSEL   = (1 << 16),
+    SIFIVE_PRCI_PLLCFG_REFSEL   = (1 << 17),
+    SIFIVE_PRCI_PLLCFG_BYPASS   = (1 << 18),
+    SIFIVE_PRCI_PLLCFG_LOCK     = (1 << 31)
+};
+
+enum {
+    SIFIVE_PRCI_PLLOUTDIV_DIV1  = (1 << 8)
+};
+
 #define TYPE_SIFIVE_PRCI "riscv.sifive.prci"
 
 #define SIFIVE_PRCI(obj) \
@@ -30,6 +58,10 @@ typedef struct SiFivePRCIState {
 
     /*< public >*/
     MemoryRegion mmio;
+    uint32_t hfrosccfg;
+    uint32_t hfxosccfg;
+    uint32_t pllcfg;
+    uint32_t plloutdiv;
 } SiFivePRCIState;
 
 DeviceState *sifive_prci_create(hwaddr addr);
-- 
2.21.0



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

* [Qemu-riscv] [PULL 02/34] sifive_prci: Read and write PRCI registers
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Nathaniel Graff, Michael Clark, Palmer Dabbelt

From: Nathaniel Graff <nathaniel.graff@sifive.com>

Writes to the SiFive PRCI registers are preserved while leaving the
ready bits set for the HFX/HFR oscillators and the lock bit set for the
PLL.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_prci.c         | 49 ++++++++++++++++++++++++++++------
 include/hw/riscv/sifive_prci.h | 32 ++++++++++++++++++++++
 2 files changed, 73 insertions(+), 8 deletions(-)

diff --git a/hw/riscv/sifive_prci.c b/hw/riscv/sifive_prci.c
index fa136b5a9fe9..f406682c91f1 100644
--- a/hw/riscv/sifive_prci.c
+++ b/hw/riscv/sifive_prci.c
@@ -24,15 +24,18 @@
 #include "target/riscv/cpu.h"
 #include "hw/riscv/sifive_prci.h"
 
-/* currently implements enough to mock freedom-e-sdk BSP clock programming */
-
 static uint64_t sifive_prci_read(void *opaque, hwaddr addr, unsigned int size)
 {
-    if (addr == 0 /* PRCI_HFROSCCFG */) {
-        return 1 << 31; /* ROSC_RDY */
-    }
-    if (addr == 8 /* PRCI_PLLCFG    */) {
-        return 1 << 31; /* PLL_LOCK */
+    SiFivePRCIState *s = opaque;
+    switch (addr) {
+    case SIFIVE_PRCI_HFROSCCFG:
+        return s->hfrosccfg;
+    case SIFIVE_PRCI_HFXOSCCFG:
+        return s->hfxosccfg;
+    case SIFIVE_PRCI_PLLCFG:
+        return s->pllcfg;
+    case SIFIVE_PRCI_PLLOUTDIV:
+        return s->plloutdiv;
     }
     hw_error("%s: read: addr=0x%x\n", __func__, (int)addr);
     return 0;
@@ -41,7 +44,30 @@ static uint64_t sifive_prci_read(void *opaque, hwaddr addr, unsigned int size)
 static void sifive_prci_write(void *opaque, hwaddr addr,
            uint64_t val64, unsigned int size)
 {
-    /* discard writes */
+    SiFivePRCIState *s = opaque;
+    switch (addr) {
+    case SIFIVE_PRCI_HFROSCCFG:
+        s->hfrosccfg = (uint32_t) val64;
+        /* OSC stays ready */
+        s->hfrosccfg |= SIFIVE_PRCI_HFROSCCFG_RDY;
+        break;
+    case SIFIVE_PRCI_HFXOSCCFG:
+        s->hfxosccfg = (uint32_t) val64;
+        /* OSC stays ready */
+        s->hfxosccfg |= SIFIVE_PRCI_HFXOSCCFG_RDY;
+        break;
+    case SIFIVE_PRCI_PLLCFG:
+        s->pllcfg = (uint32_t) val64;
+        /* PLL stays locked */
+        s->pllcfg |= SIFIVE_PRCI_PLLCFG_LOCK;
+        break;
+    case SIFIVE_PRCI_PLLOUTDIV:
+        s->plloutdiv = (uint32_t) val64;
+        break;
+    default:
+        hw_error("%s: bad write: addr=0x%x v=0x%x\n",
+                 __func__, (int)addr, (int)val64);
+    }
 }
 
 static const MemoryRegionOps sifive_prci_ops = {
@@ -61,6 +87,13 @@ static void sifive_prci_init(Object *obj)
     memory_region_init_io(&s->mmio, obj, &sifive_prci_ops, s,
                           TYPE_SIFIVE_PRCI, 0x8000);
     sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
+
+    s->hfrosccfg = (SIFIVE_PRCI_HFROSCCFG_RDY | SIFIVE_PRCI_HFROSCCFG_EN);
+    s->hfxosccfg = (SIFIVE_PRCI_HFROSCCFG_RDY | SIFIVE_PRCI_HFROSCCFG_EN);
+    s->pllcfg = (SIFIVE_PRCI_PLLCFG_REFSEL | SIFIVE_PRCI_PLLCFG_BYPASS |
+                SIFIVE_PRCI_PLLCFG_LOCK);
+    s->plloutdiv = SIFIVE_PRCI_PLLOUTDIV_DIV1;
+
 }
 
 static const TypeInfo sifive_prci_info = {
diff --git a/include/hw/riscv/sifive_prci.h b/include/hw/riscv/sifive_prci.h
index b6f4c486cc1e..bd51c4af3c1c 100644
--- a/include/hw/riscv/sifive_prci.h
+++ b/include/hw/riscv/sifive_prci.h
@@ -19,6 +19,34 @@
 #ifndef HW_SIFIVE_PRCI_H
 #define HW_SIFIVE_PRCI_H
 
+enum {
+    SIFIVE_PRCI_HFROSCCFG   = 0x0,
+    SIFIVE_PRCI_HFXOSCCFG   = 0x4,
+    SIFIVE_PRCI_PLLCFG      = 0x8,
+    SIFIVE_PRCI_PLLOUTDIV   = 0xC
+};
+
+enum {
+    SIFIVE_PRCI_HFROSCCFG_RDY   = (1 << 31),
+    SIFIVE_PRCI_HFROSCCFG_EN    = (1 << 30)
+};
+
+enum {
+    SIFIVE_PRCI_HFXOSCCFG_RDY   = (1 << 31),
+    SIFIVE_PRCI_HFXOSCCFG_EN    = (1 << 30)
+};
+
+enum {
+    SIFIVE_PRCI_PLLCFG_PLLSEL   = (1 << 16),
+    SIFIVE_PRCI_PLLCFG_REFSEL   = (1 << 17),
+    SIFIVE_PRCI_PLLCFG_BYPASS   = (1 << 18),
+    SIFIVE_PRCI_PLLCFG_LOCK     = (1 << 31)
+};
+
+enum {
+    SIFIVE_PRCI_PLLOUTDIV_DIV1  = (1 << 8)
+};
+
 #define TYPE_SIFIVE_PRCI "riscv.sifive.prci"
 
 #define SIFIVE_PRCI(obj) \
@@ -30,6 +58,10 @@ typedef struct SiFivePRCIState {
 
     /*< public >*/
     MemoryRegion mmio;
+    uint32_t hfrosccfg;
+    uint32_t hfxosccfg;
+    uint32_t pllcfg;
+    uint32_t plloutdiv;
 } SiFivePRCIState;
 
 DeviceState *sifive_prci_create(hwaddr addr);
-- 
2.21.0



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

* [Qemu-devel] [PULL 03/34] target/riscv: Fix PMP range boundary address bug
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, Dayeol Lee, Palmer Dabbelt, qemu-devel,
	Michael Clark, Alistair Francis

From: Dayeol Lee <dayeol@berkeley.edu>

A wrong address is passed to `pmp_is_in_range` while checking if a
memory access is within a PMP range.
Since the ending address of the pmp range (i.e., pmp_state.addr[i].ea)
is set to the last address in the range (i.e., pmp base + pmp size - 1),
memory accesses containg the last address in the range will always fail.

For example, assume that a PMP range is 4KB from 0x87654000 such that
the last address within the range is 0x87654fff.
1-byte access to 0x87654fff should be considered to be fully inside the
PMP range.
However the access now fails and complains partial inclusion because
pmp_is_in_range(env, i, addr + size) returns 0 whereas
pmp_is_in_range(env, i, addr) returns 1.

Signed-off-by: Dayeol Lee <dayeol@berkeley.edu>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/pmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index fed1c3c0301b..e0fe2064074a 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -245,7 +245,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
          from low to high */
     for (i = 0; i < MAX_RISCV_PMPS; i++) {
         s = pmp_is_in_range(env, i, addr);
-        e = pmp_is_in_range(env, i, addr + size);
+        e = pmp_is_in_range(env, i, addr + size - 1);
 
         /* partially inside */
         if ((s + e) == 1) {
-- 
2.21.0



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

* [Qemu-riscv] [PULL 03/34] target/riscv: Fix PMP range boundary address bug
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Dayeol Lee, Alistair Francis,
	Michael Clark, Palmer Dabbelt

From: Dayeol Lee <dayeol@berkeley.edu>

A wrong address is passed to `pmp_is_in_range` while checking if a
memory access is within a PMP range.
Since the ending address of the pmp range (i.e., pmp_state.addr[i].ea)
is set to the last address in the range (i.e., pmp base + pmp size - 1),
memory accesses containg the last address in the range will always fail.

For example, assume that a PMP range is 4KB from 0x87654000 such that
the last address within the range is 0x87654fff.
1-byte access to 0x87654fff should be considered to be fully inside the
PMP range.
However the access now fails and complains partial inclusion because
pmp_is_in_range(env, i, addr + size) returns 0 whereas
pmp_is_in_range(env, i, addr) returns 1.

Signed-off-by: Dayeol Lee <dayeol@berkeley.edu>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/pmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index fed1c3c0301b..e0fe2064074a 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -245,7 +245,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
          from low to high */
     for (i = 0; i < MAX_RISCV_PMPS; i++) {
         s = pmp_is_in_range(env, i, addr);
-        e = pmp_is_in_range(env, i, addr + size);
+        e = pmp_is_in_range(env, i, addr + size - 1);
 
         /* partially inside */
         if ((s + e) == 1) {
-- 
2.21.0



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

* [Qemu-devel] [PULL 04/34] target/riscv: Implement riscv_cpu_unassigned_access
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Michael Clark, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Michael Clark <mjc@sifive.com>

This patch adds support for the riscv_cpu_unassigned_access call
and will raise a load or store access fault.

Signed-off-by: Michael Clark <mjc@sifive.com>
[Changes by AF:
 - Squash two patches and rewrite commit message
 - Set baddr to the access address
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c        |  1 +
 target/riscv/cpu.h        |  2 ++
 target/riscv/cpu_helper.c | 16 ++++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 0632ac08cf35..5b9fae608cca 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -482,6 +482,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
     cc->gdb_stop_before_watchpoint = true;
     cc->disas_set_info = riscv_cpu_disas_set_info;
 #ifndef CONFIG_USER_ONLY
+    cc->do_unassigned_access = riscv_cpu_unassigned_access;
     cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
     cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
 #endif
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index b47cde501766..2e743312536b 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -259,6 +259,8 @@ void  riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
 bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                         MMUAccessType access_type, int mmu_idx,
                         bool probe, uintptr_t retaddr);
+void riscv_cpu_unassigned_access(CPUState *cpu, hwaddr addr, bool is_write,
+                                 bool is_exec, int unused, unsigned size);
 char *riscv_isa_string(RISCVCPU *cpu);
 void riscv_cpu_list(void);
 
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 8b6754b91798..0bbfb7f48b79 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -375,6 +375,22 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     return phys_addr;
 }
 
+void riscv_cpu_unassigned_access(CPUState *cs, hwaddr addr, bool is_write,
+                                 bool is_exec, int unused, unsigned size)
+{
+    RISCVCPU *cpu = RISCV_CPU(cs);
+    CPURISCVState *env = &cpu->env;
+
+    if (is_write) {
+        cs->exception_index = RISCV_EXCP_STORE_AMO_ACCESS_FAULT;
+    } else {
+        cs->exception_index = RISCV_EXCP_LOAD_ACCESS_FAULT;
+    }
+
+    env->badaddr = addr;
+    riscv_raise_exception(&cpu->env, cs->exception_index, GETPC());
+}
+
 void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
                                    MMUAccessType access_type, int mmu_idx,
                                    uintptr_t retaddr)
-- 
2.21.0



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

* [Qemu-riscv] [PULL 04/34] target/riscv: Implement riscv_cpu_unassigned_access
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Michael Clark, Alistair Francis, Palmer Dabbelt

From: Michael Clark <mjc@sifive.com>

This patch adds support for the riscv_cpu_unassigned_access call
and will raise a load or store access fault.

Signed-off-by: Michael Clark <mjc@sifive.com>
[Changes by AF:
 - Squash two patches and rewrite commit message
 - Set baddr to the access address
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c        |  1 +
 target/riscv/cpu.h        |  2 ++
 target/riscv/cpu_helper.c | 16 ++++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 0632ac08cf35..5b9fae608cca 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -482,6 +482,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
     cc->gdb_stop_before_watchpoint = true;
     cc->disas_set_info = riscv_cpu_disas_set_info;
 #ifndef CONFIG_USER_ONLY
+    cc->do_unassigned_access = riscv_cpu_unassigned_access;
     cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
     cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
 #endif
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index b47cde501766..2e743312536b 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -259,6 +259,8 @@ void  riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
 bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                         MMUAccessType access_type, int mmu_idx,
                         bool probe, uintptr_t retaddr);
+void riscv_cpu_unassigned_access(CPUState *cpu, hwaddr addr, bool is_write,
+                                 bool is_exec, int unused, unsigned size);
 char *riscv_isa_string(RISCVCPU *cpu);
 void riscv_cpu_list(void);
 
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 8b6754b91798..0bbfb7f48b79 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -375,6 +375,22 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     return phys_addr;
 }
 
+void riscv_cpu_unassigned_access(CPUState *cs, hwaddr addr, bool is_write,
+                                 bool is_exec, int unused, unsigned size)
+{
+    RISCVCPU *cpu = RISCV_CPU(cs);
+    CPURISCVState *env = &cpu->env;
+
+    if (is_write) {
+        cs->exception_index = RISCV_EXCP_STORE_AMO_ACCESS_FAULT;
+    } else {
+        cs->exception_index = RISCV_EXCP_LOAD_ACCESS_FAULT;
+    }
+
+    env->badaddr = addr;
+    riscv_raise_exception(&cpu->env, cs->exception_index, GETPC());
+}
+
 void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
                                    MMUAccessType access_type, int mmu_idx,
                                    uintptr_t retaddr)
-- 
2.21.0



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

* [Qemu-devel] [PULL 05/34] RISC-V: Only Check PMP if MMU translation succeeds
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current implementation unnecessarily checks for PMP even if MMU translation
failed. This may trigger a wrong PMP access exception instead of
a page exception.

For example, the very first instruction fetched after the first satp write in
S-Mode will trigger a PMP access fault instead of an instruction fetch page
fault.

This patch prioritises MMU exceptions over PMP exceptions and only checks for
PMP if MMU translation succeeds. This patch is required for future commits
that properly report PMP exception violations if PTW succeeds.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 0bbfb7f48b79..a45b05ef8395 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -436,6 +436,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                   " prot %d\n", __func__, address, ret, pa, prot);
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
+        (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
         ret = TRANSLATE_FAIL;
     }
-- 
2.21.0



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

* [Qemu-riscv] [PULL 05/34] RISC-V: Only Check PMP if MMU translation succeeds
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Alistair Francis,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current implementation unnecessarily checks for PMP even if MMU translation
failed. This may trigger a wrong PMP access exception instead of
a page exception.

For example, the very first instruction fetched after the first satp write in
S-Mode will trigger a PMP access fault instead of an instruction fetch page
fault.

This patch prioritises MMU exceptions over PMP exceptions and only checks for
PMP if MMU translation succeeds. This patch is required for future commits
that properly report PMP exception violations if PTW succeeds.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 0bbfb7f48b79..a45b05ef8395 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -436,6 +436,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                   " prot %d\n", __func__, address, ret, pa, prot);
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
+        (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
         ret = TRANSLATE_FAIL;
     }
-- 
2.21.0



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

* [Qemu-devel] [PULL 06/34] RISC-V: Raise access fault exceptions on PMP violations
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

Section 3.6 in RISC-V v1.10 privilege specification states that PMP violations
report "access exceptions." The current PMP implementation has
a bug which wrongly reports "page exceptions" on PMP violations.

This patch fixes this bug by reporting the correct PMP access exceptions
trap values.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index a45b05ef8395..ffbfaf433268 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -337,12 +337,13 @@ restart:
 }
 
 static void raise_mmu_exception(CPURISCVState *env, target_ulong address,
-                                MMUAccessType access_type)
+                                MMUAccessType access_type, bool pmp_violation)
 {
     CPUState *cs = env_cpu(env);
     int page_fault_exceptions =
         (env->priv_ver >= PRIV_VERSION_1_10_0) &&
-        get_field(env->satp, SATP_MODE) != VM_1_10_MBARE;
+        get_field(env->satp, SATP_MODE) != VM_1_10_MBARE &&
+        !pmp_violation;
     switch (access_type) {
     case MMU_INST_FETCH:
         cs->exception_index = page_fault_exceptions ?
@@ -424,6 +425,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     CPURISCVState *env = &cpu->env;
     hwaddr pa = 0;
     int prot;
+    bool pmp_violation = false;
     int ret = TRANSLATE_FAIL;
 
     qemu_log_mask(CPU_LOG_MMU, "%s ad %" VADDR_PRIx " rw %d mmu_idx %d\n",
@@ -438,6 +440,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
+        pmp_violation = true;
         ret = TRANSLATE_FAIL;
     }
     if (ret == TRANSLATE_SUCCESS) {
@@ -447,7 +450,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     } else if (probe) {
         return false;
     } else {
-        raise_mmu_exception(env, address, access_type);
+        raise_mmu_exception(env, address, access_type, pmp_violation);
         riscv_raise_exception(env, cs->exception_index, retaddr);
     }
 #else
-- 
2.21.0



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

* [Qemu-riscv] [PULL 06/34] RISC-V: Raise access fault exceptions on PMP violations
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Alistair Francis,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

Section 3.6 in RISC-V v1.10 privilege specification states that PMP violations
report "access exceptions." The current PMP implementation has
a bug which wrongly reports "page exceptions" on PMP violations.

This patch fixes this bug by reporting the correct PMP access exceptions
trap values.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index a45b05ef8395..ffbfaf433268 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -337,12 +337,13 @@ restart:
 }
 
 static void raise_mmu_exception(CPURISCVState *env, target_ulong address,
-                                MMUAccessType access_type)
+                                MMUAccessType access_type, bool pmp_violation)
 {
     CPUState *cs = env_cpu(env);
     int page_fault_exceptions =
         (env->priv_ver >= PRIV_VERSION_1_10_0) &&
-        get_field(env->satp, SATP_MODE) != VM_1_10_MBARE;
+        get_field(env->satp, SATP_MODE) != VM_1_10_MBARE &&
+        !pmp_violation;
     switch (access_type) {
     case MMU_INST_FETCH:
         cs->exception_index = page_fault_exceptions ?
@@ -424,6 +425,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     CPURISCVState *env = &cpu->env;
     hwaddr pa = 0;
     int prot;
+    bool pmp_violation = false;
     int ret = TRANSLATE_FAIL;
 
     qemu_log_mask(CPU_LOG_MMU, "%s ad %" VADDR_PRIx " rw %d mmu_idx %d\n",
@@ -438,6 +440,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
+        pmp_violation = true;
         ret = TRANSLATE_FAIL;
     }
     if (ret == TRANSLATE_SUCCESS) {
@@ -447,7 +450,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     } else if (probe) {
         return false;
     } else {
-        raise_mmu_exception(env, address, access_type);
+        raise_mmu_exception(env, address, access_type, pmp_violation);
         riscv_raise_exception(env, cs->exception_index, retaddr);
     }
 #else
-- 
2.21.0



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

* [Qemu-devel] [PULL 07/34] RISC-V: Check for the effective memory privilege mode during PMP checks
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current PMP check function checks for env->priv which is not the effective
memory privilege mode.

For example, mstatus.MPRV could be set while executing in M-Mode, and in that
case the privilege mode for the PMP check should be S-Mode rather than M-Mode
(in env->priv) if mstatus.MPP == PRV_S.

This patch passes the effective memory privilege mode to the PMP check.
Functions that call the PMP check should pass the correct memory privilege mode
after reading mstatus' MPRV/MPP or hstatus.SPRV (if Hypervisor mode exists).

Suggested-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 10 +++++++++-
 target/riscv/pmp.c        |  6 +++---
 target/riscv/pmp.h        |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index ffbfaf433268..71b8123b1019 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -427,19 +427,27 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     int prot;
     bool pmp_violation = false;
     int ret = TRANSLATE_FAIL;
+    int mode = mmu_idx;
 
     qemu_log_mask(CPU_LOG_MMU, "%s ad %" VADDR_PRIx " rw %d mmu_idx %d\n",
                   __func__, address, access_type, mmu_idx);
 
     ret = get_physical_address(env, &pa, &prot, address, access_type, mmu_idx);
 
+    if (mode == PRV_M && access_type != MMU_INST_FETCH) {
+        if (get_field(env->mstatus, MSTATUS_MPRV)) {
+            mode = get_field(env->mstatus, MSTATUS_MPP);
+        }
+    }
+
     qemu_log_mask(CPU_LOG_MMU,
                   "%s address=%" VADDR_PRIx " ret %d physical " TARGET_FMT_plx
                   " prot %d\n", __func__, address, ret, pa, prot);
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
-        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
+        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
+        mode)) {
         pmp_violation = true;
         ret = TRANSLATE_FAIL;
     }
diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index e0fe2064074a..5944f4cb6607 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -228,7 +228,7 @@ static int pmp_is_in_range(CPURISCVState *env, int pmp_index, target_ulong addr)
  * Check if the address has required RWX privs to complete desired operation
  */
 bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
-    target_ulong size, pmp_priv_t privs)
+    target_ulong size, pmp_priv_t privs, target_ulong mode)
 {
     int i = 0;
     int ret = -1;
@@ -264,7 +264,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
             }
 
             allowed_privs = PMP_READ | PMP_WRITE | PMP_EXEC;
-            if ((env->priv != PRV_M) || pmp_is_locked(env, i)) {
+            if ((mode != PRV_M) || pmp_is_locked(env, i)) {
                 allowed_privs &= env->pmp_state.pmp[i].cfg_reg;
             }
 
@@ -280,7 +280,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
 
     /* No rule matched */
     if (ret == -1) {
-        if (env->priv == PRV_M) {
+        if (mode == PRV_M) {
             ret = 1; /* Privileged spec v1.10 states if no PMP entry matches an
                       * M-Mode access, the access succeeds */
         } else {
diff --git a/target/riscv/pmp.h b/target/riscv/pmp.h
index 66790950eb75..8e19793132db 100644
--- a/target/riscv/pmp.h
+++ b/target/riscv/pmp.h
@@ -59,6 +59,6 @@ void pmpaddr_csr_write(CPURISCVState *env, uint32_t addr_index,
     target_ulong val);
 target_ulong pmpaddr_csr_read(CPURISCVState *env, uint32_t addr_index);
 bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
-    target_ulong size, pmp_priv_t priv);
+    target_ulong size, pmp_priv_t priv, target_ulong mode);
 
 #endif
-- 
2.21.0



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

* [Qemu-riscv] [PULL 07/34] RISC-V: Check for the effective memory privilege mode during PMP checks
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Alistair Francis,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current PMP check function checks for env->priv which is not the effective
memory privilege mode.

For example, mstatus.MPRV could be set while executing in M-Mode, and in that
case the privilege mode for the PMP check should be S-Mode rather than M-Mode
(in env->priv) if mstatus.MPP == PRV_S.

This patch passes the effective memory privilege mode to the PMP check.
Functions that call the PMP check should pass the correct memory privilege mode
after reading mstatus' MPRV/MPP or hstatus.SPRV (if Hypervisor mode exists).

Suggested-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 10 +++++++++-
 target/riscv/pmp.c        |  6 +++---
 target/riscv/pmp.h        |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index ffbfaf433268..71b8123b1019 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -427,19 +427,27 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     int prot;
     bool pmp_violation = false;
     int ret = TRANSLATE_FAIL;
+    int mode = mmu_idx;
 
     qemu_log_mask(CPU_LOG_MMU, "%s ad %" VADDR_PRIx " rw %d mmu_idx %d\n",
                   __func__, address, access_type, mmu_idx);
 
     ret = get_physical_address(env, &pa, &prot, address, access_type, mmu_idx);
 
+    if (mode == PRV_M && access_type != MMU_INST_FETCH) {
+        if (get_field(env->mstatus, MSTATUS_MPRV)) {
+            mode = get_field(env->mstatus, MSTATUS_MPP);
+        }
+    }
+
     qemu_log_mask(CPU_LOG_MMU,
                   "%s address=%" VADDR_PRIx " ret %d physical " TARGET_FMT_plx
                   " prot %d\n", __func__, address, ret, pa, prot);
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
-        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) {
+        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
+        mode)) {
         pmp_violation = true;
         ret = TRANSLATE_FAIL;
     }
diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index e0fe2064074a..5944f4cb6607 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -228,7 +228,7 @@ static int pmp_is_in_range(CPURISCVState *env, int pmp_index, target_ulong addr)
  * Check if the address has required RWX privs to complete desired operation
  */
 bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
-    target_ulong size, pmp_priv_t privs)
+    target_ulong size, pmp_priv_t privs, target_ulong mode)
 {
     int i = 0;
     int ret = -1;
@@ -264,7 +264,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
             }
 
             allowed_privs = PMP_READ | PMP_WRITE | PMP_EXEC;
-            if ((env->priv != PRV_M) || pmp_is_locked(env, i)) {
+            if ((mode != PRV_M) || pmp_is_locked(env, i)) {
                 allowed_privs &= env->pmp_state.pmp[i].cfg_reg;
             }
 
@@ -280,7 +280,7 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
 
     /* No rule matched */
     if (ret == -1) {
-        if (env->priv == PRV_M) {
+        if (mode == PRV_M) {
             ret = 1; /* Privileged spec v1.10 states if no PMP entry matches an
                       * M-Mode access, the access succeeds */
         } else {
diff --git a/target/riscv/pmp.h b/target/riscv/pmp.h
index 66790950eb75..8e19793132db 100644
--- a/target/riscv/pmp.h
+++ b/target/riscv/pmp.h
@@ -59,6 +59,6 @@ void pmpaddr_csr_write(CPURISCVState *env, uint32_t addr_index,
     target_ulong val);
 target_ulong pmpaddr_csr_read(CPURISCVState *env, uint32_t addr_index);
 bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
-    target_ulong size, pmp_priv_t priv);
+    target_ulong size, pmp_priv_t priv, target_ulong mode);
 
 #endif
-- 
2.21.0



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

* [Qemu-devel] [PULL 08/34] RISC-V: Check PMP during Page Table Walks
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Jonathan Behrens, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The PMP should be checked when doing a page table walk, and report access
fault exception if the to-be-read PTE failed the PMP check.

Suggested-by: Jonathan Behrens <fintelia@gmail.com>
Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.h        |  1 +
 target/riscv/cpu_helper.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 2e743312536b..934b71c85e13 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -81,6 +81,7 @@ enum {
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
 
+#define TRANSLATE_PMP_FAIL 2
 #define TRANSLATE_FAIL 1
 #define TRANSLATE_SUCCESS 0
 #define MMU_USER_IDX 3
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 71b8123b1019..66be83210f11 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -230,6 +230,12 @@ restart:
 
         /* check that physical address of PTE is legal */
         target_ulong pte_addr = base + idx * ptesize;
+
+        if (riscv_feature(env, RISCV_FEATURE_PMP) &&
+            !pmp_hart_has_privs(env, pte_addr, sizeof(target_ulong),
+            1 << MMU_DATA_LOAD, PRV_S)) {
+            return TRANSLATE_PMP_FAIL;
+        }
 #if defined(TARGET_RISCV32)
         target_ulong pte = ldl_phys(cs->as, pte_addr);
 #elif defined(TARGET_RISCV64)
@@ -448,8 +454,10 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
         (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
         mode)) {
+        ret = TRANSLATE_PMP_FAIL;
+    }
+    if (ret == TRANSLATE_PMP_FAIL) {
         pmp_violation = true;
-        ret = TRANSLATE_FAIL;
     }
     if (ret == TRANSLATE_SUCCESS) {
         tlb_set_page(cs, address & TARGET_PAGE_MASK, pa & TARGET_PAGE_MASK,
-- 
2.21.0



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

* [Qemu-riscv] [PULL 08/34] RISC-V: Check PMP during Page Table Walks
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Jonathan Behrens,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The PMP should be checked when doing a page table walk, and report access
fault exception if the to-be-read PTE failed the PMP check.

Suggested-by: Jonathan Behrens <fintelia@gmail.com>
Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.h        |  1 +
 target/riscv/cpu_helper.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 2e743312536b..934b71c85e13 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -81,6 +81,7 @@ enum {
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
 
+#define TRANSLATE_PMP_FAIL 2
 #define TRANSLATE_FAIL 1
 #define TRANSLATE_SUCCESS 0
 #define MMU_USER_IDX 3
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 71b8123b1019..66be83210f11 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -230,6 +230,12 @@ restart:
 
         /* check that physical address of PTE is legal */
         target_ulong pte_addr = base + idx * ptesize;
+
+        if (riscv_feature(env, RISCV_FEATURE_PMP) &&
+            !pmp_hart_has_privs(env, pte_addr, sizeof(target_ulong),
+            1 << MMU_DATA_LOAD, PRV_S)) {
+            return TRANSLATE_PMP_FAIL;
+        }
 #if defined(TARGET_RISCV32)
         target_ulong pte = ldl_phys(cs->as, pte_addr);
 #elif defined(TARGET_RISCV64)
@@ -448,8 +454,10 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
         (ret == TRANSLATE_SUCCESS) &&
         !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
         mode)) {
+        ret = TRANSLATE_PMP_FAIL;
+    }
+    if (ret == TRANSLATE_PMP_FAIL) {
         pmp_violation = true;
-        ret = TRANSLATE_FAIL;
     }
     if (ret == TRANSLATE_SUCCESS) {
         tlb_set_page(cs, address & TARGET_PAGE_MASK, pa & TARGET_PAGE_MASK,
-- 
2.21.0



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

* [Qemu-devel] [PULL 09/34] RISC-V: Fix a PMP bug where it succeeds even if PMP entry is off
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current implementation returns 1 (PMP check success) if the address is in
range even if the PMP entry is off. This is a bug.

For example, if there is a PMP check in S-Mode which is in range, but its PMP
entry is off, this will succeed, which it should not.

The patch fixes this bug by only checking the PMP permissions if the address is
in range and its corresponding PMP entry it not off. Otherwise, it will keep
the ret = -1 which will be checked and handled correctly at the end of the
function.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/pmp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index 5944f4cb6607..958c7502a0e0 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -258,11 +258,12 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
         /* fully inside */
         const uint8_t a_field =
             pmp_get_a_field(env->pmp_state.pmp[i].cfg_reg);
-        if ((s + e) == 2) {
-            if (PMP_AMATCH_OFF == a_field) {
-                return 1;
-            }
 
+        /*
+         * If the PMP entry is not off and the address is in range, do the priv
+         * check
+         */
+        if (((s + e) == 2) && (PMP_AMATCH_OFF != a_field)) {
             allowed_privs = PMP_READ | PMP_WRITE | PMP_EXEC;
             if ((mode != PRV_M) || pmp_is_locked(env, i)) {
                 allowed_privs &= env->pmp_state.pmp[i].cfg_reg;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 09/34] RISC-V: Fix a PMP bug where it succeeds even if PMP entry is off
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Alistair Francis,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The current implementation returns 1 (PMP check success) if the address is in
range even if the PMP entry is off. This is a bug.

For example, if there is a PMP check in S-Mode which is in range, but its PMP
entry is off, this will succeed, which it should not.

The patch fixes this bug by only checking the PMP permissions if the address is
in range and its corresponding PMP entry it not off. Otherwise, it will keep
the ret = -1 which will be checked and handled correctly at the end of the
function.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/pmp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index 5944f4cb6607..958c7502a0e0 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -258,11 +258,12 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr,
         /* fully inside */
         const uint8_t a_field =
             pmp_get_a_field(env->pmp_state.pmp[i].cfg_reg);
-        if ((s + e) == 2) {
-            if (PMP_AMATCH_OFF == a_field) {
-                return 1;
-            }
 
+        /*
+         * If the PMP entry is not off and the address is in range, do the priv
+         * check
+         */
+        if (((s + e) == 2) && (PMP_AMATCH_OFF != a_field)) {
             allowed_privs = PMP_READ | PMP_WRITE | PMP_EXEC;
             if ((mode != PRV_M) || pmp_is_locked(env, i)) {
                 allowed_privs &= env->pmp_state.pmp[i].cfg_reg;
-- 
2.21.0



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

* [Qemu-devel] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel,
	Hesham Almatary

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The PMP check should be of the memory access size rather
than TARGET_PAGE_SIZE.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 66be83210f11..e1b079e69c60 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -452,8 +452,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
-        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
-        mode)) {
+        !pmp_hart_has_privs(env, pa, size, 1 << access_type, mode)) {
         ret = TRANSLATE_PMP_FAIL;
     }
     if (ret == TRANSLATE_PMP_FAIL) {
-- 
2.21.0



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

* [Qemu-riscv] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Hesham Almatary, Alistair Francis,
	Palmer Dabbelt

From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>

The PMP check should be of the memory access size rather
than TARGET_PAGE_SIZE.

Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_helper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 66be83210f11..e1b079e69c60 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -452,8 +452,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
 
     if (riscv_feature(env, RISCV_FEATURE_PMP) &&
         (ret == TRANSLATE_SUCCESS) &&
-        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
-        mode)) {
+        !pmp_hart_has_privs(env, pa, size, 1 << access_type, mode)) {
         ret = TRANSLATE_PMP_FAIL;
     }
     if (ret == TRANSLATE_PMP_FAIL) {
-- 
2.21.0



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

* [Qemu-devel] [PULL 11/34] riscv: virt: Correct pci "bus-range" encoding
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

The largest pci bus number should be calculated from ECAM size,
instead of its base address.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 84d94d0c42d8..487f61404b21 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -298,7 +298,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_string(fdt, nodename, "device_type", "pci");
     qemu_fdt_setprop_cell(fdt, nodename, "linux,pci-domain", 0);
     qemu_fdt_setprop_cells(fdt, nodename, "bus-range", 0,
-                           memmap[VIRT_PCIE_ECAM].base /
+                           memmap[VIRT_PCIE_ECAM].size /
                                PCIE_MMCFG_SIZE_MIN - 1);
     qemu_fdt_setprop(fdt, nodename, "dma-coherent", NULL, 0);
     qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base,
-- 
2.21.0



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

* [Qemu-riscv] [PULL 11/34] riscv: virt: Correct pci "bus-range" encoding
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Bin Meng, Alistair Francis, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

The largest pci bus number should be calculated from ECAM size,
instead of its base address.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 84d94d0c42d8..487f61404b21 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -298,7 +298,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_string(fdt, nodename, "device_type", "pci");
     qemu_fdt_setprop_cell(fdt, nodename, "linux,pci-domain", 0);
     qemu_fdt_setprop_cells(fdt, nodename, "bus-range", 0,
-                           memmap[VIRT_PCIE_ECAM].base /
+                           memmap[VIRT_PCIE_ECAM].size /
                                PCIE_MMCFG_SIZE_MIN - 1);
     qemu_fdt_setprop(fdt, nodename, "dma-coherent", NULL, 0);
     qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base,
-- 
2.21.0



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

* [Qemu-devel] [PULL 12/34] RISC-V: Fix a memory leak when realizing a sifive_e
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Peter Maydell, qemu-riscv, Palmer Dabbelt, qemu-devel,
	Alistair Francis, ilippe=20Mathieu-Daud=C3=A9?=

Coverity pointed out a memory leak in riscv_sifive_e_soc_realize(),
where a pair of recently added MemoryRegion instances would not be freed
if there were errors elsewhere in the function.  The fix here is to
simply not use dynamic allocation for these instances: there's always
one of each in SiFiveESoCState, so instead we just include them within
the struct.

Fixes: 30efbf330a45 ("SiFive RISC-V GPIO Device")
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_e.c         | 13 ++++++-------
 include/hw/riscv/sifive_e.h |  2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 80ac56fa7d5e..a5b4086da36d 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -158,17 +158,15 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
 
     SiFiveESoCState *s = RISCV_E_SOC(dev);
     MemoryRegion *sys_mem = get_system_memory();
-    MemoryRegion *xip_mem = g_new(MemoryRegion, 1);
-    MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
 
     object_property_set_bool(OBJECT(&s->cpus), true, "realized",
                             &error_abort);
 
     /* Mask ROM */
-    memory_region_init_rom(mask_rom, NULL, "riscv.sifive.e.mrom",
+    memory_region_init_rom(&s->mask_rom, NULL, "riscv.sifive.e.mrom",
         memmap[SIFIVE_E_MROM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[SIFIVE_E_MROM].base, mask_rom);
+        memmap[SIFIVE_E_MROM].base, &s->mask_rom);
 
     /* MMIO */
     s->plic = sifive_plic_create(memmap[SIFIVE_E_PLIC].base,
@@ -228,10 +226,11 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
         memmap[SIFIVE_E_PWM2].base, memmap[SIFIVE_E_PWM2].size);
 
     /* Flash memory */
-    memory_region_init_ram(xip_mem, NULL, "riscv.sifive.e.xip",
+    memory_region_init_ram(&s->xip_mem, NULL, "riscv.sifive.e.xip",
         memmap[SIFIVE_E_XIP].size, &error_fatal);
-    memory_region_set_readonly(xip_mem, true);
-    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base, xip_mem);
+    memory_region_set_readonly(&s->xip_mem, true);
+    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base,
+        &s->xip_mem);
 }
 
 static void riscv_sifive_e_machine_init(MachineClass *mc)
diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h
index 3b14eb74621f..d175b24cb209 100644
--- a/include/hw/riscv/sifive_e.h
+++ b/include/hw/riscv/sifive_e.h
@@ -33,6 +33,8 @@ typedef struct SiFiveESoCState {
     RISCVHartArrayState cpus;
     DeviceState *plic;
     SIFIVEGPIOState gpio;
+    MemoryRegion xip_mem;
+    MemoryRegion mask_rom;
 } SiFiveESoCState;
 
 typedef struct SiFiveEState {
-- 
2.21.0



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

* [Qemu-riscv] [PULL 12/34] RISC-V: Fix a memory leak when realizing a sifive_e
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Palmer Dabbelt, Peter Maydell,
	ilippe=20Mathieu-Daud=C3=A9?=,
	Alistair Francis

Coverity pointed out a memory leak in riscv_sifive_e_soc_realize(),
where a pair of recently added MemoryRegion instances would not be freed
if there were errors elsewhere in the function.  The fix here is to
simply not use dynamic allocation for these instances: there's always
one of each in SiFiveESoCState, so instead we just include them within
the struct.

Fixes: 30efbf330a45 ("SiFive RISC-V GPIO Device")
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_e.c         | 13 ++++++-------
 include/hw/riscv/sifive_e.h |  2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 80ac56fa7d5e..a5b4086da36d 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -158,17 +158,15 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
 
     SiFiveESoCState *s = RISCV_E_SOC(dev);
     MemoryRegion *sys_mem = get_system_memory();
-    MemoryRegion *xip_mem = g_new(MemoryRegion, 1);
-    MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
 
     object_property_set_bool(OBJECT(&s->cpus), true, "realized",
                             &error_abort);
 
     /* Mask ROM */
-    memory_region_init_rom(mask_rom, NULL, "riscv.sifive.e.mrom",
+    memory_region_init_rom(&s->mask_rom, NULL, "riscv.sifive.e.mrom",
         memmap[SIFIVE_E_MROM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[SIFIVE_E_MROM].base, mask_rom);
+        memmap[SIFIVE_E_MROM].base, &s->mask_rom);
 
     /* MMIO */
     s->plic = sifive_plic_create(memmap[SIFIVE_E_PLIC].base,
@@ -228,10 +226,11 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
         memmap[SIFIVE_E_PWM2].base, memmap[SIFIVE_E_PWM2].size);
 
     /* Flash memory */
-    memory_region_init_ram(xip_mem, NULL, "riscv.sifive.e.xip",
+    memory_region_init_ram(&s->xip_mem, NULL, "riscv.sifive.e.xip",
         memmap[SIFIVE_E_XIP].size, &error_fatal);
-    memory_region_set_readonly(xip_mem, true);
-    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base, xip_mem);
+    memory_region_set_readonly(&s->xip_mem, true);
+    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base,
+        &s->xip_mem);
 }
 
 static void riscv_sifive_e_machine_init(MachineClass *mc)
diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h
index 3b14eb74621f..d175b24cb209 100644
--- a/include/hw/riscv/sifive_e.h
+++ b/include/hw/riscv/sifive_e.h
@@ -33,6 +33,8 @@ typedef struct SiFiveESoCState {
     RISCVHartArrayState cpus;
     DeviceState *plic;
     SIFIVEGPIOState gpio;
+    MemoryRegion xip_mem;
+    MemoryRegion mask_rom;
 } SiFiveESoCState;
 
 typedef struct SiFiveEState {
-- 
2.21.0



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

* [Qemu-devel] [PULL 13/34] target/riscv: Restructure deprecatd CPUs
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Restructure the deprecated CPUs to make it clear in the code that these
are depreated. They are already marked as deprecated in
qemu-deprecated.texi. There are no functional changes.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 18 ++++++++++--------
 target/riscv/cpu.h | 13 +++++++------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 5b9fae608cca..17467c3d8705 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -559,18 +559,20 @@ static const TypeInfo riscv_cpu_type_infos[] = {
     DEFINE_CPU(TYPE_RISCV_CPU_ANY,              riscv_any_cpu_init),
 #if defined(TARGET_RISCV32)
     DEFINE_CPU(TYPE_RISCV_CPU_BASE32,           riscv_base32_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU,  rv32imacu_nommu_cpu_init),
     DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31,       rv32imacu_nommu_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34,       rv32gcsu_priv1_10_0_cpu_init)
+    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34,       rv32gcsu_priv1_10_0_cpu_init),
+    /* Depreacted */
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU,  rv32imacu_nommu_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init)
 #elif defined(TARGET_RISCV64)
     DEFINE_CPU(TYPE_RISCV_CPU_BASE64,           riscv_base64_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_09_1, rv64gcsu_priv1_09_1_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64IMACU_NOMMU,  rv64imacu_nommu_cpu_init),
     DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51,       rv64imacu_nommu_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54,       rv64gcsu_priv1_10_0_cpu_init)
+    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54,       rv64gcsu_priv1_10_0_cpu_init),
+    /* Deprecated */
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64IMACU_NOMMU,  rv64imacu_nommu_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_09_1, rv64gcsu_priv1_09_1_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)
 #endif
 };
 
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 934b71c85e13..5eb9cab2ad62 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -35,16 +35,17 @@
 #define TYPE_RISCV_CPU_ANY              RISCV_CPU_TYPE_NAME("any")
 #define TYPE_RISCV_CPU_BASE32           RISCV_CPU_TYPE_NAME("rv32")
 #define TYPE_RISCV_CPU_BASE64           RISCV_CPU_TYPE_NAME("rv64")
-#define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
-#define TYPE_RISCV_CPU_RV32GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.10.0")
-#define TYPE_RISCV_CPU_RV32IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv32imacu-nommu")
-#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1")
-#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")
-#define TYPE_RISCV_CPU_RV64IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv64imacu-nommu")
 #define TYPE_RISCV_CPU_SIFIVE_E31       RISCV_CPU_TYPE_NAME("sifive-e31")
 #define TYPE_RISCV_CPU_SIFIVE_E51       RISCV_CPU_TYPE_NAME("sifive-e51")
 #define TYPE_RISCV_CPU_SIFIVE_U34       RISCV_CPU_TYPE_NAME("sifive-u34")
 #define TYPE_RISCV_CPU_SIFIVE_U54       RISCV_CPU_TYPE_NAME("sifive-u54")
+/* Deprecated */
+#define TYPE_RISCV_CPU_RV32IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv32imacu-nommu")
+#define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
+#define TYPE_RISCV_CPU_RV32GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.10.0")
+#define TYPE_RISCV_CPU_RV64IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv64imacu-nommu")
+#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1")
+#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")
 
 #define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))
 #define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))
-- 
2.21.0



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

* [Qemu-riscv] [PULL 13/34] target/riscv: Restructure deprecatd CPUs
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Restructure the deprecated CPUs to make it clear in the code that these
are depreated. They are already marked as deprecated in
qemu-deprecated.texi. There are no functional changes.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 18 ++++++++++--------
 target/riscv/cpu.h | 13 +++++++------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 5b9fae608cca..17467c3d8705 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -559,18 +559,20 @@ static const TypeInfo riscv_cpu_type_infos[] = {
     DEFINE_CPU(TYPE_RISCV_CPU_ANY,              riscv_any_cpu_init),
 #if defined(TARGET_RISCV32)
     DEFINE_CPU(TYPE_RISCV_CPU_BASE32,           riscv_base32_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU,  rv32imacu_nommu_cpu_init),
     DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31,       rv32imacu_nommu_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34,       rv32gcsu_priv1_10_0_cpu_init)
+    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34,       rv32gcsu_priv1_10_0_cpu_init),
+    /* Depreacted */
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU,  rv32imacu_nommu_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init)
 #elif defined(TARGET_RISCV64)
     DEFINE_CPU(TYPE_RISCV_CPU_BASE64,           riscv_base64_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_09_1, rv64gcsu_priv1_09_1_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_RV64IMACU_NOMMU,  rv64imacu_nommu_cpu_init),
     DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51,       rv64imacu_nommu_cpu_init),
-    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54,       rv64gcsu_priv1_10_0_cpu_init)
+    DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54,       rv64gcsu_priv1_10_0_cpu_init),
+    /* Deprecated */
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64IMACU_NOMMU,  rv64imacu_nommu_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_09_1, rv64gcsu_priv1_09_1_cpu_init),
+    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)
 #endif
 };
 
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 934b71c85e13..5eb9cab2ad62 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -35,16 +35,17 @@
 #define TYPE_RISCV_CPU_ANY              RISCV_CPU_TYPE_NAME("any")
 #define TYPE_RISCV_CPU_BASE32           RISCV_CPU_TYPE_NAME("rv32")
 #define TYPE_RISCV_CPU_BASE64           RISCV_CPU_TYPE_NAME("rv64")
-#define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
-#define TYPE_RISCV_CPU_RV32GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.10.0")
-#define TYPE_RISCV_CPU_RV32IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv32imacu-nommu")
-#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1")
-#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")
-#define TYPE_RISCV_CPU_RV64IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv64imacu-nommu")
 #define TYPE_RISCV_CPU_SIFIVE_E31       RISCV_CPU_TYPE_NAME("sifive-e31")
 #define TYPE_RISCV_CPU_SIFIVE_E51       RISCV_CPU_TYPE_NAME("sifive-e51")
 #define TYPE_RISCV_CPU_SIFIVE_U34       RISCV_CPU_TYPE_NAME("sifive-u34")
 #define TYPE_RISCV_CPU_SIFIVE_U54       RISCV_CPU_TYPE_NAME("sifive-u54")
+/* Deprecated */
+#define TYPE_RISCV_CPU_RV32IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv32imacu-nommu")
+#define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
+#define TYPE_RISCV_CPU_RV32GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.10.0")
+#define TYPE_RISCV_CPU_RV64IMACU_NOMMU  RISCV_CPU_TYPE_NAME("rv64imacu-nommu")
+#define TYPE_RISCV_CPU_RV64GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.9.1")
+#define TYPE_RISCV_CPU_RV64GCSU_V1_10_0 RISCV_CPU_TYPE_NAME("rv64gcsu-v1.10.0")
 
 #define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))
 #define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))
-- 
2.21.0



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

* [Qemu-devel] [PULL 14/34] target/riscv: Add the privledge spec version 1.11.0
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Add support for the ratified RISC-V privledge spec.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.h                             | 1 +
 target/riscv/insn_trans/trans_privileged.inc.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 5eb9cab2ad62..d559d28bcda8 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -81,6 +81,7 @@ enum {
 #define USER_VERSION_2_02_0 0x00020200
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
+#define PRIV_VERSION_1_11_0 0x00011100
 
 #define TRANSLATE_PMP_FAIL 2
 #define TRANSLATE_FAIL 1
diff --git a/target/riscv/insn_trans/trans_privileged.inc.c b/target/riscv/insn_trans/trans_privileged.inc.c
index 664d6ba3f2cc..c5e4b3e49a3e 100644
--- a/target/riscv/insn_trans/trans_privileged.inc.c
+++ b/target/riscv/insn_trans/trans_privileged.inc.c
@@ -90,7 +90,7 @@ static bool trans_wfi(DisasContext *ctx, arg_wfi *a)
 static bool trans_sfence_vma(DisasContext *ctx, arg_sfence_vma *a)
 {
 #ifndef CONFIG_USER_ONLY
-    if (ctx->priv_ver == PRIV_VERSION_1_10_0) {
+    if (ctx->priv_ver >= PRIV_VERSION_1_10_0) {
         gen_helper_tlb_flush(cpu_env);
         return true;
     }
-- 
2.21.0



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

* [Qemu-riscv] [PULL 14/34] target/riscv: Add the privledge spec version 1.11.0
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add support for the ratified RISC-V privledge spec.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.h                             | 1 +
 target/riscv/insn_trans/trans_privileged.inc.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 5eb9cab2ad62..d559d28bcda8 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -81,6 +81,7 @@ enum {
 #define USER_VERSION_2_02_0 0x00020200
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
+#define PRIV_VERSION_1_11_0 0x00011100
 
 #define TRANSLATE_PMP_FAIL 2
 #define TRANSLATE_FAIL 1
diff --git a/target/riscv/insn_trans/trans_privileged.inc.c b/target/riscv/insn_trans/trans_privileged.inc.c
index 664d6ba3f2cc..c5e4b3e49a3e 100644
--- a/target/riscv/insn_trans/trans_privileged.inc.c
+++ b/target/riscv/insn_trans/trans_privileged.inc.c
@@ -90,7 +90,7 @@ static bool trans_wfi(DisasContext *ctx, arg_wfi *a)
 static bool trans_sfence_vma(DisasContext *ctx, arg_sfence_vma *a)
 {
 #ifndef CONFIG_USER_ONLY
-    if (ctx->priv_ver == PRIV_VERSION_1_10_0) {
+    if (ctx->priv_ver >= PRIV_VERSION_1_10_0) {
         gen_helper_tlb_flush(cpu_env);
         return true;
     }
-- 
2.21.0



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

* [Qemu-devel] [PULL 15/34] target/riscv: Add the mcountinhibit CSR
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

1.11 defines mcountinhibit, which has the same numeric CSR value as
mucounteren from 1.09.1 but has different semantics.  This patch enables
the CSR for 1.11-based targets, which is trivial to implement because
the counters in QEMU never tick (legal according to the spec).

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Fix counter access semantics, change commit message to indicate
the behavior is fully emulated.]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_bits.h |  1 +
 target/riscv/csr.c      | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h
index 47450a3cdb75..11f971ad5df0 100644
--- a/target/riscv/cpu_bits.h
+++ b/target/riscv/cpu_bits.h
@@ -136,6 +136,7 @@
 #define CSR_MCOUNTEREN      0x306
 
 /* Legacy Counter Setup (priv v1.9.1) */
+/* Update to #define CSR_MCOUNTINHIBIT 0x320 for 1.11.0 */
 #define CSR_MUCOUNTEREN     0x320
 #define CSR_MSCOUNTEREN     0x321
 #define CSR_MHCOUNTEREN     0x322
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index c67d29e20618..448162e484a3 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -56,6 +56,15 @@ static int fs(CPURISCVState *env, int csrno)
 static int ctr(CPURISCVState *env, int csrno)
 {
 #if !defined(CONFIG_USER_ONLY)
+    /*
+     * The counters are always enabled on newer priv specs, as the CSR has
+     * changed from controlling that the counters can be read to controlling
+     * that the counters increment.
+     */
+    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+        return 0;
+    }
+
     uint32_t ctr_en = ~0u;
 
     if (env->priv < PRV_M) {
@@ -461,18 +470,22 @@ static int write_mcounteren(CPURISCVState *env, int csrno, target_ulong val)
     return 0;
 }
 
+/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */
 static int read_mscounteren(CPURISCVState *env, int csrno, target_ulong *val)
 {
-    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+    if (env->priv_ver > PRIV_VERSION_1_09_1
+        && env->priv_ver < PRIV_VERSION_1_11_0) {
         return -1;
     }
     *val = env->mcounteren;
     return 0;
 }
 
+/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */
 static int write_mscounteren(CPURISCVState *env, int csrno, target_ulong val)
 {
-    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+    if (env->priv_ver > PRIV_VERSION_1_09_1
+        && env->priv_ver < PRIV_VERSION_1_11_0) {
         return -1;
     }
     env->mcounteren = val;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 15/34] target/riscv: Add the mcountinhibit CSR
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

1.11 defines mcountinhibit, which has the same numeric CSR value as
mucounteren from 1.09.1 but has different semantics.  This patch enables
the CSR for 1.11-based targets, which is trivial to implement because
the counters in QEMU never tick (legal according to the spec).

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Fix counter access semantics, change commit message to indicate
the behavior is fully emulated.]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu_bits.h |  1 +
 target/riscv/csr.c      | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h
index 47450a3cdb75..11f971ad5df0 100644
--- a/target/riscv/cpu_bits.h
+++ b/target/riscv/cpu_bits.h
@@ -136,6 +136,7 @@
 #define CSR_MCOUNTEREN      0x306
 
 /* Legacy Counter Setup (priv v1.9.1) */
+/* Update to #define CSR_MCOUNTINHIBIT 0x320 for 1.11.0 */
 #define CSR_MUCOUNTEREN     0x320
 #define CSR_MSCOUNTEREN     0x321
 #define CSR_MHCOUNTEREN     0x322
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index c67d29e20618..448162e484a3 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -56,6 +56,15 @@ static int fs(CPURISCVState *env, int csrno)
 static int ctr(CPURISCVState *env, int csrno)
 {
 #if !defined(CONFIG_USER_ONLY)
+    /*
+     * The counters are always enabled on newer priv specs, as the CSR has
+     * changed from controlling that the counters can be read to controlling
+     * that the counters increment.
+     */
+    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+        return 0;
+    }
+
     uint32_t ctr_en = ~0u;
 
     if (env->priv < PRV_M) {
@@ -461,18 +470,22 @@ static int write_mcounteren(CPURISCVState *env, int csrno, target_ulong val)
     return 0;
 }
 
+/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */
 static int read_mscounteren(CPURISCVState *env, int csrno, target_ulong *val)
 {
-    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+    if (env->priv_ver > PRIV_VERSION_1_09_1
+        && env->priv_ver < PRIV_VERSION_1_11_0) {
         return -1;
     }
     *val = env->mcounteren;
     return 0;
 }
 
+/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */
 static int write_mscounteren(CPURISCVState *env, int csrno, target_ulong val)
 {
-    if (env->priv_ver > PRIV_VERSION_1_09_1) {
+    if (env->priv_ver > PRIV_VERSION_1_09_1
+        && env->priv_ver < PRIV_VERSION_1_11_0) {
         return -1;
     }
     env->mcounteren = val;
-- 
2.21.0



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

* [Qemu-devel] [PULL 16/34] target/riscv: Set privledge spec 1.11.0 as default
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Set the priv spec version 1.11.0 as the default and allow selecting it
via the command line.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 17467c3d8705..ba1325f43533 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -111,7 +111,7 @@ static void riscv_any_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0);
     set_resetvec(env, DEFAULT_RSTVEC);
 }
 
@@ -316,7 +316,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     RISCVCPU *cpu = RISCV_CPU(dev);
     CPURISCVState *env = &cpu->env;
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
-    int priv_version = PRIV_VERSION_1_10_0;
+    int priv_version = PRIV_VERSION_1_11_0;
     int user_version = USER_VERSION_2_02_0;
     target_ulong target_misa = 0;
     Error *local_err = NULL;
@@ -328,7 +328,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     }
 
     if (cpu->cfg.priv_spec) {
-        if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
+        if (!g_strcmp0(cpu->cfg.priv_spec, "v1.11.0")) {
+            priv_version = PRIV_VERSION_1_11_0;
+        } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
             priv_version = PRIV_VERSION_1_10_0;
         } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.9.1")) {
             priv_version = PRIV_VERSION_1_09_1;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 16/34] target/riscv: Set privledge spec 1.11.0 as default
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Set the priv spec version 1.11.0 as the default and allow selecting it
via the command line.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 17467c3d8705..ba1325f43533 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -111,7 +111,7 @@ static void riscv_any_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0);
     set_resetvec(env, DEFAULT_RSTVEC);
 }
 
@@ -316,7 +316,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     RISCVCPU *cpu = RISCV_CPU(dev);
     CPURISCVState *env = &cpu->env;
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
-    int priv_version = PRIV_VERSION_1_10_0;
+    int priv_version = PRIV_VERSION_1_11_0;
     int user_version = USER_VERSION_2_02_0;
     target_ulong target_misa = 0;
     Error *local_err = NULL;
@@ -328,7 +328,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     }
 
     if (cpu->cfg.priv_spec) {
-        if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
+        if (!g_strcmp0(cpu->cfg.priv_spec, "v1.11.0")) {
+            priv_version = PRIV_VERSION_1_11_0;
+        } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
             priv_version = PRIV_VERSION_1_10_0;
         } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.9.1")) {
             priv_version = PRIV_VERSION_1_09_1;
-- 
2.21.0



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

* [Qemu-devel] [PULL 17/34] qemu-deprecated.texi: Deprecate the RISC-V privledge spec 1.09.1
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Deprecate the RISC-V privledge spec version 1.09.1 in favour of the new
1.10.0 and the ratified 1.11.0.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 qemu-deprecated.texi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index df04f2840bd9..97ea4ef3001a 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -144,6 +144,14 @@ The ``acl_show'', ``acl_reset'', ``acl_policy'', ``acl_add'', and
 ``acl_remove'' commands are deprecated with no replacement. Authorization
 for VNC should be performed using the pluggable QAuthZ objects.
 
+@section Guest Emulator ISAs
+
+@subsection RISC-V ISA privledge specification version 1.09.1 (since 4.1)
+
+The RISC-V ISA privledge specification version 1.09.1 has been deprecated.
+QEMU supports both the newer version 1.10.0 and the ratified version 1.11.0, these
+should be used instead of the 1.09.1 version.
+
 @section System emulator CPUS
 
 @subsection RISC-V ISA CPUs (since 4.1)
-- 
2.21.0



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

* [Qemu-riscv] [PULL 17/34] qemu-deprecated.texi: Deprecate the RISC-V privledge spec 1.09.1
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Deprecate the RISC-V privledge spec version 1.09.1 in favour of the new
1.10.0 and the ratified 1.11.0.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 qemu-deprecated.texi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index df04f2840bd9..97ea4ef3001a 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -144,6 +144,14 @@ The ``acl_show'', ``acl_reset'', ``acl_policy'', ``acl_add'', and
 ``acl_remove'' commands are deprecated with no replacement. Authorization
 for VNC should be performed using the pluggable QAuthZ objects.
 
+@section Guest Emulator ISAs
+
+@subsection RISC-V ISA privledge specification version 1.09.1 (since 4.1)
+
+The RISC-V ISA privledge specification version 1.09.1 has been deprecated.
+QEMU supports both the newer version 1.10.0 and the ratified version 1.11.0, these
+should be used instead of the 1.09.1 version.
+
 @section System emulator CPUS
 
 @subsection RISC-V ISA CPUs (since 4.1)
-- 
2.21.0



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

* [Qemu-devel] [PULL 18/34] target/riscv: Require either I or E base extension
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index ba1325f43533..1689ffecf85f 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -373,6 +373,12 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
                        return;
        }
 
+        if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) {
+            error_setg(errp,
+                       "Either I or E extension must be set");
+                       return;
+       }
+
        if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m &
                                cpu->cfg.ext_a & cpu->cfg.ext_f &
                                cpu->cfg.ext_d)) {
-- 
2.21.0



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

* [Qemu-riscv] [PULL 18/34] target/riscv: Require either I or E base extension
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index ba1325f43533..1689ffecf85f 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -373,6 +373,12 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
                        return;
        }
 
+        if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) {
+            error_setg(errp,
+                       "Either I or E extension must be set");
+                       return;
+       }
+
        if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m &
                                cpu->cfg.ext_a & cpu->cfg.ext_f &
                                cpu->cfg.ext_d)) {
-- 
2.21.0



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

* [Qemu-devel] [PULL 19/34] target/riscv: Remove user version information
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Remove the user version information. This was never used and never
publically exposed in a release of QEMU, so let's just remove it. In
future to manage versions we can extend the extension properties to
specify version.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 32 +++++++++-----------------------
 target/riscv/cpu.h |  2 --
 2 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 1689ffecf85f..6a54ebf10c62 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -89,9 +89,8 @@ static void set_misa(CPURISCVState *env, target_ulong misa)
     env->misa_mask = env->misa = misa;
 }
 
-static void set_versions(CPURISCVState *env, int user_ver, int priv_ver)
+static void set_priv_version(CPURISCVState *env, int priv_ver)
 {
-    env->user_ver = user_ver;
     env->priv_ver = priv_ver;
 }
 
@@ -111,7 +110,7 @@ static void riscv_any_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0);
+    set_priv_version(env, PRIV_VERSION_1_11_0);
     set_resetvec(env, DEFAULT_RSTVEC);
 }
 
@@ -128,7 +127,7 @@ static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1);
+    set_priv_version(env, PRIV_VERSION_1_09_1);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -138,7 +137,7 @@ static void rv32gcsu_priv1_10_0_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -148,7 +147,7 @@ static void rv32imacu_nommu_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_PMP);
 }
@@ -166,7 +165,7 @@ static void rv64gcsu_priv1_09_1_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1);
+    set_priv_version(env, PRIV_VERSION_1_09_1);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -176,7 +175,7 @@ static void rv64gcsu_priv1_10_0_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -186,7 +185,7 @@ static void rv64imacu_nommu_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_PMP);
 }
@@ -317,7 +316,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     CPURISCVState *env = &cpu->env;
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
     int priv_version = PRIV_VERSION_1_11_0;
-    int user_version = USER_VERSION_2_02_0;
     target_ulong target_misa = 0;
     Error *local_err = NULL;
 
@@ -342,18 +340,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         }
     }
 
-    if (cpu->cfg.user_spec) {
-        if (!g_strcmp0(cpu->cfg.user_spec, "v2.02.0")) {
-            user_version = USER_VERSION_2_02_0;
-        } else {
-            error_setg(errp,
-                       "Unsupported user spec version '%s'",
-                       cpu->cfg.user_spec);
-            return;
-        }
-    }
-
-    set_versions(env, user_version, priv_version);
+    set_priv_version(env, priv_version);
     set_resetvec(env, DEFAULT_RSTVEC);
 
     if (cpu->cfg.mmu) {
@@ -454,7 +441,6 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
-    DEFINE_PROP_STRING("user_spec", RISCVCPU, cfg.user_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index d559d28bcda8..0855277b92d4 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -78,7 +78,6 @@ enum {
     RISCV_FEATURE_MISA
 };
 
-#define USER_VERSION_2_02_0 0x00020200
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
 #define PRIV_VERSION_1_11_0 0x00011100
@@ -105,7 +104,6 @@ struct CPURISCVState {
 
     target_ulong badaddr;
 
-    target_ulong user_ver;
     target_ulong priv_ver;
     target_ulong misa;
     target_ulong misa_mask;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 19/34] target/riscv: Remove user version information
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Remove the user version information. This was never used and never
publically exposed in a release of QEMU, so let's just remove it. In
future to manage versions we can extend the extension properties to
specify version.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c | 32 +++++++++-----------------------
 target/riscv/cpu.h |  2 --
 2 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 1689ffecf85f..6a54ebf10c62 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -89,9 +89,8 @@ static void set_misa(CPURISCVState *env, target_ulong misa)
     env->misa_mask = env->misa = misa;
 }
 
-static void set_versions(CPURISCVState *env, int user_ver, int priv_ver)
+static void set_priv_version(CPURISCVState *env, int priv_ver)
 {
-    env->user_ver = user_ver;
     env->priv_ver = priv_ver;
 }
 
@@ -111,7 +110,7 @@ static void riscv_any_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0);
+    set_priv_version(env, PRIV_VERSION_1_11_0);
     set_resetvec(env, DEFAULT_RSTVEC);
 }
 
@@ -128,7 +127,7 @@ static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1);
+    set_priv_version(env, PRIV_VERSION_1_09_1);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -138,7 +137,7 @@ static void rv32gcsu_priv1_10_0_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -148,7 +147,7 @@ static void rv32imacu_nommu_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV32 | RVI | RVM | RVA | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_PMP);
 }
@@ -166,7 +165,7 @@ static void rv64gcsu_priv1_09_1_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1);
+    set_priv_version(env, PRIV_VERSION_1_09_1);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -176,7 +175,7 @@ static void rv64gcsu_priv1_10_0_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_MMU);
     set_feature(env, RISCV_FEATURE_PMP);
@@ -186,7 +185,7 @@ static void rv64imacu_nommu_cpu_init(Object *obj)
 {
     CPURISCVState *env = &RISCV_CPU(obj)->env;
     set_misa(env, RV64 | RVI | RVM | RVA | RVC | RVU);
-    set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0);
+    set_priv_version(env, PRIV_VERSION_1_10_0);
     set_resetvec(env, DEFAULT_RSTVEC);
     set_feature(env, RISCV_FEATURE_PMP);
 }
@@ -317,7 +316,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
     CPURISCVState *env = &cpu->env;
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev);
     int priv_version = PRIV_VERSION_1_11_0;
-    int user_version = USER_VERSION_2_02_0;
     target_ulong target_misa = 0;
     Error *local_err = NULL;
 
@@ -342,18 +340,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         }
     }
 
-    if (cpu->cfg.user_spec) {
-        if (!g_strcmp0(cpu->cfg.user_spec, "v2.02.0")) {
-            user_version = USER_VERSION_2_02_0;
-        } else {
-            error_setg(errp,
-                       "Unsupported user spec version '%s'",
-                       cpu->cfg.user_spec);
-            return;
-        }
-    }
-
-    set_versions(env, user_version, priv_version);
+    set_priv_version(env, priv_version);
     set_resetvec(env, DEFAULT_RSTVEC);
 
     if (cpu->cfg.mmu) {
@@ -454,7 +441,6 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
-    DEFINE_PROP_STRING("user_spec", RISCVCPU, cfg.user_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index d559d28bcda8..0855277b92d4 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -78,7 +78,6 @@ enum {
     RISCV_FEATURE_MISA
 };
 
-#define USER_VERSION_2_02_0 0x00020200
 #define PRIV_VERSION_1_09_1 0x00010901
 #define PRIV_VERSION_1_10_0 0x00011000
 #define PRIV_VERSION_1_11_0 0x00011100
@@ -105,7 +104,6 @@ struct CPURISCVState {
 
     target_ulong badaddr;
 
-    target_ulong user_ver;
     target_ulong priv_ver;
     target_ulong misa;
     target_ulong misa_mask;
-- 
2.21.0



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

* [Qemu-devel] [PULL 20/34] target/riscv: Add support for disabling/enabling Counters
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Alistair Francis <alistair.francis@wdc.com>

Add support for disabling/enabling the "Counters" extension.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c |  1 +
 target/riscv/cpu.h |  1 +
 target/riscv/csr.c | 17 ++++++++++++-----
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 6a54ebf10c62..be90fa7d0808 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -440,6 +440,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("c", RISCVCPU, cfg.ext_c, true),
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
+    DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 0855277b92d4..4d4e0f89e206 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -222,6 +222,7 @@ typedef struct RISCVCPU {
         bool ext_c;
         bool ext_s;
         bool ext_u;
+        bool ext_counters;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 448162e484a3..de67741f3648 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -56,17 +56,24 @@ static int fs(CPURISCVState *env, int csrno)
 static int ctr(CPURISCVState *env, int csrno)
 {
 #if !defined(CONFIG_USER_ONLY)
+    CPUState *cs = env_cpu(env);
+    RISCVCPU *cpu = RISCV_CPU(cs);
+    uint32_t ctr_en = ~0u;
+
+    if (!cpu->cfg.ext_counters) {
+        /* The Counters extensions is not enabled */
+        return -1;
+    }
+
     /*
-     * The counters are always enabled on newer priv specs, as the CSR has
-     * changed from controlling that the counters can be read to controlling
-     * that the counters increment.
+     * The counters are always enabled at run time on newer priv specs, as the
+     * CSR has changed from controlling that the counters can be read to
+     * controlling that the counters increment.
      */
     if (env->priv_ver > PRIV_VERSION_1_09_1) {
         return 0;
     }
 
-    uint32_t ctr_en = ~0u;
-
     if (env->priv < PRV_M) {
         ctr_en &= env->mcounteren;
     }
-- 
2.21.0



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

* [Qemu-riscv] [PULL 20/34] target/riscv: Add support for disabling/enabling Counters
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Alistair Francis, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add support for disabling/enabling the "Counters" extension.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c |  1 +
 target/riscv/cpu.h |  1 +
 target/riscv/csr.c | 17 ++++++++++++-----
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 6a54ebf10c62..be90fa7d0808 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -440,6 +440,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("c", RISCVCPU, cfg.ext_c, true),
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
+    DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 0855277b92d4..4d4e0f89e206 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -222,6 +222,7 @@ typedef struct RISCVCPU {
         bool ext_c;
         bool ext_s;
         bool ext_u;
+        bool ext_counters;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 448162e484a3..de67741f3648 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -56,17 +56,24 @@ static int fs(CPURISCVState *env, int csrno)
 static int ctr(CPURISCVState *env, int csrno)
 {
 #if !defined(CONFIG_USER_ONLY)
+    CPUState *cs = env_cpu(env);
+    RISCVCPU *cpu = RISCV_CPU(cs);
+    uint32_t ctr_en = ~0u;
+
+    if (!cpu->cfg.ext_counters) {
+        /* The Counters extensions is not enabled */
+        return -1;
+    }
+
     /*
-     * The counters are always enabled on newer priv specs, as the CSR has
-     * changed from controlling that the counters can be read to controlling
-     * that the counters increment.
+     * The counters are always enabled at run time on newer priv specs, as the
+     * CSR has changed from controlling that the counters can be read to
+     * controlling that the counters increment.
      */
     if (env->priv_ver > PRIV_VERSION_1_09_1) {
         return 0;
     }
 
-    uint32_t ctr_en = ~0u;
-
     if (env->priv < PRV_M) {
         ctr_en &= env->mcounteren;
     }
-- 
2.21.0



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

* [Qemu-devel] [PULL 21/34] RISC-V: Add support for the Zifencei extension
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

fence.i has been split out of the base ISA as part of the ratification
process.  This patch adds a Zifencei argument, which disables the
fence.i instruction.

Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.c                      | 1 +
 target/riscv/cpu.h                      | 1 +
 target/riscv/insn_trans/trans_rvi.inc.c | 4 ++++
 target/riscv/translate.c                | 3 +++
 4 files changed, 9 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index be90fa7d0808..bbad39a337b3 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -441,6 +441,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
+    DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 4d4e0f89e206..ba551cd3082c 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -223,6 +223,7 @@ typedef struct RISCVCPU {
         bool ext_s;
         bool ext_u;
         bool ext_counters;
+        bool ext_ifencei;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/insn_trans/trans_rvi.inc.c b/target/riscv/insn_trans/trans_rvi.inc.c
index 6cda078ed6ba..ea6473111ce8 100644
--- a/target/riscv/insn_trans/trans_rvi.inc.c
+++ b/target/riscv/insn_trans/trans_rvi.inc.c
@@ -484,6 +484,10 @@ static bool trans_fence(DisasContext *ctx, arg_fence *a)
 
 static bool trans_fence_i(DisasContext *ctx, arg_fence_i *a)
 {
+    if (!ctx->ext_ifencei) {
+        return false;
+    }
+
     /*
      * FENCE_I is a no-op in QEMU,
      * however we need to end the translation block
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 313c27b70073..8d6ab732588d 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -54,6 +54,7 @@ typedef struct DisasContext {
        to any system register, which includes CSR_FRM, so we do not have
        to reset this known value.  */
     int frm;
+    bool ext_ifencei;
 } DisasContext;
 
 #ifdef TARGET_RISCV64
@@ -752,6 +753,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
     CPURISCVState *env = cs->env_ptr;
+    RISCVCPU *cpu = RISCV_CPU(cs);
 
     ctx->pc_succ_insn = ctx->base.pc_first;
     ctx->mem_idx = ctx->base.tb->flags & TB_FLAGS_MMU_MASK;
@@ -759,6 +761,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     ctx->priv_ver = env->priv_ver;
     ctx->misa = env->misa;
     ctx->frm = -1;  /* unknown rounding mode */
+    ctx->ext_ifencei = cpu->cfg.ext_ifencei;
 }
 
 static void riscv_tr_tb_start(DisasContextBase *db, CPUState *cpu)
-- 
2.21.0



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

* [Qemu-riscv] [PULL 21/34] RISC-V: Add support for the Zifencei extension
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Palmer Dabbelt, Alistair Francis

fence.i has been split out of the base ISA as part of the ratification
process.  This patch adds a Zifencei argument, which disables the
fence.i instruction.

Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.c                      | 1 +
 target/riscv/cpu.h                      | 1 +
 target/riscv/insn_trans/trans_rvi.inc.c | 4 ++++
 target/riscv/translate.c                | 3 +++
 4 files changed, 9 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index be90fa7d0808..bbad39a337b3 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -441,6 +441,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true),
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
+    DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 4d4e0f89e206..ba551cd3082c 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -223,6 +223,7 @@ typedef struct RISCVCPU {
         bool ext_s;
         bool ext_u;
         bool ext_counters;
+        bool ext_ifencei;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/insn_trans/trans_rvi.inc.c b/target/riscv/insn_trans/trans_rvi.inc.c
index 6cda078ed6ba..ea6473111ce8 100644
--- a/target/riscv/insn_trans/trans_rvi.inc.c
+++ b/target/riscv/insn_trans/trans_rvi.inc.c
@@ -484,6 +484,10 @@ static bool trans_fence(DisasContext *ctx, arg_fence *a)
 
 static bool trans_fence_i(DisasContext *ctx, arg_fence_i *a)
 {
+    if (!ctx->ext_ifencei) {
+        return false;
+    }
+
     /*
      * FENCE_I is a no-op in QEMU,
      * however we need to end the translation block
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 313c27b70073..8d6ab732588d 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -54,6 +54,7 @@ typedef struct DisasContext {
        to any system register, which includes CSR_FRM, so we do not have
        to reset this known value.  */
     int frm;
+    bool ext_ifencei;
 } DisasContext;
 
 #ifdef TARGET_RISCV64
@@ -752,6 +753,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
     CPURISCVState *env = cs->env_ptr;
+    RISCVCPU *cpu = RISCV_CPU(cs);
 
     ctx->pc_succ_insn = ctx->base.pc_first;
     ctx->mem_idx = ctx->base.tb->flags & TB_FLAGS_MMU_MASK;
@@ -759,6 +761,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     ctx->priv_ver = env->priv_ver;
     ctx->misa = env->misa;
     ctx->frm = -1;  /* unknown rounding mode */
+    ctx->ext_ifencei = cpu->cfg.ext_ifencei;
 }
 
 static void riscv_tr_tb_start(DisasContextBase *db, CPUState *cpu)
-- 
2.21.0



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

* [Qemu-devel] [PULL 22/34] RISC-V: Add support for the Zicsr extension
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:19   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

The various CSR instructions have been split out of the base ISA as part
of the ratification process.  This patch adds a Zicsr argument, which
disables all the CSR instructions.

Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.c | 1 +
 target/riscv/cpu.h | 1 +
 target/riscv/csr.c | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index bbad39a337b3..915b9e77df33 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -442,6 +442,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
     DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true),
+    DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index ba551cd3082c..0adb307f3298 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -224,6 +224,7 @@ typedef struct RISCVCPU {
         bool ext_u;
         bool ext_counters;
         bool ext_ifencei;
+        bool ext_icsr;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index de67741f3648..e0d45867607a 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -793,6 +793,7 @@ int riscv_csrrw(CPURISCVState *env, int csrno, target_ulong *ret_value,
 {
     int ret;
     target_ulong old_value;
+    RISCVCPU *cpu = env_archcpu(env);
 
     /* check privileges and return -1 if check fails */
 #if !defined(CONFIG_USER_ONLY)
@@ -803,6 +804,11 @@ int riscv_csrrw(CPURISCVState *env, int csrno, target_ulong *ret_value,
     }
 #endif
 
+    /* ensure the CSR extension is enabled. */
+    if (!cpu->cfg.ext_icsr) {
+        return -1;
+    }
+
     /* check predicate */
     if (!csr_ops[csrno].predicate || csr_ops[csrno].predicate(env, csrno) < 0) {
         return -1;
-- 
2.21.0



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

* [Qemu-riscv] [PULL 22/34] RISC-V: Add support for the Zicsr extension
@ 2019-06-27 15:19   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-riscv, qemu-devel, Palmer Dabbelt, Alistair Francis

The various CSR instructions have been split out of the base ISA as part
of the ratification process.  This patch adds a Zicsr argument, which
disables all the CSR instructions.

Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.c | 1 +
 target/riscv/cpu.h | 1 +
 target/riscv/csr.c | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index bbad39a337b3..915b9e77df33 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -442,6 +442,7 @@ static Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true),
     DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true),
     DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true),
+    DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true),
     DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec),
     DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true),
     DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index ba551cd3082c..0adb307f3298 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -224,6 +224,7 @@ typedef struct RISCVCPU {
         bool ext_u;
         bool ext_counters;
         bool ext_ifencei;
+        bool ext_icsr;
 
         char *priv_spec;
         char *user_spec;
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index de67741f3648..e0d45867607a 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -793,6 +793,7 @@ int riscv_csrrw(CPURISCVState *env, int csrno, target_ulong *ret_value,
 {
     int ret;
     target_ulong old_value;
+    RISCVCPU *cpu = env_archcpu(env);
 
     /* check privileges and return -1 if check fails */
 #if !defined(CONFIG_USER_ONLY)
@@ -803,6 +804,11 @@ int riscv_csrrw(CPURISCVState *env, int csrno, target_ulong *ret_value,
     }
 #endif
 
+    /* ensure the CSR extension is enabled. */
+    if (!cpu->cfg.ext_icsr) {
+        return -1;
+    }
+
     /* check predicate */
     if (!csr_ops[csrno].predicate || csr_ops[csrno].predicate(env, csrno) < 0) {
         return -1;
-- 
2.21.0



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

* [Qemu-devel] [PULL 23/34] RISC-V: Clear load reservations on context switch and SC
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Richard Henderson, Joel Sing, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Joel Sing <joel@sing.id.au>

This prevents a load reservation from being placed in one context/process,
then being used in another, resulting in an SC succeeding incorrectly and
breaking atomics.

Signed-off-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c                      |  1 +
 target/riscv/cpu_helper.c               | 10 ++++++++++
 target/riscv/insn_trans/trans_rva.inc.c |  8 +++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 915b9e77df33..f8d07bd20ad7 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -297,6 +297,7 @@ static void riscv_cpu_reset(CPUState *cs)
     env->pc = env->resetvec;
 #endif
     cs->exception_index = EXCP_NONE;
+    env->load_res = -1;
     set_default_nan_mode(1, &env->fp_status);
 }
 
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index e1b079e69c60..e32b6126af05 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -132,6 +132,16 @@ void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv)
     }
     /* tlb_flush is unnecessary as mode is contained in mmu_idx */
     env->priv = newpriv;
+
+    /*
+     * Clear the load reservation - otherwise a reservation placed in one
+     * context/process can be used by another, resulting in an SC succeeding
+     * incorrectly. Version 2.2 of the ISA specification explicitly requires
+     * this behaviour, while later revisions say that the kernel "should" use
+     * an SC instruction to force the yielding of a load reservation on a
+     * preemptive context switch. As a result, do both.
+     */
+    env->load_res = -1;
 }
 
 /* get_physical_address - get the physical address for this virtual address
diff --git a/target/riscv/insn_trans/trans_rva.inc.c b/target/riscv/insn_trans/trans_rva.inc.c
index f6dbbc065e15..fadd88849e2b 100644
--- a/target/riscv/insn_trans/trans_rva.inc.c
+++ b/target/riscv/insn_trans/trans_rva.inc.c
@@ -61,7 +61,7 @@ static inline bool gen_sc(DisasContext *ctx, arg_atomic *a, TCGMemOp mop)
 
     gen_set_label(l1);
     /*
-     * Address comparion failure.  However, we still need to
+     * Address comparison failure.  However, we still need to
      * provide the memory barrier implied by AQ/RL.
      */
     tcg_gen_mb(TCG_MO_ALL + a->aq * TCG_BAR_LDAQ + a->rl * TCG_BAR_STRL);
@@ -69,6 +69,12 @@ static inline bool gen_sc(DisasContext *ctx, arg_atomic *a, TCGMemOp mop)
     gen_set_gpr(a->rd, dat);
 
     gen_set_label(l2);
+    /*
+     * Clear the load reservation, since an SC must fail if there is
+     * an SC to any address, in between an LR and SC pair.
+     */
+    tcg_gen_movi_tl(load_res, -1);
+
     tcg_temp_free(dat);
     tcg_temp_free(src1);
     tcg_temp_free(src2);
-- 
2.21.0



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

* [Qemu-riscv] [PULL 23/34] RISC-V: Clear load reservations on context switch and SC
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Joel Sing, Palmer Dabbelt, Richard Henderson

From: Joel Sing <joel@sing.id.au>

This prevents a load reservation from being placed in one context/process,
then being used in another, resulting in an SC succeeding incorrectly and
breaking atomics.

Signed-off-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 target/riscv/cpu.c                      |  1 +
 target/riscv/cpu_helper.c               | 10 ++++++++++
 target/riscv/insn_trans/trans_rva.inc.c |  8 +++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 915b9e77df33..f8d07bd20ad7 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -297,6 +297,7 @@ static void riscv_cpu_reset(CPUState *cs)
     env->pc = env->resetvec;
 #endif
     cs->exception_index = EXCP_NONE;
+    env->load_res = -1;
     set_default_nan_mode(1, &env->fp_status);
 }
 
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index e1b079e69c60..e32b6126af05 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -132,6 +132,16 @@ void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv)
     }
     /* tlb_flush is unnecessary as mode is contained in mmu_idx */
     env->priv = newpriv;
+
+    /*
+     * Clear the load reservation - otherwise a reservation placed in one
+     * context/process can be used by another, resulting in an SC succeeding
+     * incorrectly. Version 2.2 of the ISA specification explicitly requires
+     * this behaviour, while later revisions say that the kernel "should" use
+     * an SC instruction to force the yielding of a load reservation on a
+     * preemptive context switch. As a result, do both.
+     */
+    env->load_res = -1;
 }
 
 /* get_physical_address - get the physical address for this virtual address
diff --git a/target/riscv/insn_trans/trans_rva.inc.c b/target/riscv/insn_trans/trans_rva.inc.c
index f6dbbc065e15..fadd88849e2b 100644
--- a/target/riscv/insn_trans/trans_rva.inc.c
+++ b/target/riscv/insn_trans/trans_rva.inc.c
@@ -61,7 +61,7 @@ static inline bool gen_sc(DisasContext *ctx, arg_atomic *a, TCGMemOp mop)
 
     gen_set_label(l1);
     /*
-     * Address comparion failure.  However, we still need to
+     * Address comparison failure.  However, we still need to
      * provide the memory barrier implied by AQ/RL.
      */
     tcg_gen_mb(TCG_MO_ALL + a->aq * TCG_BAR_LDAQ + a->rl * TCG_BAR_STRL);
@@ -69,6 +69,12 @@ static inline bool gen_sc(DisasContext *ctx, arg_atomic *a, TCGMemOp mop)
     gen_set_gpr(a->rd, dat);
 
     gen_set_label(l2);
+    /*
+     * Clear the load reservation, since an SC must fail if there is
+     * an SC to any address, in between an LR and SC pair.
+     */
+    tcg_gen_movi_tl(load_res, -1);
+
     tcg_temp_free(dat);
     tcg_temp_free(src1);
     tcg_temp_free(src2);
-- 
2.21.0



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

* [Qemu-devel] [PULL 24/34] RISC-V: Update syscall list for 32-bit support.
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Laurent Vivier, Palmer Dabbelt, qemu-riscv, qemu-devel, Jim Wilson

From: Jim Wilson <jimw@sifive.com>

32-bit RISC-V uses _llseek instead of lseek as syscall number 62.
Update syscall list from open-embedded build, primarily because
32-bit RISC-V requires statx support.

Tested with cross gcc testsuite runs for rv32 and rv64, with the
pending statx patch also applied.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 linux-user/riscv/syscall_nr.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
index dab6509e3ade..5c8728220994 100644
--- a/linux-user/riscv/syscall_nr.h
+++ b/linux-user/riscv/syscall_nr.h
@@ -72,7 +72,11 @@
 #define TARGET_NR_pipe2 59
 #define TARGET_NR_quotactl 60
 #define TARGET_NR_getdents64 61
+#ifdef TARGET_RISCV32
+#define TARGET_NR__llseek 62
+#else
 #define TARGET_NR_lseek 62
+#endif
 #define TARGET_NR_read 63
 #define TARGET_NR_write 64
 #define TARGET_NR_readv 65
@@ -286,7 +290,16 @@
 #define TARGET_NR_membarrier 283
 #define TARGET_NR_mlock2 284
 #define TARGET_NR_copy_file_range 285
+#define TARGET_NR_preadv2 286
+#define TARGET_NR_pwritev2 287
+#define TARGET_NR_pkey_mprotect 288
+#define TARGET_NR_pkey_alloc 289
+#define TARGET_NR_pkey_free 290
+#define TARGET_NR_statx 291
+#define TARGET_NR_io_pgetevents 292
+#define TARGET_NR_rseq 293
+#define TARGET_NR_kexec_file_load 294
 
-#define TARGET_NR_syscalls (TARGET_NR_copy_file_range + 1)
+#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
 
 #endif
-- 
2.21.0



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

* [Qemu-riscv] [PULL 24/34] RISC-V: Update syscall list for 32-bit support.
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Jim Wilson, Laurent Vivier, Palmer Dabbelt

From: Jim Wilson <jimw@sifive.com>

32-bit RISC-V uses _llseek instead of lseek as syscall number 62.
Update syscall list from open-embedded build, primarily because
32-bit RISC-V requires statx support.

Tested with cross gcc testsuite runs for rv32 and rv64, with the
pending statx patch also applied.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 linux-user/riscv/syscall_nr.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
index dab6509e3ade..5c8728220994 100644
--- a/linux-user/riscv/syscall_nr.h
+++ b/linux-user/riscv/syscall_nr.h
@@ -72,7 +72,11 @@
 #define TARGET_NR_pipe2 59
 #define TARGET_NR_quotactl 60
 #define TARGET_NR_getdents64 61
+#ifdef TARGET_RISCV32
+#define TARGET_NR__llseek 62
+#else
 #define TARGET_NR_lseek 62
+#endif
 #define TARGET_NR_read 63
 #define TARGET_NR_write 64
 #define TARGET_NR_readv 65
@@ -286,7 +290,16 @@
 #define TARGET_NR_membarrier 283
 #define TARGET_NR_mlock2 284
 #define TARGET_NR_copy_file_range 285
+#define TARGET_NR_preadv2 286
+#define TARGET_NR_pwritev2 287
+#define TARGET_NR_pkey_mprotect 288
+#define TARGET_NR_pkey_alloc 289
+#define TARGET_NR_pkey_free 290
+#define TARGET_NR_statx 291
+#define TARGET_NR_io_pgetevents 292
+#define TARGET_NR_rseq 293
+#define TARGET_NR_kexec_file_load 294
 
-#define TARGET_NR_syscalls (TARGET_NR_copy_file_range + 1)
+#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
 
 #endif
-- 
2.21.0



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

* [Qemu-devel] [PULL 25/34] riscv: virt: Add cpu-topology DT node.
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Atish Patra, Alistair Francis, Palmer Dabbelt, qemu-riscv, qemu-devel

From: Atish Patra <atish.patra@wdc.com>

Currently, there is no cpu topology defined in RISC-V.
Define a device tree node that clearly describes the
entire topology. This saves the trouble of scanning individual
cache to figure out the topology.

Here is the linux kernel patch series that enables topology
for RISC-V.

http://lists.infradead.org/pipermail/linux-riscv/2019-June/005072.html

CPU topology after applying this patch in QEMU & above series in kernel

/ # cat /sys/devices/system/cpu/cpu2/topology/thread_siblings_list
2
/ # cat /sys/devices/system/cpu/cpu2/topology/physical_package_id
0
/ # cat /sys/devices/system/cpu/cpu2/topology/core_siblings_list
0-7

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/virt.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 487f61404b21..28d96daf8c5b 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -191,6 +191,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
 
     for (cpu = s->soc.num_harts - 1; cpu >= 0; cpu--) {
         int cpu_phandle = phandle++;
+        int intc_phandle;
         nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
         char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
         char *isa = riscv_isa_string(&s->soc.harts[cpu]);
@@ -203,9 +204,12 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
         qemu_fdt_setprop_string(fdt, nodename, "status", "okay");
         qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
         qemu_fdt_setprop_string(fdt, nodename, "device_type", "cpu");
+        qemu_fdt_setprop_cell(fdt, nodename, "phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", cpu_phandle);
+        intc_phandle = phandle++;
         qemu_fdt_add_subnode(fdt, intc);
-        qemu_fdt_setprop_cell(fdt, intc, "phandle", cpu_phandle);
-        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "phandle", intc_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", intc_phandle);
         qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
         qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
         qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
@@ -214,6 +218,20 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
         g_free(nodename);
     }
 
+    /* Add cpu-topology node */
+    qemu_fdt_add_subnode(fdt, "/cpus/cpu-map");
+    qemu_fdt_add_subnode(fdt, "/cpus/cpu-map/cluster0");
+    for (cpu = s->soc.num_harts - 1; cpu >= 0; cpu--) {
+        char *core_nodename = g_strdup_printf("/cpus/cpu-map/cluster0/core%d",
+                                              cpu);
+        char *cpu_nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
+        uint32_t intc_phandle = qemu_fdt_get_phandle(fdt, cpu_nodename);
+        qemu_fdt_add_subnode(fdt, core_nodename);
+        qemu_fdt_setprop_cell(fdt, core_nodename, "cpu", intc_phandle);
+        g_free(core_nodename);
+        g_free(cpu_nodename);
+    }
+
     cells =  g_new0(uint32_t, s->soc.num_harts * 4);
     for (cpu = 0; cpu < s->soc.num_harts; cpu++) {
         nodename =
-- 
2.21.0



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

* [Qemu-riscv] [PULL 25/34] riscv: virt: Add cpu-topology DT node.
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Atish Patra, Alistair Francis, Palmer Dabbelt

From: Atish Patra <atish.patra@wdc.com>

Currently, there is no cpu topology defined in RISC-V.
Define a device tree node that clearly describes the
entire topology. This saves the trouble of scanning individual
cache to figure out the topology.

Here is the linux kernel patch series that enables topology
for RISC-V.

http://lists.infradead.org/pipermail/linux-riscv/2019-June/005072.html

CPU topology after applying this patch in QEMU & above series in kernel

/ # cat /sys/devices/system/cpu/cpu2/topology/thread_siblings_list
2
/ # cat /sys/devices/system/cpu/cpu2/topology/physical_package_id
0
/ # cat /sys/devices/system/cpu/cpu2/topology/core_siblings_list
0-7

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/virt.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 487f61404b21..28d96daf8c5b 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -191,6 +191,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
 
     for (cpu = s->soc.num_harts - 1; cpu >= 0; cpu--) {
         int cpu_phandle = phandle++;
+        int intc_phandle;
         nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
         char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
         char *isa = riscv_isa_string(&s->soc.harts[cpu]);
@@ -203,9 +204,12 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
         qemu_fdt_setprop_string(fdt, nodename, "status", "okay");
         qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
         qemu_fdt_setprop_string(fdt, nodename, "device_type", "cpu");
+        qemu_fdt_setprop_cell(fdt, nodename, "phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", cpu_phandle);
+        intc_phandle = phandle++;
         qemu_fdt_add_subnode(fdt, intc);
-        qemu_fdt_setprop_cell(fdt, intc, "phandle", cpu_phandle);
-        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "phandle", intc_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", intc_phandle);
         qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
         qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
         qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
@@ -214,6 +218,20 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
         g_free(nodename);
     }
 
+    /* Add cpu-topology node */
+    qemu_fdt_add_subnode(fdt, "/cpus/cpu-map");
+    qemu_fdt_add_subnode(fdt, "/cpus/cpu-map/cluster0");
+    for (cpu = s->soc.num_harts - 1; cpu >= 0; cpu--) {
+        char *core_nodename = g_strdup_printf("/cpus/cpu-map/cluster0/core%d",
+                                              cpu);
+        char *cpu_nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
+        uint32_t intc_phandle = qemu_fdt_get_phandle(fdt, cpu_nodename);
+        qemu_fdt_add_subnode(fdt, core_nodename);
+        qemu_fdt_setprop_cell(fdt, core_nodename, "cpu", intc_phandle);
+        g_free(core_nodename);
+        g_free(cpu_nodename);
+    }
+
     cells =  g_new0(uint32_t, s->soc.num_harts * 4);
     for (cpu = 0; cpu < s->soc.num_harts; cpu++) {
         nodename =
-- 
2.21.0



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

* [Qemu-devel] [PULL 26/34] disas/riscv: Disassemble reserved compressed encodings as illegal
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Michael Clark, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Michael Clark <mjc@sifive.com>

Due to the design of the disassembler, the immediate is not
known during decoding of the opcode; so to handle compressed
encodings with reserved immediate values (non-zero), we need
to add an additional check during decompression to match
reserved encodings with zero immediates and translate them
into the illegal instruction.

The following compressed opcodes have reserved encodings with
zero immediates: c.addi4spn, c.addi, c.lui, c.addi16sp, c.srli,
c.srai, c.andi and c.slli

Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Broke long lines]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 disas/riscv.c | 62 +++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 17 deletions(-)

diff --git a/disas/riscv.c b/disas/riscv.c
index 59a9b0437a5f..d37312705516 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -504,14 +504,19 @@ typedef struct {
     const rvc_constraint *constraints;
 } rv_comp_data;
 
+enum {
+    rvcd_imm_nz = 0x1
+};
+
 typedef struct {
     const char * const name;
     const rv_codec codec;
     const char * const format;
     const rv_comp_data *pseudo;
-    const int decomp_rv32;
-    const int decomp_rv64;
-    const int decomp_rv128;
+    const short decomp_rv32;
+    const short decomp_rv64;
+    const short decomp_rv128;
+    const short decomp_data;
 } rv_opcode_data;
 
 /* register names */
@@ -1011,7 +1016,8 @@ const rv_opcode_data opcode_data[] = {
     { "fcvt.q.lu", rv_codec_r_m, rv_fmt_rm_frd_rs1, NULL, 0, 0, 0 },
     { "fmv.x.q", rv_codec_r, rv_fmt_rd_frs1, NULL, 0, 0, 0 },
     { "fmv.q.x", rv_codec_r, rv_fmt_frd_rs1, NULL, 0, 0, 0 },
-    { "c.addi4spn", rv_codec_ciw_4spn, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
+    { "c.addi4spn", rv_codec_ciw_4spn, rv_fmt_rd_rs1_imm, NULL, rv_op_addi,
+      rv_op_addi, rv_op_addi, rvcd_imm_nz },
     { "c.fld", rv_codec_cl_ld, rv_fmt_frd_offset_rs1, NULL, rv_op_fld, rv_op_fld, 0 },
     { "c.lw", rv_codec_cl_lw, rv_fmt_rd_offset_rs1, NULL, rv_op_lw, rv_op_lw, rv_op_lw },
     { "c.flw", rv_codec_cl_lw, rv_fmt_frd_offset_rs1, NULL, rv_op_flw, 0, 0 },
@@ -1019,14 +1025,20 @@ const rv_opcode_data opcode_data[] = {
     { "c.sw", rv_codec_cs_sw, rv_fmt_rs2_offset_rs1, NULL, rv_op_sw, rv_op_sw, rv_op_sw },
     { "c.fsw", rv_codec_cs_sw, rv_fmt_frs2_offset_rs1, NULL, rv_op_fsw, 0, 0 },
     { "c.nop", rv_codec_ci_none, rv_fmt_none, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.addi", rv_codec_ci, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
+    { "c.addi", rv_codec_ci, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi,
+      rv_op_addi, rvcd_imm_nz },
     { "c.jal", rv_codec_cj_jal, rv_fmt_rd_offset, NULL, rv_op_jal, 0, 0 },
     { "c.li", rv_codec_ci_li, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.addi16sp", rv_codec_ci_16sp, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.lui", rv_codec_ci_lui, rv_fmt_rd_imm, NULL, rv_op_lui, rv_op_lui, rv_op_lui },
-    { "c.srli", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srli, rv_op_srli, rv_op_srli },
-    { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai, rv_op_srai, rv_op_srai },
-    { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi, rv_op_andi, rv_op_andi },
+    { "c.addi16sp", rv_codec_ci_16sp, rv_fmt_rd_rs1_imm, NULL, rv_op_addi,
+      rv_op_addi, rv_op_addi, rvcd_imm_nz },
+    { "c.lui", rv_codec_ci_lui, rv_fmt_rd_imm, NULL, rv_op_lui, rv_op_lui,
+      rv_op_lui, rvcd_imm_nz },
+    { "c.srli", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srli,
+      rv_op_srli, rv_op_srli, rvcd_imm_nz },
+    { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai,
+      rv_op_srai, rv_op_srai, rvcd_imm_nz },
+    { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi,
+      rv_op_andi, rv_op_andi, rvcd_imm_nz },
     { "c.sub", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_sub, rv_op_sub, rv_op_sub },
     { "c.xor", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_xor, rv_op_xor, rv_op_xor },
     { "c.or", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_or, rv_op_or, rv_op_or },
@@ -1036,7 +1048,8 @@ const rv_opcode_data opcode_data[] = {
     { "c.j", rv_codec_cj, rv_fmt_rd_offset, NULL, rv_op_jal, rv_op_jal, rv_op_jal },
     { "c.beqz", rv_codec_cb, rv_fmt_rs1_rs2_offset, NULL, rv_op_beq, rv_op_beq, rv_op_beq },
     { "c.bnez", rv_codec_cb, rv_fmt_rs1_rs2_offset, NULL, rv_op_bne, rv_op_bne, rv_op_bne },
-    { "c.slli", rv_codec_ci_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_slli, rv_op_slli, rv_op_slli },
+    { "c.slli", rv_codec_ci_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_slli,
+      rv_op_slli, rv_op_slli, rvcd_imm_nz },
     { "c.fldsp", rv_codec_ci_ldsp, rv_fmt_frd_offset_rs1, NULL, rv_op_fld, rv_op_fld, rv_op_fld },
     { "c.lwsp", rv_codec_ci_lwsp, rv_fmt_rd_offset_rs1, NULL, rv_op_lw, rv_op_lw, rv_op_lw },
     { "c.flwsp", rv_codec_ci_lwsp, rv_fmt_frd_offset_rs1, NULL, rv_op_flw, 0, 0 },
@@ -2795,8 +2808,13 @@ static void decode_inst_decompress_rv32(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv32;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
@@ -2804,8 +2822,13 @@ static void decode_inst_decompress_rv64(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv64;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
@@ -2813,8 +2836,13 @@ static void decode_inst_decompress_rv128(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv128;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
-- 
2.21.0



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

* [Qemu-riscv] [PULL 26/34] disas/riscv: Disassemble reserved compressed encodings as illegal
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Michael Clark, Alistair Francis, Palmer Dabbelt

From: Michael Clark <mjc@sifive.com>

Due to the design of the disassembler, the immediate is not
known during decoding of the opcode; so to handle compressed
encodings with reserved immediate values (non-zero), we need
to add an additional check during decompression to match
reserved encodings with zero immediates and translate them
into the illegal instruction.

The following compressed opcodes have reserved encodings with
zero immediates: c.addi4spn, c.addi, c.lui, c.addi16sp, c.srli,
c.srai, c.andi and c.slli

Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Broke long lines]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 disas/riscv.c | 62 +++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 17 deletions(-)

diff --git a/disas/riscv.c b/disas/riscv.c
index 59a9b0437a5f..d37312705516 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -504,14 +504,19 @@ typedef struct {
     const rvc_constraint *constraints;
 } rv_comp_data;
 
+enum {
+    rvcd_imm_nz = 0x1
+};
+
 typedef struct {
     const char * const name;
     const rv_codec codec;
     const char * const format;
     const rv_comp_data *pseudo;
-    const int decomp_rv32;
-    const int decomp_rv64;
-    const int decomp_rv128;
+    const short decomp_rv32;
+    const short decomp_rv64;
+    const short decomp_rv128;
+    const short decomp_data;
 } rv_opcode_data;
 
 /* register names */
@@ -1011,7 +1016,8 @@ const rv_opcode_data opcode_data[] = {
     { "fcvt.q.lu", rv_codec_r_m, rv_fmt_rm_frd_rs1, NULL, 0, 0, 0 },
     { "fmv.x.q", rv_codec_r, rv_fmt_rd_frs1, NULL, 0, 0, 0 },
     { "fmv.q.x", rv_codec_r, rv_fmt_frd_rs1, NULL, 0, 0, 0 },
-    { "c.addi4spn", rv_codec_ciw_4spn, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
+    { "c.addi4spn", rv_codec_ciw_4spn, rv_fmt_rd_rs1_imm, NULL, rv_op_addi,
+      rv_op_addi, rv_op_addi, rvcd_imm_nz },
     { "c.fld", rv_codec_cl_ld, rv_fmt_frd_offset_rs1, NULL, rv_op_fld, rv_op_fld, 0 },
     { "c.lw", rv_codec_cl_lw, rv_fmt_rd_offset_rs1, NULL, rv_op_lw, rv_op_lw, rv_op_lw },
     { "c.flw", rv_codec_cl_lw, rv_fmt_frd_offset_rs1, NULL, rv_op_flw, 0, 0 },
@@ -1019,14 +1025,20 @@ const rv_opcode_data opcode_data[] = {
     { "c.sw", rv_codec_cs_sw, rv_fmt_rs2_offset_rs1, NULL, rv_op_sw, rv_op_sw, rv_op_sw },
     { "c.fsw", rv_codec_cs_sw, rv_fmt_frs2_offset_rs1, NULL, rv_op_fsw, 0, 0 },
     { "c.nop", rv_codec_ci_none, rv_fmt_none, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.addi", rv_codec_ci, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
+    { "c.addi", rv_codec_ci, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi,
+      rv_op_addi, rvcd_imm_nz },
     { "c.jal", rv_codec_cj_jal, rv_fmt_rd_offset, NULL, rv_op_jal, 0, 0 },
     { "c.li", rv_codec_ci_li, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.addi16sp", rv_codec_ci_16sp, rv_fmt_rd_rs1_imm, NULL, rv_op_addi, rv_op_addi, rv_op_addi },
-    { "c.lui", rv_codec_ci_lui, rv_fmt_rd_imm, NULL, rv_op_lui, rv_op_lui, rv_op_lui },
-    { "c.srli", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srli, rv_op_srli, rv_op_srli },
-    { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai, rv_op_srai, rv_op_srai },
-    { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi, rv_op_andi, rv_op_andi },
+    { "c.addi16sp", rv_codec_ci_16sp, rv_fmt_rd_rs1_imm, NULL, rv_op_addi,
+      rv_op_addi, rv_op_addi, rvcd_imm_nz },
+    { "c.lui", rv_codec_ci_lui, rv_fmt_rd_imm, NULL, rv_op_lui, rv_op_lui,
+      rv_op_lui, rvcd_imm_nz },
+    { "c.srli", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srli,
+      rv_op_srli, rv_op_srli, rvcd_imm_nz },
+    { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai,
+      rv_op_srai, rv_op_srai, rvcd_imm_nz },
+    { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi,
+      rv_op_andi, rv_op_andi, rvcd_imm_nz },
     { "c.sub", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_sub, rv_op_sub, rv_op_sub },
     { "c.xor", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_xor, rv_op_xor, rv_op_xor },
     { "c.or", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_or, rv_op_or, rv_op_or },
@@ -1036,7 +1048,8 @@ const rv_opcode_data opcode_data[] = {
     { "c.j", rv_codec_cj, rv_fmt_rd_offset, NULL, rv_op_jal, rv_op_jal, rv_op_jal },
     { "c.beqz", rv_codec_cb, rv_fmt_rs1_rs2_offset, NULL, rv_op_beq, rv_op_beq, rv_op_beq },
     { "c.bnez", rv_codec_cb, rv_fmt_rs1_rs2_offset, NULL, rv_op_bne, rv_op_bne, rv_op_bne },
-    { "c.slli", rv_codec_ci_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_slli, rv_op_slli, rv_op_slli },
+    { "c.slli", rv_codec_ci_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_slli,
+      rv_op_slli, rv_op_slli, rvcd_imm_nz },
     { "c.fldsp", rv_codec_ci_ldsp, rv_fmt_frd_offset_rs1, NULL, rv_op_fld, rv_op_fld, rv_op_fld },
     { "c.lwsp", rv_codec_ci_lwsp, rv_fmt_rd_offset_rs1, NULL, rv_op_lw, rv_op_lw, rv_op_lw },
     { "c.flwsp", rv_codec_ci_lwsp, rv_fmt_frd_offset_rs1, NULL, rv_op_flw, 0, 0 },
@@ -2795,8 +2808,13 @@ static void decode_inst_decompress_rv32(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv32;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
@@ -2804,8 +2822,13 @@ static void decode_inst_decompress_rv64(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv64;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
@@ -2813,8 +2836,13 @@ static void decode_inst_decompress_rv128(rv_decode *dec)
 {
     int decomp_op = opcode_data[dec->op].decomp_rv128;
     if (decomp_op != rv_op_illegal) {
-        dec->op = decomp_op;
-        dec->codec = opcode_data[decomp_op].codec;
+        if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz)
+            && dec->imm == 0) {
+            dec->op = rv_op_illegal;
+        } else {
+            dec->op = decomp_op;
+            dec->codec = opcode_data[decomp_op].codec;
+        }
     }
 }
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 27/34] disas/riscv: Fix `rdinstreth` constraint
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Wladimir J. van der Laan, Palmer Dabbelt, qemu-devel,
	Michael Clark, Alistair Francis, qemu-riscv

From: "Wladimir J. van der Laan" <laanwj@gmail.com>

The constraint for `rdinstreth` was comparing the csr number to 0xc80,
which is `cycleh` instead. Fix this.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 disas/riscv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/disas/riscv.c b/disas/riscv.c
index d37312705516..278d9be9247e 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -614,7 +614,8 @@ static const rvc_constraint rvcc_rdtime[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc01, r
 static const rvc_constraint rvcc_rdinstret[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc02, rvc_end };
 static const rvc_constraint rvcc_rdcycleh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end };
 static const rvc_constraint rvcc_rdtimeh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc81, rvc_end };
-static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end };
+static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0,
+                                                  rvc_csr_eq_0xc82, rvc_end };
 static const rvc_constraint rvcc_frcsr[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x003, rvc_end };
 static const rvc_constraint rvcc_frrm[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x002, rvc_end };
 static const rvc_constraint rvcc_frflags[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x001, rvc_end };
@@ -1038,7 +1039,7 @@ const rv_opcode_data opcode_data[] = {
     { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai,
       rv_op_srai, rv_op_srai, rvcd_imm_nz },
     { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi,
-      rv_op_andi, rv_op_andi, rvcd_imm_nz },
+      rv_op_andi, rv_op_andi },
     { "c.sub", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_sub, rv_op_sub, rv_op_sub },
     { "c.xor", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_xor, rv_op_xor, rv_op_xor },
     { "c.or", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_or, rv_op_or, rv_op_or },
-- 
2.21.0



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

* [Qemu-riscv] [PULL 27/34] disas/riscv: Fix `rdinstreth` constraint
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Wladimir J. van der Laan, Michael Clark,
	Alistair Francis, Palmer Dabbelt

From: "Wladimir J. van der Laan" <laanwj@gmail.com>

The constraint for `rdinstreth` was comparing the csr number to 0xc80,
which is `cycleh` instead. Fix this.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 disas/riscv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/disas/riscv.c b/disas/riscv.c
index d37312705516..278d9be9247e 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -614,7 +614,8 @@ static const rvc_constraint rvcc_rdtime[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc01, r
 static const rvc_constraint rvcc_rdinstret[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc02, rvc_end };
 static const rvc_constraint rvcc_rdcycleh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end };
 static const rvc_constraint rvcc_rdtimeh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc81, rvc_end };
-static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end };
+static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0,
+                                                  rvc_csr_eq_0xc82, rvc_end };
 static const rvc_constraint rvcc_frcsr[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x003, rvc_end };
 static const rvc_constraint rvcc_frrm[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x002, rvc_end };
 static const rvc_constraint rvcc_frflags[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x001, rvc_end };
@@ -1038,7 +1039,7 @@ const rv_opcode_data opcode_data[] = {
     { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai,
       rv_op_srai, rv_op_srai, rvcd_imm_nz },
     { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi,
-      rv_op_andi, rv_op_andi, rvcd_imm_nz },
+      rv_op_andi, rv_op_andi },
     { "c.sub", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_sub, rv_op_sub, rv_op_sub },
     { "c.xor", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_xor, rv_op_xor, rv_op_xor },
     { "c.or", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_or, rv_op_or, rv_op_or },
-- 
2.21.0



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

* [Qemu-devel] [PULL 28/34] riscv: sifive_u: Do not create hard-coded phandles in DT
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

At present the cpu, plic and ethclk nodes' phandles are hard-coded
to 1/2/3 in DT. If we configure more than 1 cpu for the machine,
all cpu nodes' phandles conflict with each other as they are all 1.
Fix it by removing the hardcode.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_u.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 5ecc47cea35d..e2120ac7a5d3 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -86,7 +86,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     uint32_t *cells;
     char *nodename;
     char ethclk_names[] = "pclk\0hclk\0tx_clk";
-    uint32_t plic_phandle, ethclk_phandle;
+    uint32_t plic_phandle, ethclk_phandle, phandle = 1;
 
     fdt = s->fdt = create_device_tree(&s->fdt_size);
     if (!fdt) {
@@ -121,6 +121,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_cell(fdt, "/cpus", "#address-cells", 0x1);
 
     for (cpu = s->soc.cpus.num_harts - 1; cpu >= 0; cpu--) {
+        int cpu_phandle = phandle++;
         nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
         char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
         char *isa = riscv_isa_string(&s->soc.cpus.harts[cpu]);
@@ -134,8 +135,8 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
         qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
         qemu_fdt_setprop_string(fdt, nodename, "device_type", "cpu");
         qemu_fdt_add_subnode(fdt, intc);
-        qemu_fdt_setprop_cell(fdt, intc, "phandle", 1);
-        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", 1);
+        qemu_fdt_setprop_cell(fdt, intc, "phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", cpu_phandle);
         qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
         qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
         qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
@@ -167,6 +168,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     g_free(cells);
     g_free(nodename);
 
+    plic_phandle = phandle++;
     cells =  g_new0(uint32_t, s->soc.cpus.num_harts * 4);
     for (cpu = 0; cpu < s->soc.cpus.num_harts; cpu++) {
         nodename =
@@ -192,20 +194,21 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_string(fdt, nodename, "reg-names", "control");
     qemu_fdt_setprop_cell(fdt, nodename, "riscv,max-priority", 7);
     qemu_fdt_setprop_cell(fdt, nodename, "riscv,ndev", 0x35);
-    qemu_fdt_setprop_cells(fdt, nodename, "phandle", 2);
-    qemu_fdt_setprop_cells(fdt, nodename, "linux,phandle", 2);
+    qemu_fdt_setprop_cells(fdt, nodename, "phandle", plic_phandle);
+    qemu_fdt_setprop_cells(fdt, nodename, "linux,phandle", plic_phandle);
     plic_phandle = qemu_fdt_get_phandle(fdt, nodename);
     g_free(cells);
     g_free(nodename);
 
+    ethclk_phandle = phandle++;
     nodename = g_strdup_printf("/soc/ethclk");
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_string(fdt, nodename, "compatible", "fixed-clock");
     qemu_fdt_setprop_cell(fdt, nodename, "#clock-cells", 0x0);
     qemu_fdt_setprop_cell(fdt, nodename, "clock-frequency",
         SIFIVE_U_GEM_CLOCK_FREQ);
-    qemu_fdt_setprop_cell(fdt, nodename, "phandle", 3);
-    qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", 3);
+    qemu_fdt_setprop_cell(fdt, nodename, "phandle", ethclk_phandle);
+    qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", ethclk_phandle);
     ethclk_phandle = qemu_fdt_get_phandle(fdt, nodename);
     g_free(nodename);
 
-- 
2.21.0



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

* [Qemu-riscv] [PULL 28/34] riscv: sifive_u: Do not create hard-coded phandles in DT
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Bin Meng, Alistair Francis, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

At present the cpu, plic and ethclk nodes' phandles are hard-coded
to 1/2/3 in DT. If we configure more than 1 cpu for the machine,
all cpu nodes' phandles conflict with each other as they are all 1.
Fix it by removing the hardcode.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_u.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 5ecc47cea35d..e2120ac7a5d3 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -86,7 +86,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     uint32_t *cells;
     char *nodename;
     char ethclk_names[] = "pclk\0hclk\0tx_clk";
-    uint32_t plic_phandle, ethclk_phandle;
+    uint32_t plic_phandle, ethclk_phandle, phandle = 1;
 
     fdt = s->fdt = create_device_tree(&s->fdt_size);
     if (!fdt) {
@@ -121,6 +121,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_cell(fdt, "/cpus", "#address-cells", 0x1);
 
     for (cpu = s->soc.cpus.num_harts - 1; cpu >= 0; cpu--) {
+        int cpu_phandle = phandle++;
         nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
         char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
         char *isa = riscv_isa_string(&s->soc.cpus.harts[cpu]);
@@ -134,8 +135,8 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
         qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
         qemu_fdt_setprop_string(fdt, nodename, "device_type", "cpu");
         qemu_fdt_add_subnode(fdt, intc);
-        qemu_fdt_setprop_cell(fdt, intc, "phandle", 1);
-        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", 1);
+        qemu_fdt_setprop_cell(fdt, intc, "phandle", cpu_phandle);
+        qemu_fdt_setprop_cell(fdt, intc, "linux,phandle", cpu_phandle);
         qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
         qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
         qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
@@ -167,6 +168,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     g_free(cells);
     g_free(nodename);
 
+    plic_phandle = phandle++;
     cells =  g_new0(uint32_t, s->soc.cpus.num_harts * 4);
     for (cpu = 0; cpu < s->soc.cpus.num_harts; cpu++) {
         nodename =
@@ -192,20 +194,21 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_string(fdt, nodename, "reg-names", "control");
     qemu_fdt_setprop_cell(fdt, nodename, "riscv,max-priority", 7);
     qemu_fdt_setprop_cell(fdt, nodename, "riscv,ndev", 0x35);
-    qemu_fdt_setprop_cells(fdt, nodename, "phandle", 2);
-    qemu_fdt_setprop_cells(fdt, nodename, "linux,phandle", 2);
+    qemu_fdt_setprop_cells(fdt, nodename, "phandle", plic_phandle);
+    qemu_fdt_setprop_cells(fdt, nodename, "linux,phandle", plic_phandle);
     plic_phandle = qemu_fdt_get_phandle(fdt, nodename);
     g_free(cells);
     g_free(nodename);
 
+    ethclk_phandle = phandle++;
     nodename = g_strdup_printf("/soc/ethclk");
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_string(fdt, nodename, "compatible", "fixed-clock");
     qemu_fdt_setprop_cell(fdt, nodename, "#clock-cells", 0x0);
     qemu_fdt_setprop_cell(fdt, nodename, "clock-frequency",
         SIFIVE_U_GEM_CLOCK_FREQ);
-    qemu_fdt_setprop_cell(fdt, nodename, "phandle", 3);
-    qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", 3);
+    qemu_fdt_setprop_cell(fdt, nodename, "phandle", ethclk_phandle);
+    qemu_fdt_setprop_cell(fdt, nodename, "linux,phandle", ethclk_phandle);
     ethclk_phandle = qemu_fdt_get_phandle(fdt, nodename);
     g_free(nodename);
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 29/34] riscv: sifive_u: Update the plic hart config to support multicore
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

At present the PLIC is instantiated to support only one hart, while
the machine allows at most 4 harts to be created. When more than 1
hart is configured, PLIC needs to instantiated to support multicore,
otherwise an SMP OS does not work.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_u.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index e2120ac7a5d3..a416d5d08b4d 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -344,6 +344,8 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     qemu_irq plic_gpios[SIFIVE_U_PLIC_NUM_SOURCES];
+    char *plic_hart_config;
+    size_t plic_hart_config_len;
     int i;
     Error *err = NULL;
     NICInfo *nd = &nd_table[0];
@@ -357,9 +359,21 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
     memory_region_add_subregion(system_memory, memmap[SIFIVE_U_MROM].base,
                                 mask_rom);
 
+    /* create PLIC hart topology configuration string */
+    plic_hart_config_len = (strlen(SIFIVE_U_PLIC_HART_CONFIG) + 1) * smp_cpus;
+    plic_hart_config = g_malloc0(plic_hart_config_len);
+    for (i = 0; i < smp_cpus; i++) {
+        if (i != 0) {
+            strncat(plic_hart_config, ",", plic_hart_config_len);
+        }
+        strncat(plic_hart_config, SIFIVE_U_PLIC_HART_CONFIG,
+                plic_hart_config_len);
+        plic_hart_config_len -= (strlen(SIFIVE_U_PLIC_HART_CONFIG) + 1);
+    }
+
     /* MMIO */
     s->plic = sifive_plic_create(memmap[SIFIVE_U_PLIC].base,
-        (char *)SIFIVE_U_PLIC_HART_CONFIG,
+        plic_hart_config,
         SIFIVE_U_PLIC_NUM_SOURCES,
         SIFIVE_U_PLIC_NUM_PRIORITIES,
         SIFIVE_U_PLIC_PRIORITY_BASE,
-- 
2.21.0



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

* [Qemu-riscv] [PULL 29/34] riscv: sifive_u: Update the plic hart config to support multicore
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Bin Meng, Alistair Francis, Palmer Dabbelt

From: Bin Meng <bmeng.cn@gmail.com>

At present the PLIC is instantiated to support only one hart, while
the machine allows at most 4 harts to be created. When more than 1
hart is configured, PLIC needs to instantiated to support multicore,
otherwise an SMP OS does not work.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/sifive_u.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index e2120ac7a5d3..a416d5d08b4d 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -344,6 +344,8 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     qemu_irq plic_gpios[SIFIVE_U_PLIC_NUM_SOURCES];
+    char *plic_hart_config;
+    size_t plic_hart_config_len;
     int i;
     Error *err = NULL;
     NICInfo *nd = &nd_table[0];
@@ -357,9 +359,21 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
     memory_region_add_subregion(system_memory, memmap[SIFIVE_U_MROM].base,
                                 mask_rom);
 
+    /* create PLIC hart topology configuration string */
+    plic_hart_config_len = (strlen(SIFIVE_U_PLIC_HART_CONFIG) + 1) * smp_cpus;
+    plic_hart_config = g_malloc0(plic_hart_config_len);
+    for (i = 0; i < smp_cpus; i++) {
+        if (i != 0) {
+            strncat(plic_hart_config, ",", plic_hart_config_len);
+        }
+        strncat(plic_hart_config, SIFIVE_U_PLIC_HART_CONFIG,
+                plic_hart_config_len);
+        plic_hart_config_len -= (strlen(SIFIVE_U_PLIC_HART_CONFIG) + 1);
+    }
+
     /* MMIO */
     s->plic = sifive_plic_create(memmap[SIFIVE_U_PLIC].base,
-        (char *)SIFIVE_U_PLIC_HART_CONFIG,
+        plic_hart_config,
         SIFIVE_U_PLIC_NUM_SOURCES,
         SIFIVE_U_PLIC_NUM_PRIORITIES,
         SIFIVE_U_PLIC_PRIORITY_BASE,
-- 
2.21.0



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

* [Qemu-devel] [PULL 30/34] hw/riscv: Split out the boot functions
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Split the common RISC-V boot functions into a seperate file. This allows
us to share the common code.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/Makefile.objs  |  1 +
 hw/riscv/boot.c         | 69 +++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_e.c     | 17 ++--------
 hw/riscv/sifive_u.c     | 17 ++--------
 hw/riscv/spike.c        | 21 +++----------
 hw/riscv/virt.c         | 51 +++---------------------------
 include/hw/riscv/boot.h | 27 ++++++++++++++++
 7 files changed, 110 insertions(+), 93 deletions(-)
 create mode 100644 hw/riscv/boot.c
 create mode 100644 include/hw/riscv/boot.h

diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs
index a65027304a2c..eb9d4f9ffc9e 100644
--- a/hw/riscv/Makefile.objs
+++ b/hw/riscv/Makefile.objs
@@ -1,3 +1,4 @@
+obj-y += boot.o
 obj-$(CONFIG_SPIKE) += riscv_htif.o
 obj-$(CONFIG_HART) += riscv_hart.o
 obj-$(CONFIG_SIFIVE_E) += sifive_e.o
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
new file mode 100644
index 000000000000..0c8e72e455d7
--- /dev/null
+++ b/hw/riscv/boot.c
@@ -0,0 +1,69 @@
+/*
+ * QEMU RISC-V Boot Helper
+ *
+ * Copyright (c) 2017 SiFive, Inc.
+ * Copyright (c) 2019 Alistair Francis <alistair.francis@wdc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/error-report.h"
+#include "exec/cpu-defs.h"
+#include "hw/loader.h"
+#include "hw/riscv/boot.h"
+#include "elf.h"
+
+target_ulong riscv_load_kernel(const char *kernel_filename)
+{
+    uint64_t kernel_entry, kernel_high;
+
+    if (load_elf(kernel_filename, NULL, NULL, NULL,
+                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) < 0) {
+        error_report("could not load kernel '%s'", kernel_filename);
+        exit(1);
+    }
+
+    return kernel_entry;
+}
+
+hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
+                         uint64_t kernel_entry, hwaddr *start)
+{
+    int size;
+
+    /*
+     * We want to put the initrd far enough into RAM that when the
+     * kernel is uncompressed it will not clobber the initrd. However
+     * on boards without much RAM we must ensure that we still leave
+     * enough room for a decent sized initrd, and on boards with large
+     * amounts of RAM we must avoid the initrd being so far up in RAM
+     * that it is outside lowmem and inaccessible to the kernel.
+     * So for boards with less  than 256MB of RAM we put the initrd
+     * halfway into RAM, and for boards with 256MB of RAM or more we put
+     * the initrd at 128MB.
+     */
+    *start = kernel_entry + MIN(mem_size / 2, 128 * MiB);
+
+    size = load_ramdisk(filename, *start, mem_size - *start);
+    if (size == -1) {
+        size = load_image_targphys(filename, *start, mem_size - *start);
+        if (size == -1) {
+            error_report("could not load ramdisk '%s'", filename);
+            exit(1);
+        }
+    }
+
+    return *start + size;
+}
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index a5b4086da36d..d27f626529fe 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -44,10 +44,10 @@
 #include "hw/riscv/sifive_prci.h"
 #include "hw/riscv/sifive_uart.h"
 #include "hw/riscv/sifive_e.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 static const struct MemmapEntry {
     hwaddr base;
@@ -74,19 +74,6 @@ static const struct MemmapEntry {
     [SIFIVE_E_DTIM] =     { 0x80000000,     0x4000 }
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void sifive_mmio_emulate(MemoryRegion *parent, const char *name,
                              uintptr_t offset, uintptr_t length)
 {
@@ -131,7 +118,7 @@ static void riscv_sifive_e_init(MachineState *machine)
                           memmap[SIFIVE_E_MROM].base, &address_space_memory);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 }
 
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index a416d5d08b4d..f6b9c12e6094 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -41,11 +41,11 @@
 #include "hw/riscv/sifive_uart.h"
 #include "hw/riscv/sifive_prci.h"
 #include "hw/riscv/sifive_u.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -65,19 +65,6 @@ static const struct MemmapEntry {
 
 #define GEM_REVISION        0x10070109
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     uint64_t mem_size, const char *cmdline)
 {
@@ -283,7 +270,7 @@ static void riscv_sifive_u_init(MachineState *machine)
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 5b33d4be3bbc..e68be00a5fe8 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -36,12 +36,12 @@
 #include "hw/riscv/riscv_hart.h"
 #include "hw/riscv/sifive_clint.h"
 #include "hw/riscv/spike.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -54,19 +54,6 @@ static const struct MemmapEntry {
     [SPIKE_DRAM] =     { 0x80000000,        0x0 },
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf_ram_sym(kernel_filename, NULL, NULL, NULL,
-            &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0,
-            NULL, true, htif_symbol_callback) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void create_fdt(SpikeState *s, const struct MemmapEntry *memmap,
     uint64_t mem_size, const char *cmdline)
 {
@@ -199,7 +186,7 @@ static void spike_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
@@ -287,7 +274,7 @@ static void spike_v1_10_0_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
@@ -372,7 +359,7 @@ static void spike_v1_09_1_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 28d96daf8c5b..485aefa99523 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -34,13 +34,13 @@
 #include "hw/riscv/sifive_clint.h"
 #include "hw/riscv/sifive_test.h"
 #include "hw/riscv/virt.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "exec/address-spaces.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/gpex.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -61,47 +61,6 @@ static const struct MemmapEntry {
     [VIRT_PCIE_ECAM] =   { 0x30000000,    0x10000000 },
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
-static hwaddr load_initrd(const char *filename, uint64_t mem_size,
-                          uint64_t kernel_entry, hwaddr *start)
-{
-    int size;
-
-    /* We want to put the initrd far enough into RAM that when the
-     * kernel is uncompressed it will not clobber the initrd. However
-     * on boards without much RAM we must ensure that we still leave
-     * enough room for a decent sized initrd, and on boards with large
-     * amounts of RAM we must avoid the initrd being so far up in RAM
-     * that it is outside lowmem and inaccessible to the kernel.
-     * So for boards with less  than 256MB of RAM we put the initrd
-     * halfway into RAM, and for boards with 256MB of RAM or more we put
-     * the initrd at 128MB.
-     */
-    *start = kernel_entry + MIN(mem_size / 2, 128 * MiB);
-
-    size = load_ramdisk(filename, *start, mem_size - *start);
-    if (size == -1) {
-        size = load_image_targphys(filename, *start, mem_size - *start);
-        if (size == -1) {
-            error_report("could not load ramdisk '%s'", filename);
-            exit(1);
-        }
-    }
-    return *start + size;
-}
-
 static void create_pcie_irq_map(void *fdt, char *nodename,
                                 uint32_t plic_phandle)
 {
@@ -440,13 +399,13 @@ static void riscv_virt_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = load_kernel(machine->kernel_filename);
+        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
 
         if (machine->initrd_filename) {
             hwaddr start;
-            hwaddr end = load_initrd(machine->initrd_filename,
-                                     machine->ram_size, kernel_entry,
-                                     &start);
+            hwaddr end = riscv_load_initrd(machine->initrd_filename,
+                                           machine->ram_size, kernel_entry,
+                                           &start);
             qemu_fdt_setprop_cell(fdt, "/chosen",
                                   "linux,initrd-start", start);
             qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end",
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
new file mode 100644
index 000000000000..f84fd6c2df5e
--- /dev/null
+++ b/include/hw/riscv/boot.h
@@ -0,0 +1,27 @@
+/*
+ * QEMU RISC-V Boot Helper
+ *
+ * Copyright (c) 2017 SiFive, Inc.
+ * Copyright (c) 2019 Alistair Francis <alistair.francis@wdc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RISCV_BOOT_H
+#define RISCV_BOOT_H
+
+target_ulong riscv_load_kernel(const char *kernel_filename);
+hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
+                         uint64_t kernel_entry, hwaddr *start);
+
+#endif /* RISCV_BOOT_H */
-- 
2.21.0



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

* [Qemu-riscv] [PULL 30/34] hw/riscv: Split out the boot functions
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Bin Meng, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Split the common RISC-V boot functions into a seperate file. This allows
us to share the common code.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/Makefile.objs  |  1 +
 hw/riscv/boot.c         | 69 +++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_e.c     | 17 ++--------
 hw/riscv/sifive_u.c     | 17 ++--------
 hw/riscv/spike.c        | 21 +++----------
 hw/riscv/virt.c         | 51 +++---------------------------
 include/hw/riscv/boot.h | 27 ++++++++++++++++
 7 files changed, 110 insertions(+), 93 deletions(-)
 create mode 100644 hw/riscv/boot.c
 create mode 100644 include/hw/riscv/boot.h

diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs
index a65027304a2c..eb9d4f9ffc9e 100644
--- a/hw/riscv/Makefile.objs
+++ b/hw/riscv/Makefile.objs
@@ -1,3 +1,4 @@
+obj-y += boot.o
 obj-$(CONFIG_SPIKE) += riscv_htif.o
 obj-$(CONFIG_HART) += riscv_hart.o
 obj-$(CONFIG_SIFIVE_E) += sifive_e.o
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
new file mode 100644
index 000000000000..0c8e72e455d7
--- /dev/null
+++ b/hw/riscv/boot.c
@@ -0,0 +1,69 @@
+/*
+ * QEMU RISC-V Boot Helper
+ *
+ * Copyright (c) 2017 SiFive, Inc.
+ * Copyright (c) 2019 Alistair Francis <alistair.francis@wdc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/error-report.h"
+#include "exec/cpu-defs.h"
+#include "hw/loader.h"
+#include "hw/riscv/boot.h"
+#include "elf.h"
+
+target_ulong riscv_load_kernel(const char *kernel_filename)
+{
+    uint64_t kernel_entry, kernel_high;
+
+    if (load_elf(kernel_filename, NULL, NULL, NULL,
+                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) < 0) {
+        error_report("could not load kernel '%s'", kernel_filename);
+        exit(1);
+    }
+
+    return kernel_entry;
+}
+
+hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
+                         uint64_t kernel_entry, hwaddr *start)
+{
+    int size;
+
+    /*
+     * We want to put the initrd far enough into RAM that when the
+     * kernel is uncompressed it will not clobber the initrd. However
+     * on boards without much RAM we must ensure that we still leave
+     * enough room for a decent sized initrd, and on boards with large
+     * amounts of RAM we must avoid the initrd being so far up in RAM
+     * that it is outside lowmem and inaccessible to the kernel.
+     * So for boards with less  than 256MB of RAM we put the initrd
+     * halfway into RAM, and for boards with 256MB of RAM or more we put
+     * the initrd at 128MB.
+     */
+    *start = kernel_entry + MIN(mem_size / 2, 128 * MiB);
+
+    size = load_ramdisk(filename, *start, mem_size - *start);
+    if (size == -1) {
+        size = load_image_targphys(filename, *start, mem_size - *start);
+        if (size == -1) {
+            error_report("could not load ramdisk '%s'", filename);
+            exit(1);
+        }
+    }
+
+    return *start + size;
+}
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index a5b4086da36d..d27f626529fe 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -44,10 +44,10 @@
 #include "hw/riscv/sifive_prci.h"
 #include "hw/riscv/sifive_uart.h"
 #include "hw/riscv/sifive_e.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 static const struct MemmapEntry {
     hwaddr base;
@@ -74,19 +74,6 @@ static const struct MemmapEntry {
     [SIFIVE_E_DTIM] =     { 0x80000000,     0x4000 }
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void sifive_mmio_emulate(MemoryRegion *parent, const char *name,
                              uintptr_t offset, uintptr_t length)
 {
@@ -131,7 +118,7 @@ static void riscv_sifive_e_init(MachineState *machine)
                           memmap[SIFIVE_E_MROM].base, &address_space_memory);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 }
 
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index a416d5d08b4d..f6b9c12e6094 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -41,11 +41,11 @@
 #include "hw/riscv/sifive_uart.h"
 #include "hw/riscv/sifive_prci.h"
 #include "hw/riscv/sifive_u.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -65,19 +65,6 @@ static const struct MemmapEntry {
 
 #define GEM_REVISION        0x10070109
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     uint64_t mem_size, const char *cmdline)
 {
@@ -283,7 +270,7 @@ static void riscv_sifive_u_init(MachineState *machine)
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 5b33d4be3bbc..e68be00a5fe8 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -36,12 +36,12 @@
 #include "hw/riscv/riscv_hart.h"
 #include "hw/riscv/sifive_clint.h"
 #include "hw/riscv/spike.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 #include "exec/address-spaces.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -54,19 +54,6 @@ static const struct MemmapEntry {
     [SPIKE_DRAM] =     { 0x80000000,        0x0 },
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf_ram_sym(kernel_filename, NULL, NULL, NULL,
-            &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0,
-            NULL, true, htif_symbol_callback) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
 static void create_fdt(SpikeState *s, const struct MemmapEntry *memmap,
     uint64_t mem_size, const char *cmdline)
 {
@@ -199,7 +186,7 @@ static void spike_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
@@ -287,7 +274,7 @@ static void spike_v1_10_0_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
@@ -372,7 +359,7 @@ static void spike_v1_09_1_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        load_kernel(machine->kernel_filename);
+        riscv_load_kernel(machine->kernel_filename);
     }
 
     /* reset vector */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 28d96daf8c5b..485aefa99523 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -34,13 +34,13 @@
 #include "hw/riscv/sifive_clint.h"
 #include "hw/riscv/sifive_test.h"
 #include "hw/riscv/virt.h"
+#include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "exec/address-spaces.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/gpex.h"
-#include "elf.h"
 
 #include <libfdt.h>
 
@@ -61,47 +61,6 @@ static const struct MemmapEntry {
     [VIRT_PCIE_ECAM] =   { 0x30000000,    0x10000000 },
 };
 
-static target_ulong load_kernel(const char *kernel_filename)
-{
-    uint64_t kernel_entry, kernel_high;
-
-    if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high,
-                 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
-    }
-    return kernel_entry;
-}
-
-static hwaddr load_initrd(const char *filename, uint64_t mem_size,
-                          uint64_t kernel_entry, hwaddr *start)
-{
-    int size;
-
-    /* We want to put the initrd far enough into RAM that when the
-     * kernel is uncompressed it will not clobber the initrd. However
-     * on boards without much RAM we must ensure that we still leave
-     * enough room for a decent sized initrd, and on boards with large
-     * amounts of RAM we must avoid the initrd being so far up in RAM
-     * that it is outside lowmem and inaccessible to the kernel.
-     * So for boards with less  than 256MB of RAM we put the initrd
-     * halfway into RAM, and for boards with 256MB of RAM or more we put
-     * the initrd at 128MB.
-     */
-    *start = kernel_entry + MIN(mem_size / 2, 128 * MiB);
-
-    size = load_ramdisk(filename, *start, mem_size - *start);
-    if (size == -1) {
-        size = load_image_targphys(filename, *start, mem_size - *start);
-        if (size == -1) {
-            error_report("could not load ramdisk '%s'", filename);
-            exit(1);
-        }
-    }
-    return *start + size;
-}
-
 static void create_pcie_irq_map(void *fdt, char *nodename,
                                 uint32_t plic_phandle)
 {
@@ -440,13 +399,13 @@ static void riscv_virt_board_init(MachineState *machine)
                                 mask_rom);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = load_kernel(machine->kernel_filename);
+        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
 
         if (machine->initrd_filename) {
             hwaddr start;
-            hwaddr end = load_initrd(machine->initrd_filename,
-                                     machine->ram_size, kernel_entry,
-                                     &start);
+            hwaddr end = riscv_load_initrd(machine->initrd_filename,
+                                           machine->ram_size, kernel_entry,
+                                           &start);
             qemu_fdt_setprop_cell(fdt, "/chosen",
                                   "linux,initrd-start", start);
             qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end",
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
new file mode 100644
index 000000000000..f84fd6c2df5e
--- /dev/null
+++ b/include/hw/riscv/boot.h
@@ -0,0 +1,27 @@
+/*
+ * QEMU RISC-V Boot Helper
+ *
+ * Copyright (c) 2017 SiFive, Inc.
+ * Copyright (c) 2019 Alistair Francis <alistair.francis@wdc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RISCV_BOOT_H
+#define RISCV_BOOT_H
+
+target_ulong riscv_load_kernel(const char *kernel_filename);
+hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
+                         uint64_t kernel_entry, hwaddr *start);
+
+#endif /* RISCV_BOOT_H */
-- 
2.21.0



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

* [Qemu-devel] [PULL 31/34] hw/riscv: Add support for loading a firmware
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add support for loading a firmware file for the virt machine and the
SiFive U. This can be run with the following command:

    qemu-system-riscv64 -machine virt -bios fw_jump.bin -kernel vmlinux

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c         | 26 ++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  4 ++++
 hw/riscv/virt.c         |  4 ++++
 include/hw/riscv/boot.h |  2 ++
 4 files changed, 36 insertions(+)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 0c8e72e455d7..883df49a0c65 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -23,8 +23,34 @@
 #include "exec/cpu-defs.h"
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
+#include "hw/boards.h"
 #include "elf.h"
 
+#if defined(TARGET_RISCV32)
+# define KERNEL_BOOT_ADDRESS 0x80400000
+#else
+# define KERNEL_BOOT_ADDRESS 0x80200000
+#endif
+
+target_ulong riscv_load_firmware(const char *firmware_filename,
+                                 hwaddr firmware_load_addr)
+{
+    uint64_t firmware_entry, firmware_start, firmware_end;
+
+    if (load_elf(firmware_filename, NULL, NULL, NULL, &firmware_entry,
+                 &firmware_start, &firmware_end, 0, EM_RISCV, 1, 0) > 0) {
+        return firmware_entry;
+    }
+
+    if (load_image_targphys_as(firmware_filename, firmware_load_addr,
+                               ram_size, NULL) > 0) {
+        return firmware_load_addr;
+    }
+
+    error_report("could not load firmware '%s'", firmware_filename);
+    exit(1);
+}
+
 target_ulong riscv_load_kernel(const char *kernel_filename)
 {
     uint64_t kernel_entry, kernel_high;
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index f6b9c12e6094..420867155293 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -269,6 +269,10 @@ static void riscv_sifive_u_init(MachineState *machine)
     /* create device tree */
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
+    if (machine->firmware) {
+        riscv_load_firmware(machine->firmware, memmap[SIFIVE_U_DRAM].base);
+    }
+
     if (machine->kernel_filename) {
         riscv_load_kernel(machine->kernel_filename);
     }
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 485aefa99523..d8181a4ff18a 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -398,6 +398,10 @@ static void riscv_virt_board_init(MachineState *machine)
     memory_region_add_subregion(system_memory, memmap[VIRT_MROM].base,
                                 mask_rom);
 
+    if (machine->firmware) {
+        riscv_load_firmware(machine->firmware, memmap[VIRT_DRAM].base);
+    }
+
     if (machine->kernel_filename) {
         uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
 
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index f84fd6c2df5e..daa179b600f4 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -20,6 +20,8 @@
 #ifndef RISCV_BOOT_H
 #define RISCV_BOOT_H
 
+target_ulong riscv_load_firmware(const char *firmware_filename,
+                                 hwaddr firmware_load_addr);
 target_ulong riscv_load_kernel(const char *kernel_filename);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
-- 
2.21.0



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

* [Qemu-riscv] [PULL 31/34] hw/riscv: Add support for loading a firmware
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Bin Meng, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add support for loading a firmware file for the virt machine and the
SiFive U. This can be run with the following command:

    qemu-system-riscv64 -machine virt -bios fw_jump.bin -kernel vmlinux

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c         | 26 ++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  4 ++++
 hw/riscv/virt.c         |  4 ++++
 include/hw/riscv/boot.h |  2 ++
 4 files changed, 36 insertions(+)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 0c8e72e455d7..883df49a0c65 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -23,8 +23,34 @@
 #include "exec/cpu-defs.h"
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
+#include "hw/boards.h"
 #include "elf.h"
 
+#if defined(TARGET_RISCV32)
+# define KERNEL_BOOT_ADDRESS 0x80400000
+#else
+# define KERNEL_BOOT_ADDRESS 0x80200000
+#endif
+
+target_ulong riscv_load_firmware(const char *firmware_filename,
+                                 hwaddr firmware_load_addr)
+{
+    uint64_t firmware_entry, firmware_start, firmware_end;
+
+    if (load_elf(firmware_filename, NULL, NULL, NULL, &firmware_entry,
+                 &firmware_start, &firmware_end, 0, EM_RISCV, 1, 0) > 0) {
+        return firmware_entry;
+    }
+
+    if (load_image_targphys_as(firmware_filename, firmware_load_addr,
+                               ram_size, NULL) > 0) {
+        return firmware_load_addr;
+    }
+
+    error_report("could not load firmware '%s'", firmware_filename);
+    exit(1);
+}
+
 target_ulong riscv_load_kernel(const char *kernel_filename)
 {
     uint64_t kernel_entry, kernel_high;
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index f6b9c12e6094..420867155293 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -269,6 +269,10 @@ static void riscv_sifive_u_init(MachineState *machine)
     /* create device tree */
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
+    if (machine->firmware) {
+        riscv_load_firmware(machine->firmware, memmap[SIFIVE_U_DRAM].base);
+    }
+
     if (machine->kernel_filename) {
         riscv_load_kernel(machine->kernel_filename);
     }
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 485aefa99523..d8181a4ff18a 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -398,6 +398,10 @@ static void riscv_virt_board_init(MachineState *machine)
     memory_region_add_subregion(system_memory, memmap[VIRT_MROM].base,
                                 mask_rom);
 
+    if (machine->firmware) {
+        riscv_load_firmware(machine->firmware, memmap[VIRT_DRAM].base);
+    }
+
     if (machine->kernel_filename) {
         uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
 
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index f84fd6c2df5e..daa179b600f4 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -20,6 +20,8 @@
 #ifndef RISCV_BOOT_H
 #define RISCV_BOOT_H
 
+target_ulong riscv_load_firmware(const char *firmware_filename,
+                                 hwaddr firmware_load_addr);
 target_ulong riscv_load_kernel(const char *kernel_filename);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
-- 
2.21.0



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

* [Qemu-devel] [PULL 32/34] hw/riscv: Extend the kernel loading support
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Extend the RISC-V kernel loader to support Image and uImage files.
A Linux kernel can now be booted with:

    qemu-system-riscv64 -machine virt -bios fw_jump.bin -kernel Image

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 883df49a0c65..ff023f42d01d 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -56,12 +56,22 @@ target_ulong riscv_load_kernel(const char *kernel_filename)
     uint64_t kernel_entry, kernel_high;
 
     if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
+                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) > 0) {
+        return kernel_entry;
     }
 
-    return kernel_entry;
+    if (load_uimage_as(kernel_filename, &kernel_entry, NULL, NULL,
+                       NULL, NULL, NULL) > 0) {
+        return kernel_entry;
+    }
+
+    if (load_image_targphys_as(kernel_filename, KERNEL_BOOT_ADDRESS,
+                               ram_size, NULL) > 0) {
+        return KERNEL_BOOT_ADDRESS;
+    }
+
+    error_report("could not load kernel '%s'", kernel_filename);
+    exit(1);
 }
 
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
-- 
2.21.0



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

* [Qemu-riscv] [PULL 32/34] hw/riscv: Extend the kernel loading support
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Bin Meng, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Extend the RISC-V kernel loader to support Image and uImage files.
A Linux kernel can now be booted with:

    qemu-system-riscv64 -machine virt -bios fw_jump.bin -kernel Image

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 883df49a0c65..ff023f42d01d 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -56,12 +56,22 @@ target_ulong riscv_load_kernel(const char *kernel_filename)
     uint64_t kernel_entry, kernel_high;
 
     if (load_elf(kernel_filename, NULL, NULL, NULL,
-                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) < 0) {
-        error_report("could not load kernel '%s'", kernel_filename);
-        exit(1);
+                 &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0) > 0) {
+        return kernel_entry;
     }
 
-    return kernel_entry;
+    if (load_uimage_as(kernel_filename, &kernel_entry, NULL, NULL,
+                       NULL, NULL, NULL) > 0) {
+        return kernel_entry;
+    }
+
+    if (load_image_targphys_as(kernel_filename, KERNEL_BOOT_ADDRESS,
+                               ram_size, NULL) > 0) {
+        return KERNEL_BOOT_ADDRESS;
+    }
+
+    error_report("could not load kernel '%s'", kernel_filename);
+    exit(1);
 }
 
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
-- 
2.21.0



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

* [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add OpenSBI version 0.3 as a git submodule and as a prebult binary.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 .gitmodules                                  |   3 ++
 Makefile                                     |   5 +-
 pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904 bytes
 roms/Makefile                                |  48 ++++++++++++++-----
 roms/opensbi                                 |   1 +
 7 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
 create mode 160000 roms/opensbi

diff --git a/.gitmodules b/.gitmodules
index 2857eec76377..7a10e72e09cd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -55,3 +55,6 @@
 [submodule "slirp"]
 	path = slirp
 	url = https://git.qemu.org/git/libslirp.git
+[submodule "roms/opensbi"]
+	path = roms/opensbi
+	url = https://github.com/riscv/opensbi.git
diff --git a/Makefile b/Makefile
index cfb18f152544..c74e5ba91402 100644
--- a/Makefile
+++ b/Makefile
@@ -761,7 +761,10 @@ palcode-clipper \
 u-boot.e500 u-boot-sam460-20100605.bin \
 qemu_vga.ndrv \
 edk2-licenses.txt \
-hppa-firmware.img
+hppa-firmware.img \
+opensbi-riscv32-virt-fw_jump.bin \
+opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
+
 
 DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \
 60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json
diff --git a/pc-bios/opensbi-riscv32-virt-fw_jump.bin b/pc-bios/opensbi-riscv32-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..c3e2aaa5148930754d3f88dcc9c6efdb961774d8
GIT binary patch
literal 28848
zcmeHv4OkRMwrF+tboUG@3^p)eG>eRYvWY=PCF;iIZy3Pn8Wjm{)L=UhcGV<~#+bw`
zIP?sN{Fn}mcs1)!l<2#0v(D-yzH1Pa0Zk;v1W-2`BLXqIic$Gh;GLT85ionRd*A)u
zd*Amy;j2Df)m3$V>QwcqbE?NQKI%t4360QL5#m^DzYU;hW&5>(Eb?ZXW_R}K6g0Bu
z&}jV=I*LX*T7m3>0`Uq8*=Y)$s;pedvA4Y3wW7xjsYOzZ&h!<sZ-hQ>pF`$7F-TWP
zA#RB$p?mu#3i7l=PP|-*?0q*;m8Y(VLb^Y+p=Dm;S7yR~rwQ4cP7wB{uOKxM+eChm
z2~h`0qzyblY$3g=rX*9JhQ*Y(BEc~F#Dtv){y0cdskMJ}Z0}!9>Zou?lTE*j`cbnE
z*Jgh-|I(_Uo~TjaGJeUMBQzVKoZQ%Ex8_qb-?6hRC>?n_N@S55Lz9}EEcKXiLy}PI
z-|ZXosZv{6kv8xu(gxi|sX^LtyHQ$@He@%V4chTn-86J*!{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Fx60<(dSe*gdg

literal 0
HcmV?d00001

diff --git a/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin b/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..530d53f3c84632f2170fe0ea0b4a29019153de65
GIT binary patch
literal 28904
zcmeHvdw3L8w(qX0uCDHoN5>{<n4mUkk_ajj=|BXOA%X5DIG_Ut3};Y6<v|n>=md<)
zn55Hb8q9-fF<|rz1_9-qVU!3N@M3r+4LE|Jh&TttJP0^wqU4DrxxZaiotJa&9j@Q~
z=X@q#^{QR9_u9X`_G|66*Dm`#Q@<BylK_K@5WV2)DFyYogdS70Kt>96v)a4ODxOs2
z^Q4Jf9%JTsV&+w(!l@#niX#;~N6s8RJWnq)2lb10&wzL=r#9O^B^7z#^TS!<sEa4&
zB97>v3}noI_>P1JRv_fLR75JezavKi&BYusztlt)2YEhqFcmlINJZUIrlRgsTy@NA
z9&v%4a38Y76n&I=lO4&`&9rwL1d2Y2aoR@IP28#{eSh*BSI-Es>+g2m)M#8W_Isy(
zZ&)Lhx7qQGOT{hqs^~Lu&I>_?JUnOFrV7^vZpt4kgr%IB{b8y{AUaCzIyOe;*mzx*
zRQmObybau|rCW+k(Y3@B^8=OBFw=wOpo@l^9x5li4R2UEm94`RgL^4&?^V--zUKmG
zdZ?B)MYAeX468CTERo|2YP)WJv^|2vG?A^L8@DoKWN`T9$oiRA4cWk{b=Pw#CsbU9
zTV>X|+0uN}UH<gCldqVyZ?P5mqvG^h;C7CRV^hjg;xm$&yc|1uOxIe)5c?f$j45W0
z>P9$;_MF{AJU@&ho+IOk=we9)%Md-oHjUg$@0P6$z3Ld3rwVPMX>Nq;VnS<as?aO!
zWp#bv^*fq>)p6IY^2<BwcU|3meNXegmIECh-irU)+A#Cl>~H6MKd*H`=aXHvUtekX
z=Gu4P{_uTU>&?#YE;G-N8?;=yMMC+a+GKWByuH@0PT7%SO}&z;UcF<rb<LGEeoJ;O
znVIoThTrqMo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9)v^~)A
zGj&-OW|!2bMEk0zR;4CO<K^JzYgT1srXs$tA7rG^=9;k_BTq((k)~XpwTuo8m;>ma
z`0TP3$(b38m(oPP{QV+<UnKC01b&ggFB14g0{^2V@H@+_MC05HYsTtSW8(6qsmb;w
z@`CGMEak&WJcd%E66i-(7-hXR|8AN7QK4^7lf$1Wbfywdt<VSK<o8c2^aq93E9qa0
Sm*0P*&^-!0qP%~95dGibo|Df2

literal 0
HcmV?d00001

diff --git a/pc-bios/opensbi-riscv64-virt-fw_jump.bin b/pc-bios/opensbi-riscv64-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..e6c1986b72081ecf3607b2110628cf8214fa8f00
GIT binary patch
literal 28904
zcmeHvdwdjCw(hQ~uCDHoN5>{<n4pF<NrX`*(t!vllLWe(;J`3oz;Fg7sXT}R0-b<S
z(R4bUrhz0dEe0ld#2_$m&Nym>9Q0u1ku=~4q98JJP{@OTgC<IzNRs>Qs_ML)d+*`;
zyZ_v4@~d98tM*>|+iSnpUVH7b-539zIEMrnT!iQaS8o}p$0hU{V+1l<sGr@@V^Z;?
zvXCdu<nlNZ#}gB;B9%@R5mg+i<T-No$dLtlp(SWQy!!^lV>z|S_8F-x0H5zaC64+;
zVk+T?{)s@w^y0T9BCrx6&zB{nvgccJG|*Ja5z|Y}BrVAEnS-gkSx+kKk1>_?pW&)!
z{^$`G*$DRmON=qcnAh3ST>UItk3pd5qZy}lRQ=?gdeZ+Vzj5`B61)Fy)5XW&inaYR
z{yW23sk|+Yr(G&;nO8-hiSwQhG8EuB%QjcKHgePcP$?|qOzijZ9)aj6wdvScnPbxp
zSyEXyDhoDpuas>sHOABtW9;`-P9uyDRe&xTX?(bX@K(HG<y6*AV=V5ayuH_q5BZ)8
zoblm0))>R8jIpfB#IQt;FQ{$0g)z2B65C96hHlx(kkP>rm!leHT{GkXr`FxTrJq!B
z*>06d>t@ReQFnzi>QB9F(!Rk~7LG~KYk}K2CV@?_NKed8WeW0bWUj8Qnjy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Pq{YZp%UA
zu=PEV<J(qJ6ojl!mFd9rk^PZ@ZE(UIC0&+6Z4b)nZ80)URl=#hut|A7L7@{B8mmxv
z_tL-ANiwx5@oh?cn-brq#J4H&ZNB*OutRLhh-7<E24H(o29TrR$x-m+DExC2{y7T&
z9EE?5!uNk74_SDCx;on?uDO5ZvTRXieBX-PWy{7A;(wyIcP_3)xOU*Gz;z8*yjQ-)
zpOoA2+}U$!)%)u70pCsdeF>5v?*EM}kNf8-bfH2Ym+9@#dVAHlet)jF_gP#ttitsa
z?q}gz8AtMI%>P&E=l`4XWv@^=q3r?MF;}ExSeS98w|5$@hj2~6HR}$q`w>41S2(U;
z;2MrA5SIoQi|h8~-rjaxEx5kM)qv|uTwmZijcWzsEX9?E>-S20n&!WIEkK&NxG3(S
zW%=J>>qI`ZJ<#zpV|gxSmy9Px+v+D*XQWEw<<RGAS7+yBAil33WT(^Sn!N%ePj-4Z
zO}Qd>IUO1>2hcz9ndK`}bF$Nx(L_K0{Vai>CGfKZewM(`68KpH|4&Kacjnp2;R~{{
zSe%_IF3nzXr_=o-iZnEohAV*qq##_@TMO@%=^qrjXNDa9M4`V|;*C(~tOWV}3kp>w
Y%Heh;{l6>W+X_9d&~wWBcZbmb0Xhc<(f|Me

literal 0
HcmV?d00001

diff --git a/roms/Makefile b/roms/Makefile
index 078d3fb70563..562ed726fd6b 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
 powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
 powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
 x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
+riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
+riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
 
 # tag our seabios builds
 SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
@@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
 default:
 	@echo "nothing is build by default"
 	@echo "available build targets:"
-	@echo "  bios           -- update bios.bin (seabios)"
-	@echo "  vgabios        -- update vgabios binaries (seabios)"
-	@echo "  sgabios        -- update sgabios binaries"
-	@echo "  pxerom         -- update nic roms (bios only)"
-	@echo "  efirom         -- update nic roms (bios+efi)"
-	@echo "  slof           -- update slof.bin"
-	@echo "  skiboot        -- update skiboot.lid"
-	@echo "  u-boot.e500    -- update u-boot.e500"
-	@echo "  u-boot.sam460  -- update u-boot.sam460"
-	@echo "  efi            -- update UEFI (edk2) platform firmware"
-	@echo "  clean          -- delete the files generated by the previous" \
-	                          "build targets"
+	@echo "  bios               -- update bios.bin (seabios)"
+	@echo "  vgabios            -- update vgabios binaries (seabios)"
+	@echo "  sgabios            -- update sgabios binaries"
+	@echo "  pxerom             -- update nic roms (bios only)"
+	@echo "  efirom             -- update nic roms (bios+efi)"
+	@echo "  slof               -- update slof.bin"
+	@echo "  skiboot            -- update skiboot.lid"
+	@echo "  u-boot.e500        -- update u-boot.e500"
+	@echo "  u-boot.sam460      -- update u-boot.sam460"
+	@echo "  efi                -- update UEFI (edk2) platform firmware"
+	@echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
+	@echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
+	@echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
+	@echo "  clean              -- delete the files generated by the previous" \
+	                              "build targets"
 
 bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
 	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
@@ -162,6 +167,24 @@ skiboot:
 efi: edk2-basetools
 	$(MAKE) -f Makefile.edk2
 
+opensbi32-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv32_cross_prefix) \
+		PLATFORM="qemu/virt"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
+
+opensbi64-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv64_cross_prefix) \
+		PLATFORM="qemu/virt"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
+
+opensbi64-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv64_cross_prefix) \
+		PLATFORM="qemu/sifive_u"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
+
 clean:
 	rm -rf seabios/.config seabios/out seabios/builds
 	$(MAKE) -C sgabios clean
@@ -173,3 +196,4 @@ clean:
 	$(MAKE) -C u-boot-sam460ex distclean
 	$(MAKE) -C skiboot clean
 	$(MAKE) -f Makefile.edk2 clean
+	$(MAKE) -C opensbi clean
diff --git a/roms/opensbi b/roms/opensbi
new file mode 160000
index 000000000000..ca20ac0cd4c0
--- /dev/null
+++ b/roms/opensbi
@@ -0,0 +1 @@
+Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
-- 
2.21.0



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

* [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Bin Meng, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

Add OpenSBI version 0.3 as a git submodule and as a prebult binary.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 .gitmodules                                  |   3 ++
 Makefile                                     |   5 +-
 pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904 bytes
 roms/Makefile                                |  48 ++++++++++++++-----
 roms/opensbi                                 |   1 +
 7 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
 create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
 create mode 160000 roms/opensbi

diff --git a/.gitmodules b/.gitmodules
index 2857eec76377..7a10e72e09cd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -55,3 +55,6 @@
 [submodule "slirp"]
 	path = slirp
 	url = https://git.qemu.org/git/libslirp.git
+[submodule "roms/opensbi"]
+	path = roms/opensbi
+	url = https://github.com/riscv/opensbi.git
diff --git a/Makefile b/Makefile
index cfb18f152544..c74e5ba91402 100644
--- a/Makefile
+++ b/Makefile
@@ -761,7 +761,10 @@ palcode-clipper \
 u-boot.e500 u-boot-sam460-20100605.bin \
 qemu_vga.ndrv \
 edk2-licenses.txt \
-hppa-firmware.img
+hppa-firmware.img \
+opensbi-riscv32-virt-fw_jump.bin \
+opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
+
 
 DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \
 60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json
diff --git a/pc-bios/opensbi-riscv32-virt-fw_jump.bin b/pc-bios/opensbi-riscv32-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..c3e2aaa5148930754d3f88dcc9c6efdb961774d8
GIT binary patch
literal 28848
zcmeHv4OkRMwrF+tboUG@3^p)eG>eRYvWY=PCF;iIZy3Pn8Wjm{)L=UhcGV<~#+bw`
zIP?sN{Fn}mcs1)!l<2#0v(D-yzH1Pa0Zk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>=0Hk-6a(p3kfuTkhZF{B9Hhq~`9m5BX*eVj(l$u%LMnum
z3u*j+F>QqUZ$Wwu(kqaD2WdH^C6JznG!N3Vkm4alL7EO}GNg%+Fim(3Fs@t+E2D8K
zZ(6-{wK2^#=N~R#w>oo;anM}JT#nTua}`Xb%;kZ&<*KzSvF^hf#=pGsm9#aP%U0k9
z1W8ixr;z{XhyIv<^2h!+|CIla|3CsrjW6&=yfF_EZxO^}BS=@7Ka|b+4(15udh9BD
z0&dS;1AUOoh{vcI$NNE7pnM|KJrDOzc>Z^QQmaSTM-q4>fkzT}B!Nc~cqD=UA0+Uc
zes*%;!c5pe&Q9ZB%3OubsQ=2}Gje4mhJkWM22cB;tY7(}tRzTXI+XSJWRx`$%FaUm
oKsd^}2x-A2lywmDcLC0cfaj1lLw<#va95wFqbx8%TsFx60<(dSe*gdg

literal 0
HcmV?d00001

diff --git a/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin b/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..530d53f3c84632f2170fe0ea0b4a29019153de65
GIT binary patch
literal 28904
zcmeHvdw3L8w(qX0uCDHoN5>{<n4mUkk_ajj=|BXOA%X5DIG_Ut3};Y6<v|n>=md<)
zn55Hb8q9-fF<|rz1_9-qVU!3N@M3r+4LE|Jh&TttJP0^wqU4DrxxZaiotJa&9j@Q~
z=X@q#^{QR9_u9X`_G|66*Dm`#Q@<BylK_K@5WV2)DFyYogdS70Kt>96v)a4ODxOs2
z^Q4Jf9%JTsV&+w(!l@#niX#;~N6s8RJWnq)2lb10&wzL=r#9O^B^7z#^TS!<sEa4&
zB97>v3}noI_>P1JRv_fLR75JezavKi&BYusztlt)2YEhqFcmlINJZUIrlRgsTy@NA
z9&v%4a38Y76n&I=lO4&`&9rwL1d2Y2aoR@IP28#{eSh*BSI-Es>+g2m)M#8W_Isy(
zZ&)Lhx7qQGOT{hqs^~Lu&I>_?JUnOFrV7^vZpt4kg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A@;sDF0*H%aoBqw$notfC<;PWCCjvb
z`iQ>Bz&0>prjjmQq4o#l^!8|(CM)4&U)ZcXAE(gq3XM@H{C(+P@&uXMmH2igzFmoL
zSK`~1_;z1>dDtO#Wkj++AOo;JAOpx$@MJ1@G8O)r3ja)nf2P7eQ{nsH$U_z$psvcW
zi>vQju{1-J8Q-%!Yw6O_gxvJ@^h`P4(=!9tdR!&AKF2i{&*?SdgxroFoAns2dS9L1
z@4GSH6DJAczTe97xNnX^=PUFHnSS$WPfyF)o}QVX_4K6SqTwG9eggLo;(9Wc<j|P^
zQ|Yn)OZhUEE1l4OKkb;yQ!p(2>T*xdP+WnyG`Nhnd9jFp>#LrgHeAiPzQI+G>k_Un
zaGk~VH(WKi4&ge0>wR3ialM6WI?_+U^&qZsxM=*_x$Z-nNL&>6;IjPRu$@9)v^~)A
zGj&-OW|!2bMEk0zR;4CO<K^JzYgT1srXs$tA7rG^=9;k_BTq((k)~XpwTuo8m;>ma
z`0TP3$(b38m(oPP{QV+<UnKC01b&ggFB14g0{^2V@H@+_MC05HYsTtSW8(6qsmb;w
z@`CGMEak&WJcd%E66i-(7-hXR|8AN7QK4^7lf$1Wbfywdt<VSK<o8c2^aq93E9qa0
Sm*0P*&^-!0qP%~95dGibo|Df2

literal 0
HcmV?d00001

diff --git a/pc-bios/opensbi-riscv64-virt-fw_jump.bin b/pc-bios/opensbi-riscv64-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..e6c1986b72081ecf3607b2110628cf8214fa8f00
GIT binary patch
literal 28904
zcmeHvdwdjCw(hQ~uCDHoN5>{<n4pF<NrX`*(t!vllLWe(;J`3oz;Fg7sXT}R0-b<S
z(R4bUrhz0dEe0ld#2_$m&Nym>9Q0u1ku=~4q98JJP{@OTgC<IzNRs>Qs_ML)d+*`;
zyZ_v4@~d98tM*>|+iSnpUVH7b-539zIEMrnT!iQaS8o}p$0hU{V+1l<sGr@@V^Z;?
zvXCdu<nlNZ#}gB;B9%@R5mg+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WV}3kp>w
Y%Heh;{l6>W+X_9d&~wWBcZbmb0Xhc<(f|Me

literal 0
HcmV?d00001

diff --git a/roms/Makefile b/roms/Makefile
index 078d3fb70563..562ed726fd6b 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
 powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
 powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
 x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
+riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
+riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
 
 # tag our seabios builds
 SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
@@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
 default:
 	@echo "nothing is build by default"
 	@echo "available build targets:"
-	@echo "  bios           -- update bios.bin (seabios)"
-	@echo "  vgabios        -- update vgabios binaries (seabios)"
-	@echo "  sgabios        -- update sgabios binaries"
-	@echo "  pxerom         -- update nic roms (bios only)"
-	@echo "  efirom         -- update nic roms (bios+efi)"
-	@echo "  slof           -- update slof.bin"
-	@echo "  skiboot        -- update skiboot.lid"
-	@echo "  u-boot.e500    -- update u-boot.e500"
-	@echo "  u-boot.sam460  -- update u-boot.sam460"
-	@echo "  efi            -- update UEFI (edk2) platform firmware"
-	@echo "  clean          -- delete the files generated by the previous" \
-	                          "build targets"
+	@echo "  bios               -- update bios.bin (seabios)"
+	@echo "  vgabios            -- update vgabios binaries (seabios)"
+	@echo "  sgabios            -- update sgabios binaries"
+	@echo "  pxerom             -- update nic roms (bios only)"
+	@echo "  efirom             -- update nic roms (bios+efi)"
+	@echo "  slof               -- update slof.bin"
+	@echo "  skiboot            -- update skiboot.lid"
+	@echo "  u-boot.e500        -- update u-boot.e500"
+	@echo "  u-boot.sam460      -- update u-boot.sam460"
+	@echo "  efi                -- update UEFI (edk2) platform firmware"
+	@echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
+	@echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
+	@echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
+	@echo "  clean              -- delete the files generated by the previous" \
+	                              "build targets"
 
 bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
 	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
@@ -162,6 +167,24 @@ skiboot:
 efi: edk2-basetools
 	$(MAKE) -f Makefile.edk2
 
+opensbi32-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv32_cross_prefix) \
+		PLATFORM="qemu/virt"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
+
+opensbi64-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv64_cross_prefix) \
+		PLATFORM="qemu/virt"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
+
+opensbi64-virt:
+	$(MAKE) -C opensbi \
+		CROSS_COMPILE=$(riscv64_cross_prefix) \
+		PLATFORM="qemu/sifive_u"
+	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
+
 clean:
 	rm -rf seabios/.config seabios/out seabios/builds
 	$(MAKE) -C sgabios clean
@@ -173,3 +196,4 @@ clean:
 	$(MAKE) -C u-boot-sam460ex distclean
 	$(MAKE) -C skiboot clean
 	$(MAKE) -f Makefile.edk2 clean
+	$(MAKE) -C opensbi clean
diff --git a/roms/opensbi b/roms/opensbi
new file mode 160000
index 000000000000..ca20ac0cd4c0
--- /dev/null
+++ b/roms/opensbi
@@ -0,0 +1 @@
+Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
-- 
2.21.0



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

* [Qemu-devel] [PULL 34/34] hw/riscv: Load OpenSBI as the default firmware
  2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 15:20   ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, Bin Meng, qemu-riscv, qemu-devel, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

If the user hasn't specified a firmware to load (with -bios) or
specified no bios (with -bios none) then load OpenSBI by default. This
allows users to boot a RISC-V kernel with just -kernel.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c         | 49 +++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  7 +++---
 hw/riscv/virt.c         | 11 ++++++---
 include/hw/riscv/boot.h |  3 +++
 qemu-deprecated.texi    | 20 +++++++++++++++++
 5 files changed, 84 insertions(+), 6 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index ff023f42d01d..23397edc8f15 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
 #include "exec/cpu-defs.h"
@@ -32,6 +33,54 @@
 # define KERNEL_BOOT_ADDRESS 0x80200000
 #endif
 
+void riscv_find_and_load_firmware(MachineState *machine,
+                                  const char *default_machine_firmware,
+                                  hwaddr firmware_load_addr)
+{
+    char *firmware_filename;
+
+    if (!machine->firmware) {
+        /*
+         * The user didn't specify -bios.
+         * At the moment we default to loading nothing when this hapens.
+         * In the future this defaul will change to loading the prebuilt
+         * OpenSBI firmware. Let's warn the user and then continue.
+         */
+        warn_report("No -bios option specified. Not loading a firmware.");
+        warn_report("This default will change in QEMU 4.3. Please use the " \
+                    "-bios option to aviod breakages when this happens.");
+        warn_report("See QEMU's deprecation documentation for details");
+        return;
+    }
+
+    if (!strcmp(machine->firmware, "default")) {
+        /*
+         * The user has specified "-bios default". That means we are going to
+         * load the OpenSBI binary included in the QEMU source.
+         *
+         * We can't load the binary by default as it will break existing users
+         * as users are already loading their own firmware.
+         *
+         * Let's try to get everyone to specify the -bios option at all times,
+         * so then in the future we can make "-bios default" the default option
+         * if no -bios option is set without breaking anything.
+         */
+        firmware_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                                           default_machine_firmware);
+    } else {
+        firmware_filename = machine->firmware;
+    }
+
+    if (strcmp(firmware_filename, "none")) {
+        /* If not "none" load the firmware */
+        riscv_load_firmware(firmware_filename, firmware_load_addr);
+    }
+
+    if (!strcmp(machine->firmware, "default")) {
+        g_free(firmware_filename);
+    }
+}
+
 target_ulong riscv_load_firmware(const char *firmware_filename,
                                  hwaddr firmware_load_addr)
 {
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 420867155293..49254b0c0f95 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -49,6 +49,8 @@
 
 #include <libfdt.h>
 
+#define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
+
 static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
@@ -269,9 +271,8 @@ static void riscv_sifive_u_init(MachineState *machine)
     /* create device tree */
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
-    if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[SIFIVE_U_DRAM].base);
-    }
+    riscv_find_and_load_firmware(machine, BIOS_FILENAME,
+                                 memmap[SIFIVE_U_DRAM].base);
 
     if (machine->kernel_filename) {
         riscv_load_kernel(machine->kernel_filename);
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index d8181a4ff18a..244019da9e72 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -44,6 +44,12 @@
 
 #include <libfdt.h>
 
+#if defined(TARGET_RISCV32)
+# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin"
+#else
+# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin"
+#endif
+
 static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
@@ -398,9 +404,8 @@ static void riscv_virt_board_init(MachineState *machine)
     memory_region_add_subregion(system_memory, memmap[VIRT_MROM].base,
                                 mask_rom);
 
-    if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[VIRT_DRAM].base);
-    }
+    riscv_find_and_load_firmware(machine, BIOS_FILENAME,
+                                 memmap[VIRT_DRAM].base);
 
     if (machine->kernel_filename) {
         uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index daa179b600f4..d56f2ae3eb5d 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -20,6 +20,9 @@
 #ifndef RISCV_BOOT_H
 #define RISCV_BOOT_H
 
+void riscv_find_and_load_firmware(MachineState *machine,
+                                  const char *default_machine_firmware,
+                                  hwaddr firmware_load_addr);
 target_ulong riscv_load_firmware(const char *firmware_filename,
                                  hwaddr firmware_load_addr);
 target_ulong riscv_load_kernel(const char *kernel_filename);
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 97ea4ef3001a..f33e6d1c80fb 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -88,6 +88,26 @@ The @code{-realtime mlock=on|off} argument has been replaced by the
 The ``-virtfs_synth'' argument is now deprecated. Please use ``-fsdev synth''
 and ``-device virtio-9p-...'' instead.
 
+@subsection RISC-V -bios (since 4.1)
+
+QEMU 4.1 introduced support for the -bios option in QEMU for RISC-V for the
+RISC-V virt machine and sifive_u machine.
+
+QEMU 4.1 has no changes to the default behaviour to avoid breakages. This
+default will change in a future QEMU release, so please prepare now. All users
+of the virt or sifive_u machine must change their command line usage.
+
+QEMU 4.1 has three options, please migrate to one of these three:
+ 1. ``-bios none`` - This is the current default behavior if no -bios option
+      is included. QEMU will not automatically load any firmware. It is up
+      to the user to load all the images they need.
+ 2. ``-bios default`` - In a future QEMU release this will become the default
+      behaviour if no -bios option is specified. This option will load the
+      default OpenSBI firmware automatically. The firmware is included with
+      the QEMU release and no user interaction is required. All a user needs
+      to do is specify the kernel they want to boot with the -kernel option
+ 3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
+
 @section QEMU Machine Protocol (QMP) commands
 
 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
-- 
2.21.0



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

* [Qemu-riscv] [PULL 34/34] hw/riscv: Load OpenSBI as the default firmware
@ 2019-06-27 15:20   ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-27 15:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, qemu-devel, Alistair Francis, Bin Meng, Palmer Dabbelt

From: Alistair Francis <alistair.francis@wdc.com>

If the user hasn't specified a firmware to load (with -bios) or
specified no bios (with -bios none) then load OpenSBI by default. This
allows users to boot a RISC-V kernel with just -kernel.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 hw/riscv/boot.c         | 49 +++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  7 +++---
 hw/riscv/virt.c         | 11 ++++++---
 include/hw/riscv/boot.h |  3 +++
 qemu-deprecated.texi    | 20 +++++++++++++++++
 5 files changed, 84 insertions(+), 6 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index ff023f42d01d..23397edc8f15 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
 #include "exec/cpu-defs.h"
@@ -32,6 +33,54 @@
 # define KERNEL_BOOT_ADDRESS 0x80200000
 #endif
 
+void riscv_find_and_load_firmware(MachineState *machine,
+                                  const char *default_machine_firmware,
+                                  hwaddr firmware_load_addr)
+{
+    char *firmware_filename;
+
+    if (!machine->firmware) {
+        /*
+         * The user didn't specify -bios.
+         * At the moment we default to loading nothing when this hapens.
+         * In the future this defaul will change to loading the prebuilt
+         * OpenSBI firmware. Let's warn the user and then continue.
+         */
+        warn_report("No -bios option specified. Not loading a firmware.");
+        warn_report("This default will change in QEMU 4.3. Please use the " \
+                    "-bios option to aviod breakages when this happens.");
+        warn_report("See QEMU's deprecation documentation for details");
+        return;
+    }
+
+    if (!strcmp(machine->firmware, "default")) {
+        /*
+         * The user has specified "-bios default". That means we are going to
+         * load the OpenSBI binary included in the QEMU source.
+         *
+         * We can't load the binary by default as it will break existing users
+         * as users are already loading their own firmware.
+         *
+         * Let's try to get everyone to specify the -bios option at all times,
+         * so then in the future we can make "-bios default" the default option
+         * if no -bios option is set without breaking anything.
+         */
+        firmware_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                                           default_machine_firmware);
+    } else {
+        firmware_filename = machine->firmware;
+    }
+
+    if (strcmp(firmware_filename, "none")) {
+        /* If not "none" load the firmware */
+        riscv_load_firmware(firmware_filename, firmware_load_addr);
+    }
+
+    if (!strcmp(machine->firmware, "default")) {
+        g_free(firmware_filename);
+    }
+}
+
 target_ulong riscv_load_firmware(const char *firmware_filename,
                                  hwaddr firmware_load_addr)
 {
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 420867155293..49254b0c0f95 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -49,6 +49,8 @@
 
 #include <libfdt.h>
 
+#define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
+
 static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
@@ -269,9 +271,8 @@ static void riscv_sifive_u_init(MachineState *machine)
     /* create device tree */
     create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline);
 
-    if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[SIFIVE_U_DRAM].base);
-    }
+    riscv_find_and_load_firmware(machine, BIOS_FILENAME,
+                                 memmap[SIFIVE_U_DRAM].base);
 
     if (machine->kernel_filename) {
         riscv_load_kernel(machine->kernel_filename);
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index d8181a4ff18a..244019da9e72 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -44,6 +44,12 @@
 
 #include <libfdt.h>
 
+#if defined(TARGET_RISCV32)
+# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin"
+#else
+# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin"
+#endif
+
 static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
@@ -398,9 +404,8 @@ static void riscv_virt_board_init(MachineState *machine)
     memory_region_add_subregion(system_memory, memmap[VIRT_MROM].base,
                                 mask_rom);
 
-    if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[VIRT_DRAM].base);
-    }
+    riscv_find_and_load_firmware(machine, BIOS_FILENAME,
+                                 memmap[VIRT_DRAM].base);
 
     if (machine->kernel_filename) {
         uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename);
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index daa179b600f4..d56f2ae3eb5d 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -20,6 +20,9 @@
 #ifndef RISCV_BOOT_H
 #define RISCV_BOOT_H
 
+void riscv_find_and_load_firmware(MachineState *machine,
+                                  const char *default_machine_firmware,
+                                  hwaddr firmware_load_addr);
 target_ulong riscv_load_firmware(const char *firmware_filename,
                                  hwaddr firmware_load_addr);
 target_ulong riscv_load_kernel(const char *kernel_filename);
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 97ea4ef3001a..f33e6d1c80fb 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -88,6 +88,26 @@ The @code{-realtime mlock=on|off} argument has been replaced by the
 The ``-virtfs_synth'' argument is now deprecated. Please use ``-fsdev synth''
 and ``-device virtio-9p-...'' instead.
 
+@subsection RISC-V -bios (since 4.1)
+
+QEMU 4.1 introduced support for the -bios option in QEMU for RISC-V for the
+RISC-V virt machine and sifive_u machine.
+
+QEMU 4.1 has no changes to the default behaviour to avoid breakages. This
+default will change in a future QEMU release, so please prepare now. All users
+of the virt or sifive_u machine must change their command line usage.
+
+QEMU 4.1 has three options, please migrate to one of these three:
+ 1. ``-bios none`` - This is the current default behavior if no -bios option
+      is included. QEMU will not automatically load any firmware. It is up
+      to the user to load all the images they need.
+ 2. ``-bios default`` - In a future QEMU release this will become the default
+      behaviour if no -bios option is specified. This option will load the
+      default OpenSBI firmware automatically. The firmware is included with
+      the QEMU release and no user interaction is required. All a user needs
+      to do is specify the kernel they want to boot with the -kernel option
+ 3. ``-bios <file>`` - Tells QEMU to load the specified file as the firmwrae.
+
 @section QEMU Machine Protocol (QMP) commands
 
 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
-- 
2.21.0



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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
  2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-27 17:44     ` Jonathan Behrens
  -1 siblings, 0 replies; 113+ messages in thread
From: Jonathan Behrens @ 2019-06-27 17:44 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Peter Maydell, Hesham Almatary, Alistair Francis,
	open list:RISC-V, qemu-devel@nongnu.org Developers

I think this patch is slightly incorrect. If the PMP region is valid for
the size of the access, but not the rest of the page then a few lines down
in this function the entire page should not be placed into the TLB. Instead
only the portion of the page that passed the access check should be
included. To give an example of where this goes wrong, in the code below
access to address 0x90000008 should always fail due to PMP rules, but if
the TLB has already been primed by loading the (allowed) address 0x90000000
then no fault will be triggered. Notably, this code also executes
improperly without the patch because the first `ld` instruction traps when
it shouldn't.

  li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
  csrw pmpaddr0, t0

  li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
  csrw pmpaddr1, t0

  li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
  csrw pmpcfg0, t0

  sfence.vma

  li t0, 0x90000000
  ld s0, 0(t0)
  ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!

  sfence.vma
  ld s1, 8(t0) // TRAP: TLB has been flushed!

I think that the proper fix would be to first do a PMP check for the full
PAGE_SIZE and execute normally if it passes. Then in the event the full
page fails, there could be a more granular PMP check with only the accessed
region inserted as an entry in the TLB.

Unrelated question: should I be sending "Reviewed By" lines if I read
through patches that seem reasonable? Or there some formal process I'd have
to go through first to be approved?

Jonathan

On Thu, Jun 27, 2019 at 11:43 AM Palmer Dabbelt <palmer@sifive.com> wrote:

> From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
>
> The PMP check should be of the memory access size rather
> than TARGET_PAGE_SIZE.
>
> Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> ---
>  target/riscv/cpu_helper.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
> index 66be83210f11..e1b079e69c60 100644
> --- a/target/riscv/cpu_helper.c
> +++ b/target/riscv/cpu_helper.c
> @@ -452,8 +452,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address,
> int size,
>
>      if (riscv_feature(env, RISCV_FEATURE_PMP) &&
>          (ret == TRANSLATE_SUCCESS) &&
> -        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
> -        mode)) {
> +        !pmp_hart_has_privs(env, pa, size, 1 << access_type, mode)) {
>          ret = TRANSLATE_PMP_FAIL;
>      }
>      if (ret == TRANSLATE_PMP_FAIL) {
> --
> 2.21.0
>
>
>

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

* Re: [Qemu-riscv] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
@ 2019-06-27 17:44     ` Jonathan Behrens
  0 siblings, 0 replies; 113+ messages in thread
From: Jonathan Behrens @ 2019-06-27 17:44 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Peter Maydell, Alistair Francis, open list:RISC-V,
	qemu-devel@nongnu.org Developers, Hesham Almatary

[-- Attachment #1: Type: text/plain, Size: 2668 bytes --]

I think this patch is slightly incorrect. If the PMP region is valid for
the size of the access, but not the rest of the page then a few lines down
in this function the entire page should not be placed into the TLB. Instead
only the portion of the page that passed the access check should be
included. To give an example of where this goes wrong, in the code below
access to address 0x90000008 should always fail due to PMP rules, but if
the TLB has already been primed by loading the (allowed) address 0x90000000
then no fault will be triggered. Notably, this code also executes
improperly without the patch because the first `ld` instruction traps when
it shouldn't.

  li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
  csrw pmpaddr0, t0

  li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
  csrw pmpaddr1, t0

  li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
  csrw pmpcfg0, t0

  sfence.vma

  li t0, 0x90000000
  ld s0, 0(t0)
  ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!

  sfence.vma
  ld s1, 8(t0) // TRAP: TLB has been flushed!

I think that the proper fix would be to first do a PMP check for the full
PAGE_SIZE and execute normally if it passes. Then in the event the full
page fails, there could be a more granular PMP check with only the accessed
region inserted as an entry in the TLB.

Unrelated question: should I be sending "Reviewed By" lines if I read
through patches that seem reasonable? Or there some formal process I'd have
to go through first to be approved?

Jonathan

On Thu, Jun 27, 2019 at 11:43 AM Palmer Dabbelt <palmer@sifive.com> wrote:

> From: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
>
> The PMP check should be of the memory access size rather
> than TARGET_PAGE_SIZE.
>
> Signed-off-by: Hesham Almatary <Hesham.Almatary@cl.cam.ac.uk>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> ---
>  target/riscv/cpu_helper.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
> index 66be83210f11..e1b079e69c60 100644
> --- a/target/riscv/cpu_helper.c
> +++ b/target/riscv/cpu_helper.c
> @@ -452,8 +452,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address,
> int size,
>
>      if (riscv_feature(env, RISCV_FEATURE_PMP) &&
>          (ret == TRANSLATE_SUCCESS) &&
> -        !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type,
> -        mode)) {
> +        !pmp_hart_has_privs(env, pa, size, 1 << access_type, mode)) {
>          ret = TRANSLATE_PMP_FAIL;
>      }
>      if (ret == TRANSLATE_PMP_FAIL) {
> --
> 2.21.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 3656 bytes --]

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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
  2019-06-27 17:44     ` Jonathan Behrens
@ 2019-06-27 18:23       ` Richard Henderson
  -1 siblings, 0 replies; 113+ messages in thread
From: Richard Henderson @ 2019-06-27 18:23 UTC (permalink / raw)
  To: Jonathan Behrens, Palmer Dabbelt
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	Alistair Francis, open list:RISC-V, Hesham Almatary

On 6/27/19 7:44 PM, Jonathan Behrens wrote:
> I think this patch is slightly incorrect. If the PMP region is valid for
> the size of the access, but not the rest of the page then a few lines down
> in this function the entire page should not be placed into the TLB. Instead
> only the portion of the page that passed the access check should be
> included. To give an example of where this goes wrong, in the code below
> access to address 0x90000008 should always fail due to PMP rules, but if
> the TLB has already been primed by loading the (allowed) address 0x90000000
> then no fault will be triggered. Notably, this code also executes
> improperly without the patch because the first `ld` instruction traps when
> it shouldn't.
> 
>   li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
>   csrw pmpaddr0, t0
> 
>   li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
>   csrw pmpaddr1, t0
> 
>   li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
>   csrw pmpcfg0, t0
> 
>   sfence.vma
> 
>   li t0, 0x90000000
>   ld s0, 0(t0)
>   ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!

Nice test case.

> I think that the proper fix would be to first do a PMP check for the full
> PAGE_SIZE and execute normally if it passes. Then in the event the full
> page fails, there could be a more granular PMP check with only the accessed
> region inserted as an entry in the TLB.

This feature looks to be almost identical to the ARM m-profile MPU.

The fix is:

If the PMP check is valid for the entire page, then continue to call
tlb_set_page with size=TARGET_PAGE_SIZE.

If the PMP check is valid for the current access, but not for the entire page,
then call tlb_set_page with any size < TARGET_PAGE_SIZE.  This change alone is
sufficient, even though the full argument tuple (paddr, vaddr, size) no longer
quite make perfect sense.  (For the arm mpu, we compute some 1 << rsize, but
the actual value is never used; setting size=1 would be sufficient.)

Any size < TARGET_PAGE_SIZE will cause TLB_RECHECK to be set for the page,
which will force all accesses to the page to go back through riscv_cpu_tlb_fill
for re-validation.


> Unrelated question: should I be sending "Reviewed By" lines if I read
> through patches that seem reasonable? Or there some formal process I'd have
> to go through first to be approved?

No formal process.  More eyes are always welcome.


r~


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
@ 2019-06-27 18:23       ` Richard Henderson
  0 siblings, 0 replies; 113+ messages in thread
From: Richard Henderson @ 2019-06-27 18:23 UTC (permalink / raw)
  To: Jonathan Behrens, Palmer Dabbelt
  Cc: Peter Maydell, Hesham Almatary, Alistair Francis,
	open list:RISC-V, qemu-devel@nongnu.org Developers

On 6/27/19 7:44 PM, Jonathan Behrens wrote:
> I think this patch is slightly incorrect. If the PMP region is valid for
> the size of the access, but not the rest of the page then a few lines down
> in this function the entire page should not be placed into the TLB. Instead
> only the portion of the page that passed the access check should be
> included. To give an example of where this goes wrong, in the code below
> access to address 0x90000008 should always fail due to PMP rules, but if
> the TLB has already been primed by loading the (allowed) address 0x90000000
> then no fault will be triggered. Notably, this code also executes
> improperly without the patch because the first `ld` instruction traps when
> it shouldn't.
> 
>   li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
>   csrw pmpaddr0, t0
> 
>   li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
>   csrw pmpaddr1, t0
> 
>   li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
>   csrw pmpcfg0, t0
> 
>   sfence.vma
> 
>   li t0, 0x90000000
>   ld s0, 0(t0)
>   ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!

Nice test case.

> I think that the proper fix would be to first do a PMP check for the full
> PAGE_SIZE and execute normally if it passes. Then in the event the full
> page fails, there could be a more granular PMP check with only the accessed
> region inserted as an entry in the TLB.

This feature looks to be almost identical to the ARM m-profile MPU.

The fix is:

If the PMP check is valid for the entire page, then continue to call
tlb_set_page with size=TARGET_PAGE_SIZE.

If the PMP check is valid for the current access, but not for the entire page,
then call tlb_set_page with any size < TARGET_PAGE_SIZE.  This change alone is
sufficient, even though the full argument tuple (paddr, vaddr, size) no longer
quite make perfect sense.  (For the arm mpu, we compute some 1 << rsize, but
the actual value is never used; setting size=1 would be sufficient.)

Any size < TARGET_PAGE_SIZE will cause TLB_RECHECK to be set for the page,
which will force all accesses to the page to go back through riscv_cpu_tlb_fill
for re-validation.


> Unrelated question: should I be sending "Reviewed By" lines if I read
> through patches that seem reasonable? Or there some formal process I'd have
> to go through first to be approved?

No formal process.  More eyes are always welcome.


r~


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-28  9:46     ` Jonathan Cameron
  -1 siblings, 0 replies; 113+ messages in thread
From: Jonathan Cameron @ 2019-06-28  9:46 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Peter Maydell, Bin Meng, Alistair Francis, qemu-riscv, qemu-devel

On Thu, 27 Jun 2019 08:20:10 -0700
Palmer Dabbelt <palmer@sifive.com> wrote:

> From: Alistair Francis <alistair.francis@wdc.com>
> 
> Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

I sent a late bug report on this one.. Hence posting here as well
to make sure it doesn't fall through the cracks!

Right now you can't actually build the opensbi64-virt firmware
due to cut and paste error in the Makefile.

As a side note, I hit this because OpenSBI 0.3 is resulting in a login
loop on a debian test image and the current upstream isn't.  I haven't
debugged yet, but someone else may hit that problem.

Thanks,

Jonathan

> diff --git a/roms/Makefile b/roms/Makefile
> index 078d3fb70563..562ed726fd6b 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
>  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
>  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
>  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
>  
>  # tag our seabios builds
>  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  default:
>  	@echo "nothing is build by default"
>  	@echo "available build targets:"
> -	@echo "  bios           -- update bios.bin (seabios)"
> -	@echo "  vgabios        -- update vgabios binaries (seabios)"
> -	@echo "  sgabios        -- update sgabios binaries"
> -	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi)"
> -	@echo "  slof           -- update slof.bin"
> -	@echo "  skiboot        -- update skiboot.lid"
> -	@echo "  u-boot.e500    -- update u-boot.e500"
> -	@echo "  u-boot.sam460  -- update u-boot.sam460"
> -	@echo "  efi            -- update UEFI (edk2) platform firmware"
> -	@echo "  clean          -- delete the files generated by the previous" \
> -	                          "build targets"
> +	@echo "  bios               -- update bios.bin (seabios)"
> +	@echo "  vgabios            -- update vgabios binaries (seabios)"
> +	@echo "  sgabios            -- update sgabios binaries"
> +	@echo "  pxerom             -- update nic roms (bios only)"
> +	@echo "  efirom             -- update nic roms (bios+efi)"
> +	@echo "  slof               -- update slof.bin"
> +	@echo "  skiboot            -- update skiboot.lid"
> +	@echo "  u-boot.e500        -- update u-boot.e500"
> +	@echo "  u-boot.sam460      -- update u-boot.sam460"
> +	@echo "  efi                -- update UEFI (edk2) platform firmware"
> +	@echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> +	@echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> +	@echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> +	@echo "  clean              -- delete the files generated by the previous" \
> +	                              "build targets"
>  
>  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
>  	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> @@ -162,6 +167,24 @@ skiboot:
>  efi: edk2-basetools
>  	$(MAKE) -f Makefile.edk2
>  
> +opensbi32-virt:
> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv32_cross_prefix) \
> +		PLATFORM="qemu/virt"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> +
> +opensbi64-virt:
> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv64_cross_prefix) \
> +		PLATFORM="qemu/virt"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> +
> +opensbi64-virt:

Cut and paste buglet.  opensbi64-sifive_u

> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv64_cross_prefix) \
> +		PLATFORM="qemu/sifive_u"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> +
>  clean:
>  	rm -rf seabios/.config seabios/out seabios/builds
>  	$(MAKE) -C sgabios clean
> @@ -173,3 +196,4 @@ clean:
>  	$(MAKE) -C u-boot-sam460ex distclean
>  	$(MAKE) -C skiboot clean
>  	$(MAKE) -f Makefile.edk2 clean
> +	$(MAKE) -C opensbi clean
> diff --git a/roms/opensbi b/roms/opensbi
> new file mode 160000
> index 000000000000..ca20ac0cd4c0
> --- /dev/null
> +++ b/roms/opensbi
> @@ -0,0 +1 @@
> +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f




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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-06-28  9:46     ` Jonathan Cameron
  0 siblings, 0 replies; 113+ messages in thread
From: Jonathan Cameron @ 2019-06-28  9:46 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Peter Maydell, Alistair Francis, Bin Meng, qemu-riscv, qemu-devel

On Thu, 27 Jun 2019 08:20:10 -0700
Palmer Dabbelt <palmer@sifive.com> wrote:

> From: Alistair Francis <alistair.francis@wdc.com>
> 
> Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

I sent a late bug report on this one.. Hence posting here as well
to make sure it doesn't fall through the cracks!

Right now you can't actually build the opensbi64-virt firmware
due to cut and paste error in the Makefile.

As a side note, I hit this because OpenSBI 0.3 is resulting in a login
loop on a debian test image and the current upstream isn't.  I haven't
debugged yet, but someone else may hit that problem.

Thanks,

Jonathan

> diff --git a/roms/Makefile b/roms/Makefile
> index 078d3fb70563..562ed726fd6b 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
>  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
>  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
>  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
>  
>  # tag our seabios builds
>  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  default:
>  	@echo "nothing is build by default"
>  	@echo "available build targets:"
> -	@echo "  bios           -- update bios.bin (seabios)"
> -	@echo "  vgabios        -- update vgabios binaries (seabios)"
> -	@echo "  sgabios        -- update sgabios binaries"
> -	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi)"
> -	@echo "  slof           -- update slof.bin"
> -	@echo "  skiboot        -- update skiboot.lid"
> -	@echo "  u-boot.e500    -- update u-boot.e500"
> -	@echo "  u-boot.sam460  -- update u-boot.sam460"
> -	@echo "  efi            -- update UEFI (edk2) platform firmware"
> -	@echo "  clean          -- delete the files generated by the previous" \
> -	                          "build targets"
> +	@echo "  bios               -- update bios.bin (seabios)"
> +	@echo "  vgabios            -- update vgabios binaries (seabios)"
> +	@echo "  sgabios            -- update sgabios binaries"
> +	@echo "  pxerom             -- update nic roms (bios only)"
> +	@echo "  efirom             -- update nic roms (bios+efi)"
> +	@echo "  slof               -- update slof.bin"
> +	@echo "  skiboot            -- update skiboot.lid"
> +	@echo "  u-boot.e500        -- update u-boot.e500"
> +	@echo "  u-boot.sam460      -- update u-boot.sam460"
> +	@echo "  efi                -- update UEFI (edk2) platform firmware"
> +	@echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> +	@echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> +	@echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> +	@echo "  clean              -- delete the files generated by the previous" \
> +	                              "build targets"
>  
>  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
>  	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> @@ -162,6 +167,24 @@ skiboot:
>  efi: edk2-basetools
>  	$(MAKE) -f Makefile.edk2
>  
> +opensbi32-virt:
> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv32_cross_prefix) \
> +		PLATFORM="qemu/virt"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> +
> +opensbi64-virt:
> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv64_cross_prefix) \
> +		PLATFORM="qemu/virt"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> +
> +opensbi64-virt:

Cut and paste buglet.  opensbi64-sifive_u

> +	$(MAKE) -C opensbi \
> +		CROSS_COMPILE=$(riscv64_cross_prefix) \
> +		PLATFORM="qemu/sifive_u"
> +	cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> +
>  clean:
>  	rm -rf seabios/.config seabios/out seabios/builds
>  	$(MAKE) -C sgabios clean
> @@ -173,3 +196,4 @@ clean:
>  	$(MAKE) -C u-boot-sam460ex distclean
>  	$(MAKE) -C skiboot clean
>  	$(MAKE) -f Makefile.edk2 clean
> +	$(MAKE) -C opensbi clean
> diff --git a/roms/opensbi b/roms/opensbi
> new file mode 160000
> index 000000000000..ca20ac0cd4c0
> --- /dev/null
> +++ b/roms/opensbi
> @@ -0,0 +1 @@
> +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f




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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-28  9:46     ` [Qemu-riscv] " Jonathan Cameron
@ 2019-06-28 16:12       ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-06-28 16:12 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Peter Maydell, open list:RISC-V, Palmer Dabbelt,
	qemu-devel@nongnu.org Developers, Alistair Francis, Bin Meng

On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> On Thu, 27 Jun 2019 08:20:10 -0700
> Palmer Dabbelt <palmer@sifive.com> wrote:
>
> > From: Alistair Francis <alistair.francis@wdc.com>
> >
> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>
> I sent a late bug report on this one.. Hence posting here as well
> to make sure it doesn't fall through the cracks!
>
> Right now you can't actually build the opensbi64-virt firmware
> due to cut and paste error in the Makefile.

Ah, thanks for the bug report.

@Palmer Dabbelt I'm just going to send you a fixup commit. Can you
apply it to your tree and send a PRv2?

>
> As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> loop on a debian test image and the current upstream isn't.  I haven't
> debugged yet, but someone else may hit that problem.

Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
know there are bugs in it? Which kernel are you using?

Alistair

>
> Thanks,
>
> Jonathan
>
> > diff --git a/roms/Makefile b/roms/Makefile
> > index 078d3fb70563..562ed726fd6b 100644
> > --- a/roms/Makefile
> > +++ b/roms/Makefile
> > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
> >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
> >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
> >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
> >
> >  # tag our seabios builds
> >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
> >  default:
> >       @echo "nothing is build by default"
> >       @echo "available build targets:"
> > -     @echo "  bios           -- update bios.bin (seabios)"
> > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
> > -     @echo "  sgabios        -- update sgabios binaries"
> > -     @echo "  pxerom         -- update nic roms (bios only)"
> > -     @echo "  efirom         -- update nic roms (bios+efi)"
> > -     @echo "  slof           -- update slof.bin"
> > -     @echo "  skiboot        -- update skiboot.lid"
> > -     @echo "  u-boot.e500    -- update u-boot.e500"
> > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
> > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
> > -     @echo "  clean          -- delete the files generated by the previous" \
> > -                               "build targets"
> > +     @echo "  bios               -- update bios.bin (seabios)"
> > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
> > +     @echo "  sgabios            -- update sgabios binaries"
> > +     @echo "  pxerom             -- update nic roms (bios only)"
> > +     @echo "  efirom             -- update nic roms (bios+efi)"
> > +     @echo "  slof               -- update slof.bin"
> > +     @echo "  skiboot            -- update skiboot.lid"
> > +     @echo "  u-boot.e500        -- update u-boot.e500"
> > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
> > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
> > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> > +     @echo "  clean              -- delete the files generated by the previous" \
> > +                                   "build targets"
> >
> >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
> >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> > @@ -162,6 +167,24 @@ skiboot:
> >  efi: edk2-basetools
> >       $(MAKE) -f Makefile.edk2
> >
> > +opensbi32-virt:
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
> > +             PLATFORM="qemu/virt"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > +
> > +opensbi64-virt:
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > +             PLATFORM="qemu/virt"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > +
> > +opensbi64-virt:
>
> Cut and paste buglet.  opensbi64-sifive_u
>
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > +             PLATFORM="qemu/sifive_u"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > +
> >  clean:
> >       rm -rf seabios/.config seabios/out seabios/builds
> >       $(MAKE) -C sgabios clean
> > @@ -173,3 +196,4 @@ clean:
> >       $(MAKE) -C u-boot-sam460ex distclean
> >       $(MAKE) -C skiboot clean
> >       $(MAKE) -f Makefile.edk2 clean
> > +     $(MAKE) -C opensbi clean
> > diff --git a/roms/opensbi b/roms/opensbi
> > new file mode 160000
> > index 000000000000..ca20ac0cd4c0
> > --- /dev/null
> > +++ b/roms/opensbi
> > @@ -0,0 +1 @@
> > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
>
>
>


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-06-28 16:12       ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-06-28 16:12 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Palmer Dabbelt, Peter Maydell, Bin Meng, Alistair Francis,
	open list:RISC-V, qemu-devel@nongnu.org Developers

On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> On Thu, 27 Jun 2019 08:20:10 -0700
> Palmer Dabbelt <palmer@sifive.com> wrote:
>
> > From: Alistair Francis <alistair.francis@wdc.com>
> >
> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>
> I sent a late bug report on this one.. Hence posting here as well
> to make sure it doesn't fall through the cracks!
>
> Right now you can't actually build the opensbi64-virt firmware
> due to cut and paste error in the Makefile.

Ah, thanks for the bug report.

@Palmer Dabbelt I'm just going to send you a fixup commit. Can you
apply it to your tree and send a PRv2?

>
> As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> loop on a debian test image and the current upstream isn't.  I haven't
> debugged yet, but someone else may hit that problem.

Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
know there are bugs in it? Which kernel are you using?

Alistair

>
> Thanks,
>
> Jonathan
>
> > diff --git a/roms/Makefile b/roms/Makefile
> > index 078d3fb70563..562ed726fd6b 100644
> > --- a/roms/Makefile
> > +++ b/roms/Makefile
> > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
> >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
> >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
> >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
> >
> >  # tag our seabios builds
> >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
> >  default:
> >       @echo "nothing is build by default"
> >       @echo "available build targets:"
> > -     @echo "  bios           -- update bios.bin (seabios)"
> > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
> > -     @echo "  sgabios        -- update sgabios binaries"
> > -     @echo "  pxerom         -- update nic roms (bios only)"
> > -     @echo "  efirom         -- update nic roms (bios+efi)"
> > -     @echo "  slof           -- update slof.bin"
> > -     @echo "  skiboot        -- update skiboot.lid"
> > -     @echo "  u-boot.e500    -- update u-boot.e500"
> > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
> > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
> > -     @echo "  clean          -- delete the files generated by the previous" \
> > -                               "build targets"
> > +     @echo "  bios               -- update bios.bin (seabios)"
> > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
> > +     @echo "  sgabios            -- update sgabios binaries"
> > +     @echo "  pxerom             -- update nic roms (bios only)"
> > +     @echo "  efirom             -- update nic roms (bios+efi)"
> > +     @echo "  slof               -- update slof.bin"
> > +     @echo "  skiboot            -- update skiboot.lid"
> > +     @echo "  u-boot.e500        -- update u-boot.e500"
> > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
> > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
> > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> > +     @echo "  clean              -- delete the files generated by the previous" \
> > +                                   "build targets"
> >
> >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
> >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> > @@ -162,6 +167,24 @@ skiboot:
> >  efi: edk2-basetools
> >       $(MAKE) -f Makefile.edk2
> >
> > +opensbi32-virt:
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
> > +             PLATFORM="qemu/virt"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > +
> > +opensbi64-virt:
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > +             PLATFORM="qemu/virt"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > +
> > +opensbi64-virt:
>
> Cut and paste buglet.  opensbi64-sifive_u
>
> > +     $(MAKE) -C opensbi \
> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > +             PLATFORM="qemu/sifive_u"
> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > +
> >  clean:
> >       rm -rf seabios/.config seabios/out seabios/builds
> >       $(MAKE) -C sgabios clean
> > @@ -173,3 +196,4 @@ clean:
> >       $(MAKE) -C u-boot-sam460ex distclean
> >       $(MAKE) -C skiboot clean
> >       $(MAKE) -f Makefile.edk2 clean
> > +     $(MAKE) -C opensbi clean
> > diff --git a/roms/opensbi b/roms/opensbi
> > new file mode 160000
> > index 000000000000..ca20ac0cd4c0
> > --- /dev/null
> > +++ b/roms/opensbi
> > @@ -0,0 +1 @@
> > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
>
>
>


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-28 16:12       ` [Qemu-riscv] " Alistair Francis
@ 2019-06-28 17:10         ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-28 17:10 UTC (permalink / raw)
  To: alistair23
  Cc: Peter Maydell, qemu-riscv, qemu-devel, Alistair Francis,
	jonathan.cameron, bmeng.cn

On Fri, 28 Jun 2019 09:12:45 PDT (-0700), alistair23@gmail.com wrote:
> On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
>>
>> On Thu, 27 Jun 2019 08:20:10 -0700
>> Palmer Dabbelt <palmer@sifive.com> wrote:
>>
>> > From: Alistair Francis <alistair.francis@wdc.com>
>> >
>> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>> >
>> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
>> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>>
>> I sent a late bug report on this one.. Hence posting here as well
>> to make sure it doesn't fall through the cracks!
>>
>> Right now you can't actually build the opensbi64-virt firmware
>> due to cut and paste error in the Makefile.
>
> Ah, thanks for the bug report.
>
> @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> apply it to your tree and send a PRv2?

WFM.

>
>>
>> As a side note, I hit this because OpenSBI 0.3 is resulting in a login
>> loop on a debian test image and the current upstream isn't.  I haven't
>> debugged yet, but someone else may hit that problem.
>
> Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> know there are bugs in it? Which kernel are you using?
>
> Alistair
>
>>
>> Thanks,
>>
>> Jonathan
>>
>> > diff --git a/roms/Makefile b/roms/Makefile
>> > index 078d3fb70563..562ed726fd6b 100644
>> > --- a/roms/Makefile
>> > +++ b/roms/Makefile
>> > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
>> >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
>> >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
>> >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
>> > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
>> > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
>> >
>> >  # tag our seabios builds
>> >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>> > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>> >  default:
>> >       @echo "nothing is build by default"
>> >       @echo "available build targets:"
>> > -     @echo "  bios           -- update bios.bin (seabios)"
>> > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
>> > -     @echo "  sgabios        -- update sgabios binaries"
>> > -     @echo "  pxerom         -- update nic roms (bios only)"
>> > -     @echo "  efirom         -- update nic roms (bios+efi)"
>> > -     @echo "  slof           -- update slof.bin"
>> > -     @echo "  skiboot        -- update skiboot.lid"
>> > -     @echo "  u-boot.e500    -- update u-boot.e500"
>> > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
>> > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
>> > -     @echo "  clean          -- delete the files generated by the previous" \
>> > -                               "build targets"
>> > +     @echo "  bios               -- update bios.bin (seabios)"
>> > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
>> > +     @echo "  sgabios            -- update sgabios binaries"
>> > +     @echo "  pxerom             -- update nic roms (bios only)"
>> > +     @echo "  efirom             -- update nic roms (bios+efi)"
>> > +     @echo "  slof               -- update slof.bin"
>> > +     @echo "  skiboot            -- update skiboot.lid"
>> > +     @echo "  u-boot.e500        -- update u-boot.e500"
>> > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
>> > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
>> > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
>> > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
>> > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
>> > +     @echo "  clean              -- delete the files generated by the previous" \
>> > +                                   "build targets"
>> >
>> >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
>> >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
>> > @@ -162,6 +167,24 @@ skiboot:
>> >  efi: edk2-basetools
>> >       $(MAKE) -f Makefile.edk2
>> >
>> > +opensbi32-virt:
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
>> > +             PLATFORM="qemu/virt"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
>> > +
>> > +opensbi64-virt:
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
>> > +             PLATFORM="qemu/virt"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
>> > +
>> > +opensbi64-virt:
>>
>> Cut and paste buglet.  opensbi64-sifive_u
>>
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
>> > +             PLATFORM="qemu/sifive_u"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>> > +
>> >  clean:
>> >       rm -rf seabios/.config seabios/out seabios/builds
>> >       $(MAKE) -C sgabios clean
>> > @@ -173,3 +196,4 @@ clean:
>> >       $(MAKE) -C u-boot-sam460ex distclean
>> >       $(MAKE) -C skiboot clean
>> >       $(MAKE) -f Makefile.edk2 clean
>> > +     $(MAKE) -C opensbi clean
>> > diff --git a/roms/opensbi b/roms/opensbi
>> > new file mode 160000
>> > index 000000000000..ca20ac0cd4c0
>> > --- /dev/null
>> > +++ b/roms/opensbi
>> > @@ -0,0 +1 @@
>> > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
>>
>>
>>


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-06-28 17:10         ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-28 17:10 UTC (permalink / raw)
  To: alistair23
  Cc: jonathan.cameron, Peter Maydell, bmeng.cn, Alistair Francis,
	qemu-riscv, qemu-devel

On Fri, 28 Jun 2019 09:12:45 PDT (-0700), alistair23@gmail.com wrote:
> On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
>>
>> On Thu, 27 Jun 2019 08:20:10 -0700
>> Palmer Dabbelt <palmer@sifive.com> wrote:
>>
>> > From: Alistair Francis <alistair.francis@wdc.com>
>> >
>> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>> >
>> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
>> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>>
>> I sent a late bug report on this one.. Hence posting here as well
>> to make sure it doesn't fall through the cracks!
>>
>> Right now you can't actually build the opensbi64-virt firmware
>> due to cut and paste error in the Makefile.
>
> Ah, thanks for the bug report.
>
> @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> apply it to your tree and send a PRv2?

WFM.

>
>>
>> As a side note, I hit this because OpenSBI 0.3 is resulting in a login
>> loop on a debian test image and the current upstream isn't.  I haven't
>> debugged yet, but someone else may hit that problem.
>
> Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> know there are bugs in it? Which kernel are you using?
>
> Alistair
>
>>
>> Thanks,
>>
>> Jonathan
>>
>> > diff --git a/roms/Makefile b/roms/Makefile
>> > index 078d3fb70563..562ed726fd6b 100644
>> > --- a/roms/Makefile
>> > +++ b/roms/Makefile
>> > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
>> >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
>> >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
>> >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
>> > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
>> > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
>> >
>> >  # tag our seabios builds
>> >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>> > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>> >  default:
>> >       @echo "nothing is build by default"
>> >       @echo "available build targets:"
>> > -     @echo "  bios           -- update bios.bin (seabios)"
>> > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
>> > -     @echo "  sgabios        -- update sgabios binaries"
>> > -     @echo "  pxerom         -- update nic roms (bios only)"
>> > -     @echo "  efirom         -- update nic roms (bios+efi)"
>> > -     @echo "  slof           -- update slof.bin"
>> > -     @echo "  skiboot        -- update skiboot.lid"
>> > -     @echo "  u-boot.e500    -- update u-boot.e500"
>> > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
>> > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
>> > -     @echo "  clean          -- delete the files generated by the previous" \
>> > -                               "build targets"
>> > +     @echo "  bios               -- update bios.bin (seabios)"
>> > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
>> > +     @echo "  sgabios            -- update sgabios binaries"
>> > +     @echo "  pxerom             -- update nic roms (bios only)"
>> > +     @echo "  efirom             -- update nic roms (bios+efi)"
>> > +     @echo "  slof               -- update slof.bin"
>> > +     @echo "  skiboot            -- update skiboot.lid"
>> > +     @echo "  u-boot.e500        -- update u-boot.e500"
>> > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
>> > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
>> > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
>> > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
>> > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
>> > +     @echo "  clean              -- delete the files generated by the previous" \
>> > +                                   "build targets"
>> >
>> >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
>> >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
>> > @@ -162,6 +167,24 @@ skiboot:
>> >  efi: edk2-basetools
>> >       $(MAKE) -f Makefile.edk2
>> >
>> > +opensbi32-virt:
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
>> > +             PLATFORM="qemu/virt"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
>> > +
>> > +opensbi64-virt:
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
>> > +             PLATFORM="qemu/virt"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
>> > +
>> > +opensbi64-virt:
>>
>> Cut and paste buglet.  opensbi64-sifive_u
>>
>> > +     $(MAKE) -C opensbi \
>> > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
>> > +             PLATFORM="qemu/sifive_u"
>> > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>> > +
>> >  clean:
>> >       rm -rf seabios/.config seabios/out seabios/builds
>> >       $(MAKE) -C sgabios clean
>> > @@ -173,3 +196,4 @@ clean:
>> >       $(MAKE) -C u-boot-sam460ex distclean
>> >       $(MAKE) -C skiboot clean
>> >       $(MAKE) -f Makefile.edk2 clean
>> > +     $(MAKE) -C opensbi clean
>> > diff --git a/roms/opensbi b/roms/opensbi
>> > new file mode 160000
>> > index 000000000000..ca20ac0cd4c0
>> > --- /dev/null
>> > +++ b/roms/opensbi
>> > @@ -0,0 +1 @@
>> > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
>>
>>
>>


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-28 16:12       ` [Qemu-riscv] " Alistair Francis
@ 2019-07-01 12:40         ` Jonathan Cameron
  -1 siblings, 0 replies; 113+ messages in thread
From: Jonathan Cameron @ 2019-07-01 12:40 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Peter Maydell, open list:RISC-V, Palmer Dabbelt,
	qemu-devel@nongnu.org Developers, Alistair Francis, Bin Meng

On Fri, 28 Jun 2019 09:12:45 -0700
Alistair Francis <alistair23@gmail.com> wrote:

> On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
> >
> > On Thu, 27 Jun 2019 08:20:10 -0700
> > Palmer Dabbelt <palmer@sifive.com> wrote:
> >  
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > >
> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>  
> >
> > I sent a late bug report on this one.. Hence posting here as well
> > to make sure it doesn't fall through the cracks!
> >
> > Right now you can't actually build the opensbi64-virt firmware
> > due to cut and paste error in the Makefile.  
> 
> Ah, thanks for the bug report.
> 
> @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> apply it to your tree and send a PRv2?
> 
> >
> > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > loop on a debian test image and the current upstream isn't.  I haven't
> > debugged yet, but someone else may hit that problem.  
> 
> Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> know there are bugs in it? Which kernel are you using?

Mainline 5.2.0-rc5.

Just in case I also checked 5.2.0-rc7

I tried doing an odd git bisect with good and bad reversed to figure out
what fixed the problem, but boot wedged at "Run /sbin/init as init process."

The wedge was bisected to:

4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")

Which the patch correctly identifies as a problem introduced this kernel cycle.
5.2-rc1.

So on that basis alone I'd suggest we want to move to a more recent openSBI
asap, after all the 5.2 kernel will be out in a week or so.

I'm a bit short on time (flight to catch), so haven't pushed that fix that
far back in the tree yet in order to figure what is causing the login loop.
Won't have access to relevant build machines until Wednesday.

That patch cherry-picked on lib: Optimize TLB flush IPIs
seems fine, so it is before that point...

Passing that point would require real effort though as the two patches
are changing the same code.

So I had a go from the other end (0.3) to see if it was fixed quickly.
Ran out of time, but at 
"firmware: Reset all registers and flush the icache" it superficially all
seems to be working with no TLB related hang, or login loop.

The login loop is present in firmware: Add a barrier instruction for wait for boot hart.

Will see if I can pin it down fully later in the week.

Thanks,

Jonathan





> 
> Alistair
> 
> >
> > Thanks,
> >
> > Jonathan
> >  
> > > diff --git a/roms/Makefile b/roms/Makefile
> > > index 078d3fb70563..562ed726fd6b 100644
> > > --- a/roms/Makefile
> > > +++ b/roms/Makefile
> > > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
> > >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
> > >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
> > >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> > > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> > > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
> > >
> > >  # tag our seabios builds
> > >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> > > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
> > >  default:
> > >       @echo "nothing is build by default"
> > >       @echo "available build targets:"
> > > -     @echo "  bios           -- update bios.bin (seabios)"
> > > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
> > > -     @echo "  sgabios        -- update sgabios binaries"
> > > -     @echo "  pxerom         -- update nic roms (bios only)"
> > > -     @echo "  efirom         -- update nic roms (bios+efi)"
> > > -     @echo "  slof           -- update slof.bin"
> > > -     @echo "  skiboot        -- update skiboot.lid"
> > > -     @echo "  u-boot.e500    -- update u-boot.e500"
> > > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
> > > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
> > > -     @echo "  clean          -- delete the files generated by the previous" \
> > > -                               "build targets"
> > > +     @echo "  bios               -- update bios.bin (seabios)"
> > > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
> > > +     @echo "  sgabios            -- update sgabios binaries"
> > > +     @echo "  pxerom             -- update nic roms (bios only)"
> > > +     @echo "  efirom             -- update nic roms (bios+efi)"
> > > +     @echo "  slof               -- update slof.bin"
> > > +     @echo "  skiboot            -- update skiboot.lid"
> > > +     @echo "  u-boot.e500        -- update u-boot.e500"
> > > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
> > > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
> > > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> > > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> > > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> > > +     @echo "  clean              -- delete the files generated by the previous" \
> > > +                                   "build targets"
> > >
> > >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
> > >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> > > @@ -162,6 +167,24 @@ skiboot:
> > >  efi: edk2-basetools
> > >       $(MAKE) -f Makefile.edk2
> > >
> > > +opensbi32-virt:
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
> > > +             PLATFORM="qemu/virt"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > > +
> > > +opensbi64-virt:
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > > +             PLATFORM="qemu/virt"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > > +
> > > +opensbi64-virt:  
> >
> > Cut and paste buglet.  opensbi64-sifive_u
> >  
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > > +             PLATFORM="qemu/sifive_u"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > > +
> > >  clean:
> > >       rm -rf seabios/.config seabios/out seabios/builds
> > >       $(MAKE) -C sgabios clean
> > > @@ -173,3 +196,4 @@ clean:
> > >       $(MAKE) -C u-boot-sam460ex distclean
> > >       $(MAKE) -C skiboot clean
> > >       $(MAKE) -f Makefile.edk2 clean
> > > +     $(MAKE) -C opensbi clean
> > > diff --git a/roms/opensbi b/roms/opensbi
> > > new file mode 160000
> > > index 000000000000..ca20ac0cd4c0
> > > --- /dev/null
> > > +++ b/roms/opensbi
> > > @@ -0,0 +1 @@
> > > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f  
> >
> >
> >  




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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 12:40         ` Jonathan Cameron
  0 siblings, 0 replies; 113+ messages in thread
From: Jonathan Cameron @ 2019-07-01 12:40 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Palmer Dabbelt, Peter Maydell, Bin Meng, Alistair Francis,
	open list:RISC-V, qemu-devel@nongnu.org Developers

On Fri, 28 Jun 2019 09:12:45 -0700
Alistair Francis <alistair23@gmail.com> wrote:

> On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
> >
> > On Thu, 27 Jun 2019 08:20:10 -0700
> > Palmer Dabbelt <palmer@sifive.com> wrote:
> >  
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > >
> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>  
> >
> > I sent a late bug report on this one.. Hence posting here as well
> > to make sure it doesn't fall through the cracks!
> >
> > Right now you can't actually build the opensbi64-virt firmware
> > due to cut and paste error in the Makefile.  
> 
> Ah, thanks for the bug report.
> 
> @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> apply it to your tree and send a PRv2?
> 
> >
> > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > loop on a debian test image and the current upstream isn't.  I haven't
> > debugged yet, but someone else may hit that problem.  
> 
> Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> know there are bugs in it? Which kernel are you using?

Mainline 5.2.0-rc5.

Just in case I also checked 5.2.0-rc7

I tried doing an odd git bisect with good and bad reversed to figure out
what fixed the problem, but boot wedged at "Run /sbin/init as init process."

The wedge was bisected to:

4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")

Which the patch correctly identifies as a problem introduced this kernel cycle.
5.2-rc1.

So on that basis alone I'd suggest we want to move to a more recent openSBI
asap, after all the 5.2 kernel will be out in a week or so.

I'm a bit short on time (flight to catch), so haven't pushed that fix that
far back in the tree yet in order to figure what is causing the login loop.
Won't have access to relevant build machines until Wednesday.

That patch cherry-picked on lib: Optimize TLB flush IPIs
seems fine, so it is before that point...

Passing that point would require real effort though as the two patches
are changing the same code.

So I had a go from the other end (0.3) to see if it was fixed quickly.
Ran out of time, but at 
"firmware: Reset all registers and flush the icache" it superficially all
seems to be working with no TLB related hang, or login loop.

The login loop is present in firmware: Add a barrier instruction for wait for boot hart.

Will see if I can pin it down fully later in the week.

Thanks,

Jonathan





> 
> Alistair
> 
> >
> > Thanks,
> >
> > Jonathan
> >  
> > > diff --git a/roms/Makefile b/roms/Makefile
> > > index 078d3fb70563..562ed726fd6b 100644
> > > --- a/roms/Makefile
> > > +++ b/roms/Makefile
> > > @@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
> > >  powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
> > >  powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
> > >  x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> > > +riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
> > > +riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
> > >
> > >  # tag our seabios builds
> > >  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
> > > @@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
> > >  default:
> > >       @echo "nothing is build by default"
> > >       @echo "available build targets:"
> > > -     @echo "  bios           -- update bios.bin (seabios)"
> > > -     @echo "  vgabios        -- update vgabios binaries (seabios)"
> > > -     @echo "  sgabios        -- update sgabios binaries"
> > > -     @echo "  pxerom         -- update nic roms (bios only)"
> > > -     @echo "  efirom         -- update nic roms (bios+efi)"
> > > -     @echo "  slof           -- update slof.bin"
> > > -     @echo "  skiboot        -- update skiboot.lid"
> > > -     @echo "  u-boot.e500    -- update u-boot.e500"
> > > -     @echo "  u-boot.sam460  -- update u-boot.sam460"
> > > -     @echo "  efi            -- update UEFI (edk2) platform firmware"
> > > -     @echo "  clean          -- delete the files generated by the previous" \
> > > -                               "build targets"
> > > +     @echo "  bios               -- update bios.bin (seabios)"
> > > +     @echo "  vgabios            -- update vgabios binaries (seabios)"
> > > +     @echo "  sgabios            -- update sgabios binaries"
> > > +     @echo "  pxerom             -- update nic roms (bios only)"
> > > +     @echo "  efirom             -- update nic roms (bios+efi)"
> > > +     @echo "  slof               -- update slof.bin"
> > > +     @echo "  skiboot            -- update skiboot.lid"
> > > +     @echo "  u-boot.e500        -- update u-boot.e500"
> > > +     @echo "  u-boot.sam460      -- update u-boot.sam460"
> > > +     @echo "  efi                -- update UEFI (edk2) platform firmware"
> > > +     @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
> > > +     @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
> > > +     @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
> > > +     @echo "  clean              -- delete the files generated by the previous" \
> > > +                                   "build targets"
> > >
> > >  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
> > >       cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
> > > @@ -162,6 +167,24 @@ skiboot:
> > >  efi: edk2-basetools
> > >       $(MAKE) -f Makefile.edk2
> > >
> > > +opensbi32-virt:
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv32_cross_prefix) \
> > > +             PLATFORM="qemu/virt"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > > +
> > > +opensbi64-virt:
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > > +             PLATFORM="qemu/virt"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > > +
> > > +opensbi64-virt:  
> >
> > Cut and paste buglet.  opensbi64-sifive_u
> >  
> > > +     $(MAKE) -C opensbi \
> > > +             CROSS_COMPILE=$(riscv64_cross_prefix) \
> > > +             PLATFORM="qemu/sifive_u"
> > > +     cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > > +
> > >  clean:
> > >       rm -rf seabios/.config seabios/out seabios/builds
> > >       $(MAKE) -C sgabios clean
> > > @@ -173,3 +196,4 @@ clean:
> > >       $(MAKE) -C u-boot-sam460ex distclean
> > >       $(MAKE) -C skiboot clean
> > >       $(MAKE) -f Makefile.edk2 clean
> > > +     $(MAKE) -C opensbi clean
> > > diff --git a/roms/opensbi b/roms/opensbi
> > > new file mode 160000
> > > index 000000000000..ca20ac0cd4c0
> > > --- /dev/null
> > > +++ b/roms/opensbi
> > > @@ -0,0 +1 @@
> > > +Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f  
> >
> >
> >  




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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 12:40         ` [Qemu-riscv] " Jonathan Cameron
@ 2019-07-01 13:23           ` Anup Patel
  -1 siblings, 0 replies; 113+ messages in thread
From: Anup Patel @ 2019-07-01 13:23 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Peter Maydell, open list:RISC-V, Palmer Dabbelt,
	qemu-devel@nongnu.org Developers, Alistair Francis,
	Alistair Francis, Bin Meng

On Mon, Jul 1, 2019 at 6:12 PM Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> On Fri, 28 Jun 2019 09:12:45 -0700
> Alistair Francis <alistair23@gmail.com> wrote:
>
> > On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> > <jonathan.cameron@huawei.com> wrote:
> > >
> > > On Thu, 27 Jun 2019 08:20:10 -0700
> > > Palmer Dabbelt <palmer@sifive.com> wrote:
> > >
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > >
> > > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > > >
> > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > >
> > > I sent a late bug report on this one.. Hence posting here as well
> > > to make sure it doesn't fall through the cracks!
> > >
> > > Right now you can't actually build the opensbi64-virt firmware
> > > due to cut and paste error in the Makefile.
> >
> > Ah, thanks for the bug report.
> >
> > @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> > apply it to your tree and send a PRv2?
> >
> > >
> > > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > > loop on a debian test image and the current upstream isn't.  I haven't
> > > debugged yet, but someone else may hit that problem.
> >
> > Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> > know there are bugs in it? Which kernel are you using?
>
> Mainline 5.2.0-rc5.
>
> Just in case I also checked 5.2.0-rc7
>
> I tried doing an odd git bisect with good and bad reversed to figure out
> what fixed the problem, but boot wedged at "Run /sbin/init as init process."
>
> The wedge was bisected to:
>
> 4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")
>
> Which the patch correctly identifies as a problem introduced this kernel cycle.
> 5.2-rc1.
>
> So on that basis alone I'd suggest we want to move to a more recent openSBI
> asap, after all the 5.2 kernel will be out in a week or so.
>
> I'm a bit short on time (flight to catch), so haven't pushed that fix that
> far back in the tree yet in order to figure what is causing the login loop.
> Won't have access to relevant build machines until Wednesday.
>
> That patch cherry-picked on lib: Optimize TLB flush IPIs
> seems fine, so it is before that point...
>
> Passing that point would require real effort though as the two patches
> are changing the same code.
>
> So I had a go from the other end (0.3) to see if it was fixed quickly.
> Ran out of time, but at
> "firmware: Reset all registers and flush the icache" it superficially all
> seems to be working with no TLB related hang, or login loop.

We plan to release OpenSBI 0.4 in couple of days. It would be best
to pick-up OpenSBI 0.4 FW_JUMP binaries.

Regards,
Anup


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 13:23           ` Anup Patel
  0 siblings, 0 replies; 113+ messages in thread
From: Anup Patel @ 2019-07-01 13:23 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Alistair Francis, Peter Maydell, open list:RISC-V,
	Palmer Dabbelt, qemu-devel@nongnu.org Developers,
	Alistair Francis, Bin Meng

On Mon, Jul 1, 2019 at 6:12 PM Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> On Fri, 28 Jun 2019 09:12:45 -0700
> Alistair Francis <alistair23@gmail.com> wrote:
>
> > On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> > <jonathan.cameron@huawei.com> wrote:
> > >
> > > On Thu, 27 Jun 2019 08:20:10 -0700
> > > Palmer Dabbelt <palmer@sifive.com> wrote:
> > >
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > >
> > > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > > >
> > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > >
> > > I sent a late bug report on this one.. Hence posting here as well
> > > to make sure it doesn't fall through the cracks!
> > >
> > > Right now you can't actually build the opensbi64-virt firmware
> > > due to cut and paste error in the Makefile.
> >
> > Ah, thanks for the bug report.
> >
> > @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> > apply it to your tree and send a PRv2?
> >
> > >
> > > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > > loop on a debian test image and the current upstream isn't.  I haven't
> > > debugged yet, but someone else may hit that problem.
> >
> > Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> > know there are bugs in it? Which kernel are you using?
>
> Mainline 5.2.0-rc5.
>
> Just in case I also checked 5.2.0-rc7
>
> I tried doing an odd git bisect with good and bad reversed to figure out
> what fixed the problem, but boot wedged at "Run /sbin/init as init process."
>
> The wedge was bisected to:
>
> 4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")
>
> Which the patch correctly identifies as a problem introduced this kernel cycle.
> 5.2-rc1.
>
> So on that basis alone I'd suggest we want to move to a more recent openSBI
> asap, after all the 5.2 kernel will be out in a week or so.
>
> I'm a bit short on time (flight to catch), so haven't pushed that fix that
> far back in the tree yet in order to figure what is causing the login loop.
> Won't have access to relevant build machines until Wednesday.
>
> That patch cherry-picked on lib: Optimize TLB flush IPIs
> seems fine, so it is before that point...
>
> Passing that point would require real effort though as the two patches
> are changing the same code.
>
> So I had a go from the other end (0.3) to see if it was fixed quickly.
> Ran out of time, but at
> "firmware: Reset all registers and flush the icache" it superficially all
> seems to be working with no TLB related hang, or login loop.

We plan to release OpenSBI 0.4 in couple of days. It would be best
to pick-up OpenSBI 0.4 FW_JUMP binaries.

Regards,
Anup


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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 13:23           ` [Qemu-riscv] [Qemu-devel] " Anup Patel
@ 2019-07-01 16:39             ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 16:39 UTC (permalink / raw)
  To: Anup Patel
  Cc: Peter Maydell, open list:RISC-V, Palmer Dabbelt,
	qemu-devel@nongnu.org Developers, Alistair Francis,
	Jonathan Cameron, Bin Meng

On Mon, Jul 1, 2019 at 6:23 AM Anup Patel <anup@brainfault.org> wrote:
>
> On Mon, Jul 1, 2019 at 6:12 PM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
> >
> > On Fri, 28 Jun 2019 09:12:45 -0700
> > Alistair Francis <alistair23@gmail.com> wrote:
> >
> > > On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> > > <jonathan.cameron@huawei.com> wrote:
> > > >
> > > > On Thu, 27 Jun 2019 08:20:10 -0700
> > > > Palmer Dabbelt <palmer@sifive.com> wrote:
> > > >
> > > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > >
> > > > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > > > >
> > > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > >
> > > > I sent a late bug report on this one.. Hence posting here as well
> > > > to make sure it doesn't fall through the cracks!
> > > >
> > > > Right now you can't actually build the opensbi64-virt firmware
> > > > due to cut and paste error in the Makefile.
> > >
> > > Ah, thanks for the bug report.
> > >
> > > @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> > > apply it to your tree and send a PRv2?
> > >
> > > >
> > > > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > > > loop on a debian test image and the current upstream isn't.  I haven't
> > > > debugged yet, but someone else may hit that problem.
> > >
> > > Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> > > know there are bugs in it? Which kernel are you using?
> >
> > Mainline 5.2.0-rc5.
> >
> > Just in case I also checked 5.2.0-rc7
> >
> > I tried doing an odd git bisect with good and bad reversed to figure out
> > what fixed the problem, but boot wedged at "Run /sbin/init as init process."
> >
> > The wedge was bisected to:
> >
> > 4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")
> >
> > Which the patch correctly identifies as a problem introduced this kernel cycle.
> > 5.2-rc1.
> >
> > So on that basis alone I'd suggest we want to move to a more recent openSBI
> > asap, after all the 5.2 kernel will be out in a week or so.
> >
> > I'm a bit short on time (flight to catch), so haven't pushed that fix that
> > far back in the tree yet in order to figure what is causing the login loop.
> > Won't have access to relevant build machines until Wednesday.
> >
> > That patch cherry-picked on lib: Optimize TLB flush IPIs
> > seems fine, so it is before that point...
> >
> > Passing that point would require real effort though as the two patches
> > are changing the same code.
> >
> > So I had a go from the other end (0.3) to see if it was fixed quickly.
> > Ran out of time, but at
> > "firmware: Reset all registers and flush the icache" it superficially all
> > seems to be working with no TLB related hang, or login loop.
>
> We plan to release OpenSBI 0.4 in couple of days. It would be best
> to pick-up OpenSBI 0.4 FW_JUMP binaries.

Great! When the 0.4 release comes out I'll send a patch to update the
QEMU binaries and submodules. If this PR is merged before then we can
just update on top of this (as 5.1 and earlier kernels will work with
0.3) and it not it can be squashed into this PR.

Alistair

>
> Regards,
> Anup


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 16:39             ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 16:39 UTC (permalink / raw)
  To: Anup Patel
  Cc: Jonathan Cameron, Peter Maydell, open list:RISC-V,
	Palmer Dabbelt, qemu-devel@nongnu.org Developers,
	Alistair Francis, Bin Meng

On Mon, Jul 1, 2019 at 6:23 AM Anup Patel <anup@brainfault.org> wrote:
>
> On Mon, Jul 1, 2019 at 6:12 PM Jonathan Cameron
> <jonathan.cameron@huawei.com> wrote:
> >
> > On Fri, 28 Jun 2019 09:12:45 -0700
> > Alistair Francis <alistair23@gmail.com> wrote:
> >
> > > On Fri, Jun 28, 2019 at 2:47 AM Jonathan Cameron
> > > <jonathan.cameron@huawei.com> wrote:
> > > >
> > > > On Thu, 27 Jun 2019 08:20:10 -0700
> > > > Palmer Dabbelt <palmer@sifive.com> wrote:
> > > >
> > > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > >
> > > > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > > > >
> > > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > >
> > > > I sent a late bug report on this one.. Hence posting here as well
> > > > to make sure it doesn't fall through the cracks!
> > > >
> > > > Right now you can't actually build the opensbi64-virt firmware
> > > > due to cut and paste error in the Makefile.
> > >
> > > Ah, thanks for the bug report.
> > >
> > > @Palmer Dabbelt I'm just going to send you a fixup commit. Can you
> > > apply it to your tree and send a PRv2?
> > >
> > > >
> > > > As a side note, I hit this because OpenSBI 0.3 is resulting in a login
> > > > loop on a debian test image and the current upstream isn't.  I haven't
> > > > debugged yet, but someone else may hit that problem.
> > >
> > > Unfortunately OpenSBI 0.3 is a little old now, in saying that I didn't
> > > know there are bugs in it? Which kernel are you using?
> >
> > Mainline 5.2.0-rc5.
> >
> > Just in case I also checked 5.2.0-rc7
> >
> > I tried doing an odd git bisect with good and bad reversed to figure out
> > what fixed the problem, but boot wedged at "Run /sbin/init as init process."
> >
> > The wedge was bisected to:
> >
> > 4e2cd47820 ("lib: Flush everything when remote TLB flush range is too large")
> >
> > Which the patch correctly identifies as a problem introduced this kernel cycle.
> > 5.2-rc1.
> >
> > So on that basis alone I'd suggest we want to move to a more recent openSBI
> > asap, after all the 5.2 kernel will be out in a week or so.
> >
> > I'm a bit short on time (flight to catch), so haven't pushed that fix that
> > far back in the tree yet in order to figure what is causing the login loop.
> > Won't have access to relevant build machines until Wednesday.
> >
> > That patch cherry-picked on lib: Optimize TLB flush IPIs
> > seems fine, so it is before that point...
> >
> > Passing that point would require real effort though as the two patches
> > are changing the same code.
> >
> > So I had a go from the other end (0.3) to see if it was fixed quickly.
> > Ran out of time, but at
> > "firmware: Reset all registers and flush the icache" it superficially all
> > seems to be working with no TLB related hang, or login loop.
>
> We plan to release OpenSBI 0.4 in couple of days. It would be best
> to pick-up OpenSBI 0.4 FW_JUMP binaries.

Great! When the 0.4 release comes out I'll send a patch to update the
QEMU binaries and submodules. If this PR is merged before then we can
just update on top of this (as 5.1 and earlier kernels will work with
0.3) and it not it can be squashed into this PR.

Alistair

>
> Regards,
> Anup


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-07-01 16:54     ` Peter Maydell
  -1 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 16:54 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Alistair Francis, Bin Meng, open list:RISC-V, QEMU Developers

On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com> wrote:
>
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> ---
>  .gitmodules                                  |   3 ++
>  Makefile                                     |   5 +-
>  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848 bytes
>  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904 bytes
>  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904 bytes
>  roms/Makefile                                |  48 ++++++++++++++-----
>  roms/opensbi                                 |   1 +
>  7 files changed, 44 insertions(+), 13 deletions(-)
>  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
>  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
>  create mode 160000 roms/opensbi
>
> diff --git a/.gitmodules b/.gitmodules
> index 2857eec76377..7a10e72e09cd 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -55,3 +55,6 @@
>  [submodule "slirp"]
>         path = slirp
>         url = https://git.qemu.org/git/libslirp.git
> +[submodule "roms/opensbi"]
> +       path = roms/opensbi
> +       url = https://github.com/riscv/opensbi.git

It would be nice to state the license for new blobs we're
adding to the source tree... In particular, I find the
readme at https://github.com/riscv/opensbi a bit confusing
because it says it's 2-BSD but also that some parts are Apache-2.0;
the latter is *not* GPL-2.0 compatible. That makes it not completely
obvious to me that we can ship this with QEMU.

Also, new git modules in .gitmodules should be qemu.org
URLs, not random external ones. (ie, we should set up
mirroring of any new external repo we start shipping
code and binaries for). We can set this up and fix up the
gitmodules file after the fact, but the ideal is to do
it in advance rather than afterwards.

thanks
-- PMM


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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 16:54     ` Peter Maydell
  0 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 16:54 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: open list:RISC-V, QEMU Developers, Alistair Francis, Bin Meng

On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com> wrote:
>
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> ---
>  .gitmodules                                  |   3 ++
>  Makefile                                     |   5 +-
>  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848 bytes
>  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904 bytes
>  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904 bytes
>  roms/Makefile                                |  48 ++++++++++++++-----
>  roms/opensbi                                 |   1 +
>  7 files changed, 44 insertions(+), 13 deletions(-)
>  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
>  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
>  create mode 160000 roms/opensbi
>
> diff --git a/.gitmodules b/.gitmodules
> index 2857eec76377..7a10e72e09cd 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -55,3 +55,6 @@
>  [submodule "slirp"]
>         path = slirp
>         url = https://git.qemu.org/git/libslirp.git
> +[submodule "roms/opensbi"]
> +       path = roms/opensbi
> +       url = https://github.com/riscv/opensbi.git

It would be nice to state the license for new blobs we're
adding to the source tree... In particular, I find the
readme at https://github.com/riscv/opensbi a bit confusing
because it says it's 2-BSD but also that some parts are Apache-2.0;
the latter is *not* GPL-2.0 compatible. That makes it not completely
obvious to me that we can ship this with QEMU.

Also, new git modules in .gitmodules should be qemu.org
URLs, not random external ones. (ie, we should set up
mirroring of any new external repo we start shipping
code and binaries for). We can set this up and fix up the
gitmodules file after the fact, but the ideal is to do
it in advance rather than afterwards.

thanks
-- PMM


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 16:54     ` [Qemu-riscv] " Peter Maydell
@ 2019-07-01 17:50       ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 17:50 UTC (permalink / raw)
  To: peter.maydell, palmer; +Cc: bmeng.cn, qemu-riscv, qemu-devel

On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> wrote:
> > From: Alistair Francis <alistair.francis@wdc.com>
> > 
> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > 
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > ---
> >  .gitmodules                                  |   3 ++
> >  Makefile                                     |   5 +-
> >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > bytes
> >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > bytes
> >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > bytes
> >  roms/Makefile                                |  48 ++++++++++++++-
> > ----
> >  roms/opensbi                                 |   1 +
> >  7 files changed, 44 insertions(+), 13 deletions(-)
> >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> >  create mode 160000 roms/opensbi
> > 
> > diff --git a/.gitmodules b/.gitmodules
> > index 2857eec76377..7a10e72e09cd 100644
> > --- a/.gitmodules
> > +++ b/.gitmodules
> > @@ -55,3 +55,6 @@
> >  [submodule "slirp"]
> >         path = slirp
> >         url = https://git.qemu.org/git/libslirp.git
> > +[submodule "roms/opensbi"]
> > +       path = roms/opensbi
> > +       url = https://github.com/riscv/opensbi.git
> 
> It would be nice to state the license for new blobs we're
> adding to the source tree... In particular, I find the
> readme at https://github.com/riscv/opensbi a bit confusing
> because it says it's 2-BSD but also that some parts are Apache-2.0;
> the latter is *not* GPL-2.0 compatible. That makes it not completely
> obvious to me that we can ship this with QEMU.

Ah, I didn't realise there is Apache-2.0 code in there.

In this case all of the code we are using (we aren't using the Kendryte
code with QEMU) is BSD-2-Clause. Even then though does it matter if it
is GPL compatible? This isn't being linked with QEMU it is just being
included with QEMU.

I can add details of the license in the source tree, where should it be
added?

> 
> Also, new git modules in .gitmodules should be qemu.org
> URLs, not random external ones. (ie, we should set up
> mirroring of any new external repo we start shipping
> code and binaries for). We can set this up and fix up the
> gitmodules file after the fact, but the ideal is to do
> it in advance rather than afterwards.

Ok, who can setup a git mirror for the QEMU repo?

PS: It seems like there are still some issues with this patch so maybe
it's worth dropping this patch from the PR so that we can get
everything else merged.

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 17:50       ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 17:50 UTC (permalink / raw)
  To: peter.maydell, palmer; +Cc: qemu-riscv, bmeng.cn, qemu-devel

On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> wrote:
> > From: Alistair Francis <alistair.francis@wdc.com>
> > 
> > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > 
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > ---
> >  .gitmodules                                  |   3 ++
> >  Makefile                                     |   5 +-
> >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > bytes
> >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > bytes
> >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > bytes
> >  roms/Makefile                                |  48 ++++++++++++++-
> > ----
> >  roms/opensbi                                 |   1 +
> >  7 files changed, 44 insertions(+), 13 deletions(-)
> >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> >  create mode 160000 roms/opensbi
> > 
> > diff --git a/.gitmodules b/.gitmodules
> > index 2857eec76377..7a10e72e09cd 100644
> > --- a/.gitmodules
> > +++ b/.gitmodules
> > @@ -55,3 +55,6 @@
> >  [submodule "slirp"]
> >         path = slirp
> >         url = https://git.qemu.org/git/libslirp.git
> > +[submodule "roms/opensbi"]
> > +       path = roms/opensbi
> > +       url = https://github.com/riscv/opensbi.git
> 
> It would be nice to state the license for new blobs we're
> adding to the source tree... In particular, I find the
> readme at https://github.com/riscv/opensbi a bit confusing
> because it says it's 2-BSD but also that some parts are Apache-2.0;
> the latter is *not* GPL-2.0 compatible. That makes it not completely
> obvious to me that we can ship this with QEMU.

Ah, I didn't realise there is Apache-2.0 code in there.

In this case all of the code we are using (we aren't using the Kendryte
code with QEMU) is BSD-2-Clause. Even then though does it matter if it
is GPL compatible? This isn't being linked with QEMU it is just being
included with QEMU.

I can add details of the license in the source tree, where should it be
added?

> 
> Also, new git modules in .gitmodules should be qemu.org
> URLs, not random external ones. (ie, we should set up
> mirroring of any new external repo we start shipping
> code and binaries for). We can set this up and fix up the
> gitmodules file after the fact, but the ideal is to do
> it in advance rather than afterwards.

Ok, who can setup a git mirror for the QEMU repo?

PS: It seems like there are still some issues with this patch so maybe
it's worth dropping this patch from the PR so that we can get
everything else merged.

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 17:50       ` [Qemu-riscv] " Alistair Francis
@ 2019-07-01 18:01         ` Peter Maydell
  -1 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 18:01 UTC (permalink / raw)
  To: Alistair Francis
  Cc: qemu-riscv, Jeff Cody, palmer, qemu-devel, Stefan Hajnoczi,
	Paolo Bonzini, bmeng.cn

On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > wrote:
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > >
> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > ---
> > >  .gitmodules                                  |   3 ++
> > >  Makefile                                     |   5 +-
> > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > > bytes
> > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > > bytes
> > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > > bytes
> > >  roms/Makefile                                |  48 ++++++++++++++-
> > > ----
> > >  roms/opensbi                                 |   1 +
> > >  7 files changed, 44 insertions(+), 13 deletions(-)
> > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > >  create mode 160000 roms/opensbi
> > >
> > > diff --git a/.gitmodules b/.gitmodules
> > > index 2857eec76377..7a10e72e09cd 100644
> > > --- a/.gitmodules
> > > +++ b/.gitmodules
> > > @@ -55,3 +55,6 @@
> > >  [submodule "slirp"]
> > >         path = slirp
> > >         url = https://git.qemu.org/git/libslirp.git
> > > +[submodule "roms/opensbi"]
> > > +       path = roms/opensbi
> > > +       url = https://github.com/riscv/opensbi.git
> >
> > It would be nice to state the license for new blobs we're
> > adding to the source tree... In particular, I find the
> > readme at https://github.com/riscv/opensbi a bit confusing
> > because it says it's 2-BSD but also that some parts are Apache-2.0;
> > the latter is *not* GPL-2.0 compatible. That makes it not completely
> > obvious to me that we can ship this with QEMU.
>
> Ah, I didn't realise there is Apache-2.0 code in there.
>
> In this case all of the code we are using (we aren't using the Kendryte
> code with QEMU) is BSD-2-Clause. Even then though does it matter if it
> is GPL compatible? This isn't being linked with QEMU it is just being
> included with QEMU.

Yeah, if we're not building the apache-2.0 parts then I think
we're OK, and as you say there's the question of whether QEMU's
GPL affects what we ship as mere bios blobs to run as guest
code anyway. But it's sufficiently not a "really obviously ok"
that I'd like a second opinion; cc'd some people who might have
second opinions.

> I can add details of the license in the source tree, where should it be
> added?

I was thinking in the commit message. We also seem to
have human-readable information in pc-bios/README for
the various blobs, which seems to be a good place for a brief
one-para summary of what OpenSBI is, a URL for its upstream,
and a brief note of the license.

> >
> > Also, new git modules in .gitmodules should be qemu.org
> > URLs, not random external ones. (ie, we should set up
> > mirroring of any new external repo we start shipping
> > code and binaries for). We can set this up and fix up the
> > gitmodules file after the fact, but the ideal is to do
> > it in advance rather than afterwards.
>
> Ok, who can setup a git mirror for the QEMU repo?

That would be Jeff or Stefan (cc'd).

> PS: It seems like there are still some issues with this patch so maybe
> it's worth dropping this patch from the PR so that we can get
> everything else merged.

Yeah, that would be my suggestion.

thanks
-- PMM


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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 18:01         ` Peter Maydell
  0 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 18:01 UTC (permalink / raw)
  To: Alistair Francis
  Cc: palmer, qemu-riscv, bmeng.cn, qemu-devel, Eric Blake,
	Paolo Bonzini, Stefan Hajnoczi, Jeff Cody

On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > wrote:
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > >
> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > ---
> > >  .gitmodules                                  |   3 ++
> > >  Makefile                                     |   5 +-
> > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > > bytes
> > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > > bytes
> > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > > bytes
> > >  roms/Makefile                                |  48 ++++++++++++++-
> > > ----
> > >  roms/opensbi                                 |   1 +
> > >  7 files changed, 44 insertions(+), 13 deletions(-)
> > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
> > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > >  create mode 160000 roms/opensbi
> > >
> > > diff --git a/.gitmodules b/.gitmodules
> > > index 2857eec76377..7a10e72e09cd 100644
> > > --- a/.gitmodules
> > > +++ b/.gitmodules
> > > @@ -55,3 +55,6 @@
> > >  [submodule "slirp"]
> > >         path = slirp
> > >         url = https://git.qemu.org/git/libslirp.git
> > > +[submodule "roms/opensbi"]
> > > +       path = roms/opensbi
> > > +       url = https://github.com/riscv/opensbi.git
> >
> > It would be nice to state the license for new blobs we're
> > adding to the source tree... In particular, I find the
> > readme at https://github.com/riscv/opensbi a bit confusing
> > because it says it's 2-BSD but also that some parts are Apache-2.0;
> > the latter is *not* GPL-2.0 compatible. That makes it not completely
> > obvious to me that we can ship this with QEMU.
>
> Ah, I didn't realise there is Apache-2.0 code in there.
>
> In this case all of the code we are using (we aren't using the Kendryte
> code with QEMU) is BSD-2-Clause. Even then though does it matter if it
> is GPL compatible? This isn't being linked with QEMU it is just being
> included with QEMU.

Yeah, if we're not building the apache-2.0 parts then I think
we're OK, and as you say there's the question of whether QEMU's
GPL affects what we ship as mere bios blobs to run as guest
code anyway. But it's sufficiently not a "really obviously ok"
that I'd like a second opinion; cc'd some people who might have
second opinions.

> I can add details of the license in the source tree, where should it be
> added?

I was thinking in the commit message. We also seem to
have human-readable information in pc-bios/README for
the various blobs, which seems to be a good place for a brief
one-para summary of what OpenSBI is, a URL for its upstream,
and a brief note of the license.

> >
> > Also, new git modules in .gitmodules should be qemu.org
> > URLs, not random external ones. (ie, we should set up
> > mirroring of any new external repo we start shipping
> > code and binaries for). We can set this up and fix up the
> > gitmodules file after the fact, but the ideal is to do
> > it in advance rather than afterwards.
>
> Ok, who can setup a git mirror for the QEMU repo?

That would be Jeff or Stefan (cc'd).

> PS: It seems like there are still some issues with this patch so maybe
> it's worth dropping this patch from the PR so that we can get
> everything else merged.

Yeah, that would be my suggestion.

thanks
-- PMM


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:01         ` [Qemu-riscv] " Peter Maydell
@ 2019-07-01 18:09           ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 18:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: qemu-riscv, codyprime, palmer, qemu-devel, stefanha, pbonzini, bmeng.cn

On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> Alistair.Francis@wdc.com> wrote:
> > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > wrote:
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > 
> > > > Add OpenSBI version 0.3 as a git submodule and as a prebult
> > > > binary.
> > > > 
> > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > > ---
> > > >  .gitmodules                                  |   3 ++
> > > >  Makefile                                     |   5 +-
> > > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > > > bytes
> > > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > > > bytes
> > > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > > > bytes
> > > >  roms/Makefile                                |  48
> > > > ++++++++++++++-
> > > > ----
> > > >  roms/opensbi                                 |   1 +
> > > >  7 files changed, 44 insertions(+), 13 deletions(-)
> > > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-
> > > > fw_jump.bin
> > > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > > >  create mode 160000 roms/opensbi
> > > > 
> > > > diff --git a/.gitmodules b/.gitmodules
> > > > index 2857eec76377..7a10e72e09cd 100644
> > > > --- a/.gitmodules
> > > > +++ b/.gitmodules
> > > > @@ -55,3 +55,6 @@
> > > >  [submodule "slirp"]
> > > >         path = slirp
> > > >         url = https://git.qemu.org/git/libslirp.git
> > > > +[submodule "roms/opensbi"]
> > > > +       path = roms/opensbi
> > > > +       url = https://github.com/riscv/opensbi.git
> > > 
> > > It would be nice to state the license for new blobs we're
> > > adding to the source tree... In particular, I find the
> > > readme at https://github.com/riscv/opensbi a bit confusing
> > > because it says it's 2-BSD but also that some parts are Apache-
> > > 2.0;
> > > the latter is *not* GPL-2.0 compatible. That makes it not
> > > completely
> > > obvious to me that we can ship this with QEMU.
> > 
> > Ah, I didn't realise there is Apache-2.0 code in there.
> > 
> > In this case all of the code we are using (we aren't using the
> > Kendryte
> > code with QEMU) is BSD-2-Clause. Even then though does it matter if
> > it
> > is GPL compatible? This isn't being linked with QEMU it is just
> > being
> > included with QEMU.
> 
> Yeah, if we're not building the apache-2.0 parts then I think
> we're OK, and as you say there's the question of whether QEMU's
> GPL affects what we ship as mere bios blobs to run as guest
> code anyway. But it's sufficiently not a "really obviously ok"
> that I'd like a second opinion; cc'd some people who might have
> second opinions.
> 
> > I can add details of the license in the source tree, where should
> > it be
> > added?
> 
> I was thinking in the commit message. We also seem to
> have human-readable information in pc-bios/README for
> the various blobs, which seems to be a good place for a brief
> one-para summary of what OpenSBI is, a URL for its upstream,
> and a brief note of the license.

Ok, I'll add that.

> 
> > > Also, new git modules in .gitmodules should be qemu.org
> > > URLs, not random external ones. (ie, we should set up
> > > mirroring of any new external repo we start shipping
> > > code and binaries for). We can set this up and fix up the
> > > gitmodules file after the fact, but the ideal is to do
> > > it in advance rather than afterwards.
> > 
> > Ok, who can setup a git mirror for the QEMU repo?
> 
> That would be Jeff or Stefan (cc'd).
> 
> > PS: It seems like there are still some issues with this patch so
> > maybe
> > it's worth dropping this patch from the PR so that we can get
> > everything else merged.
> 
> Yeah, that would be my suggestion.

Can you do that when you merge it or does Palmer have to send the PR
again?

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 18:09           ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 18:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: codyprime, qemu-devel, stefanha, qemu-riscv, bmeng.cn, eblake,
	pbonzini, palmer

On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> Alistair.Francis@wdc.com> wrote:
> > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > wrote:
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > 
> > > > Add OpenSBI version 0.3 as a git submodule and as a prebult
> > > > binary.
> > > > 
> > > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
> > > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
> > > > ---
> > > >  .gitmodules                                  |   3 ++
> > > >  Makefile                                     |   5 +-
> > > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
> > > > bytes
> > > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
> > > > bytes
> > > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
> > > > bytes
> > > >  roms/Makefile                                |  48
> > > > ++++++++++++++-
> > > > ----
> > > >  roms/opensbi                                 |   1 +
> > > >  7 files changed, 44 insertions(+), 13 deletions(-)
> > > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
> > > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-
> > > > fw_jump.bin
> > > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
> > > >  create mode 160000 roms/opensbi
> > > > 
> > > > diff --git a/.gitmodules b/.gitmodules
> > > > index 2857eec76377..7a10e72e09cd 100644
> > > > --- a/.gitmodules
> > > > +++ b/.gitmodules
> > > > @@ -55,3 +55,6 @@
> > > >  [submodule "slirp"]
> > > >         path = slirp
> > > >         url = https://git.qemu.org/git/libslirp.git
> > > > +[submodule "roms/opensbi"]
> > > > +       path = roms/opensbi
> > > > +       url = https://github.com/riscv/opensbi.git
> > > 
> > > It would be nice to state the license for new blobs we're
> > > adding to the source tree... In particular, I find the
> > > readme at https://github.com/riscv/opensbi a bit confusing
> > > because it says it's 2-BSD but also that some parts are Apache-
> > > 2.0;
> > > the latter is *not* GPL-2.0 compatible. That makes it not
> > > completely
> > > obvious to me that we can ship this with QEMU.
> > 
> > Ah, I didn't realise there is Apache-2.0 code in there.
> > 
> > In this case all of the code we are using (we aren't using the
> > Kendryte
> > code with QEMU) is BSD-2-Clause. Even then though does it matter if
> > it
> > is GPL compatible? This isn't being linked with QEMU it is just
> > being
> > included with QEMU.
> 
> Yeah, if we're not building the apache-2.0 parts then I think
> we're OK, and as you say there's the question of whether QEMU's
> GPL affects what we ship as mere bios blobs to run as guest
> code anyway. But it's sufficiently not a "really obviously ok"
> that I'd like a second opinion; cc'd some people who might have
> second opinions.
> 
> > I can add details of the license in the source tree, where should
> > it be
> > added?
> 
> I was thinking in the commit message. We also seem to
> have human-readable information in pc-bios/README for
> the various blobs, which seems to be a good place for a brief
> one-para summary of what OpenSBI is, a URL for its upstream,
> and a brief note of the license.

Ok, I'll add that.

> 
> > > Also, new git modules in .gitmodules should be qemu.org
> > > URLs, not random external ones. (ie, we should set up
> > > mirroring of any new external repo we start shipping
> > > code and binaries for). We can set this up and fix up the
> > > gitmodules file after the fact, but the ideal is to do
> > > it in advance rather than afterwards.
> > 
> > Ok, who can setup a git mirror for the QEMU repo?
> 
> That would be Jeff or Stefan (cc'd).
> 
> > PS: It seems like there are still some issues with this patch so
> > maybe
> > it's worth dropping this patch from the PR so that we can get
> > everything else merged.
> 
> Yeah, that would be my suggestion.

Can you do that when you merge it or does Palmer have to send the PR
again?

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:09           ` [Qemu-riscv] " Alistair Francis
@ 2019-07-01 18:13             ` Peter Maydell
  -1 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 18:13 UTC (permalink / raw)
  To: Alistair Francis
  Cc: qemu-riscv, codyprime, palmer, qemu-devel, stefanha, pbonzini, bmeng.cn

On Mon, 1 Jul 2019 at 19:09, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > Alistair.Francis@wdc.com> wrote:
> > > PS: It seems like there are still some issues with this patch so
> > > maybe
> > > it's worth dropping this patch from the PR so that we can get
> > > everything else merged.
> >
> > Yeah, that would be my suggestion.
>
> Can you do that when you merge it or does Palmer have to send the PR
> again?

Palmer needs to respin it -- pulls are signed and I can't
modify them, only either apply them or not. (Technically I
could in theory cherry-pick all the other commits out of them
but that would be a huge amount of manual labour.)

thanks
-- PMM


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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 18:13             ` Peter Maydell
  0 siblings, 0 replies; 113+ messages in thread
From: Peter Maydell @ 2019-07-01 18:13 UTC (permalink / raw)
  To: Alistair Francis
  Cc: codyprime, qemu-devel, stefanha, qemu-riscv, bmeng.cn, eblake,
	pbonzini, palmer

On Mon, 1 Jul 2019 at 19:09, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > Alistair.Francis@wdc.com> wrote:
> > > PS: It seems like there are still some issues with this patch so
> > > maybe
> > > it's worth dropping this patch from the PR so that we can get
> > > everything else merged.
> >
> > Yeah, that would be my suggestion.
>
> Can you do that when you merge it or does Palmer have to send the PR
> again?

Palmer needs to respin it -- pulls are signed and I can't
modify them, only either apply them or not. (Technically I
could in theory cherry-pick all the other commits out of them
but that would be a huge amount of manual labour.)

thanks
-- PMM


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:13             ` [Qemu-riscv] " Peter Maydell
@ 2019-07-01 18:19               ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 18:19 UTC (permalink / raw)
  To: peter.maydell
  Cc: qemu-riscv, codyprime, palmer, qemu-devel, stefanha, pbonzini,
	alistair23, bmeng.cn

On Mon, 2019-07-01 at 19:13 +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 19:09, Alistair Francis <
> Alistair.Francis@wdc.com> wrote:
> > On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > > Alistair.Francis@wdc.com> wrote:
> > > > PS: It seems like there are still some issues with this patch
> > > > so
> > > > maybe
> > > > it's worth dropping this patch from the PR so that we can get
> > > > everything else merged.
> > > 
> > > Yeah, that would be my suggestion.
> > 
> > Can you do that when you merge it or does Palmer have to send the
> > PR
> > again?
> 
> Palmer needs to respin it -- pulls are signed and I can't
> modify them, only either apply them or not. (Technically I
> could in theory cherry-pick all the other commits out of them
> but that would be a huge amount of manual labour.)

No worries.

@Palmer can you please drop these two patches from this PR?

hw/riscv: Load OpenSBI as the default firmware
roms: Add OpenSBI version 0.3

Sorry for the all the last minute changes. I'll wait until OpenSBI 0.4
to respin those two patches.

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-01 18:19               ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-01 18:19 UTC (permalink / raw)
  To: peter.maydell
  Cc: alistair23, codyprime, qemu-devel, stefanha, qemu-riscv, eblake,
	bmeng.cn, pbonzini, palmer

On Mon, 2019-07-01 at 19:13 +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 19:09, Alistair Francis <
> Alistair.Francis@wdc.com> wrote:
> > On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > > Alistair.Francis@wdc.com> wrote:
> > > > PS: It seems like there are still some issues with this patch
> > > > so
> > > > maybe
> > > > it's worth dropping this patch from the PR so that we can get
> > > > everything else merged.
> > > 
> > > Yeah, that would be my suggestion.
> > 
> > Can you do that when you merge it or does Palmer have to send the
> > PR
> > again?
> 
> Palmer needs to respin it -- pulls are signed and I can't
> modify them, only either apply them or not. (Technically I
> could in theory cherry-pick all the other commits out of them
> but that would be a huge amount of manual labour.)

No worries.

@Palmer can you please drop these two patches from this PR?

hw/riscv: Load OpenSBI as the default firmware
roms: Add OpenSBI version 0.3

Sorry for the all the last minute changes. I'll wait until OpenSBI 0.4
to respin those two patches.

Alistair

> 
> thanks
> -- PMM

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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:01         ` [Qemu-riscv] " Peter Maydell
@ 2019-07-02  4:12           ` Markus Armbruster
  -1 siblings, 0 replies; 113+ messages in thread
From: Markus Armbruster @ 2019-07-02  4:12 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-riscv, Jeff Cody, palmer, qemu-devel, Alistair Francis,
	Stefan Hajnoczi, Paolo Bonzini, bmeng.cn

Peter Maydell <peter.maydell@linaro.org> writes:

> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>>
>> On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
>> > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
>> > wrote:
>> > > From: Alistair Francis <alistair.francis@wdc.com>
>> > >
>> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>> > >
>> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
>> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>> > > ---
>> > >  .gitmodules                                  |   3 ++
>> > >  Makefile                                     |   5 +-
>> > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
>> > > bytes
>> > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
>> > > bytes
>> > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
>> > > bytes
>> > >  roms/Makefile                                |  48 ++++++++++++++-
>> > > ----
>> > >  roms/opensbi                                 |   1 +
>> > >  7 files changed, 44 insertions(+), 13 deletions(-)
>> > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
>> > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>> > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
>> > >  create mode 160000 roms/opensbi
>> > >
>> > > diff --git a/.gitmodules b/.gitmodules
>> > > index 2857eec76377..7a10e72e09cd 100644
>> > > --- a/.gitmodules
>> > > +++ b/.gitmodules
>> > > @@ -55,3 +55,6 @@
>> > >  [submodule "slirp"]
>> > >         path = slirp
>> > >         url = https://git.qemu.org/git/libslirp.git
>> > > +[submodule "roms/opensbi"]
>> > > +       path = roms/opensbi
>> > > +       url = https://github.com/riscv/opensbi.git
>> >
>> > It would be nice to state the license for new blobs we're
>> > adding to the source tree... In particular, I find the
>> > readme at https://github.com/riscv/opensbi a bit confusing
>> > because it says it's 2-BSD but also that some parts are Apache-2.0;
>> > the latter is *not* GPL-2.0 compatible. That makes it not completely
>> > obvious to me that we can ship this with QEMU.
>>
>> Ah, I didn't realise there is Apache-2.0 code in there.
>>
>> In this case all of the code we are using (we aren't using the Kendryte
>> code with QEMU) is BSD-2-Clause. Even then though does it matter if it
>> is GPL compatible? This isn't being linked with QEMU it is just being
>> included with QEMU.
>
> Yeah, if we're not building the apache-2.0 parts then I think
> we're OK, and as you say there's the question of whether QEMU's
> GPL affects what we ship as mere bios blobs to run as guest
> code anyway. But it's sufficiently not a "really obviously ok"
> that I'd like a second opinion; cc'd some people who might have
> second opinions.

You need an expert opinion.

My non-expert opinion: we can't distribute anything that's not
compatible with GPLv2, at least as long as LICENSE makes the following
claims:

    1) QEMU as a whole is released under the GNU General Public License,
    version 2.

    2) Parts of QEMU have specific licenses which are compatible with the
    GNU General Public License, version 2. Hence each source file contains
    its own licensing information.  Source files with no licensing information
    are released under the GNU General Public License, version 2 or (at your
    option) any later version.

    As of July 2013, contributions under version 2 of the GNU General Public
    License (and no later version) are only accepted for the following files
    or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*.

    3) The Tiny Code Generator (TCG) is released under the BSD license
       (see license headers in files).

Complicating things further just to distribute a firmware blob would be
a mistake.  Our licensing situation is already complex enough for me to
call it a mistake.

[...]


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-02  4:12           ` Markus Armbruster
  0 siblings, 0 replies; 113+ messages in thread
From: Markus Armbruster @ 2019-07-02  4:12 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, qemu-riscv, Jeff Cody, palmer, qemu-devel,
	Stefan Hajnoczi, Paolo Bonzini, bmeng.cn

Peter Maydell <peter.maydell@linaro.org> writes:

> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
>>
>> On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
>> > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
>> > wrote:
>> > > From: Alistair Francis <alistair.francis@wdc.com>
>> > >
>> > > Add OpenSBI version 0.3 as a git submodule and as a prebult binary.
>> > >
>> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> > > Tested-by: Bin Meng <bmeng.cn@gmail.com>
>> > > Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
>> > > ---
>> > >  .gitmodules                                  |   3 ++
>> > >  Makefile                                     |   5 +-
>> > >  pc-bios/opensbi-riscv32-virt-fw_jump.bin     | Bin 0 -> 28848
>> > > bytes
>> > >  pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 0 -> 28904
>> > > bytes
>> > >  pc-bios/opensbi-riscv64-virt-fw_jump.bin     | Bin 0 -> 28904
>> > > bytes
>> > >  roms/Makefile                                |  48 ++++++++++++++-
>> > > ----
>> > >  roms/opensbi                                 |   1 +
>> > >  7 files changed, 44 insertions(+), 13 deletions(-)
>> > >  create mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin
>> > >  create mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
>> > >  create mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
>> > >  create mode 160000 roms/opensbi
>> > >
>> > > diff --git a/.gitmodules b/.gitmodules
>> > > index 2857eec76377..7a10e72e09cd 100644
>> > > --- a/.gitmodules
>> > > +++ b/.gitmodules
>> > > @@ -55,3 +55,6 @@
>> > >  [submodule "slirp"]
>> > >         path = slirp
>> > >         url = https://git.qemu.org/git/libslirp.git
>> > > +[submodule "roms/opensbi"]
>> > > +       path = roms/opensbi
>> > > +       url = https://github.com/riscv/opensbi.git
>> >
>> > It would be nice to state the license for new blobs we're
>> > adding to the source tree... In particular, I find the
>> > readme at https://github.com/riscv/opensbi a bit confusing
>> > because it says it's 2-BSD but also that some parts are Apache-2.0;
>> > the latter is *not* GPL-2.0 compatible. That makes it not completely
>> > obvious to me that we can ship this with QEMU.
>>
>> Ah, I didn't realise there is Apache-2.0 code in there.
>>
>> In this case all of the code we are using (we aren't using the Kendryte
>> code with QEMU) is BSD-2-Clause. Even then though does it matter if it
>> is GPL compatible? This isn't being linked with QEMU it is just being
>> included with QEMU.
>
> Yeah, if we're not building the apache-2.0 parts then I think
> we're OK, and as you say there's the question of whether QEMU's
> GPL affects what we ship as mere bios blobs to run as guest
> code anyway. But it's sufficiently not a "really obviously ok"
> that I'd like a second opinion; cc'd some people who might have
> second opinions.

You need an expert opinion.

My non-expert opinion: we can't distribute anything that's not
compatible with GPLv2, at least as long as LICENSE makes the following
claims:

    1) QEMU as a whole is released under the GNU General Public License,
    version 2.

    2) Parts of QEMU have specific licenses which are compatible with the
    GNU General Public License, version 2. Hence each source file contains
    its own licensing information.  Source files with no licensing information
    are released under the GNU General Public License, version 2 or (at your
    option) any later version.

    As of July 2013, contributions under version 2 of the GNU General Public
    License (and no later version) are only accepted for the following files
    or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*.

    3) The Tiny Code Generator (TCG) is released under the BSD license
       (see license headers in files).

Complicating things further just to distribute a firmware blob would be
a mistake.  Our licensing situation is already complex enough for me to
call it a mistake.

[...]


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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:19               ` [Qemu-riscv] " Alistair Francis
@ 2019-07-02  7:02                 ` Anup Patel
  -1 siblings, 0 replies; 113+ messages in thread
From: Anup Patel @ 2019-07-02  7:02 UTC (permalink / raw)
  To: Alistair Francis
  Cc: peter.maydell, qemu-riscv, codyprime, palmer, qemu-devel,
	stefanha, alistair23, pbonzini, bmeng.cn

On Tue, Jul 2, 2019 at 2:57 AM Alistair Francis
<Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 19:13 +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 19:09, Alistair Francis <
> > Alistair.Francis@wdc.com> wrote:
> > > On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > > > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > > > Alistair.Francis@wdc.com> wrote:
> > > > > PS: It seems like there are still some issues with this patch
> > > > > so
> > > > > maybe
> > > > > it's worth dropping this patch from the PR so that we can get
> > > > > everything else merged.
> > > >
> > > > Yeah, that would be my suggestion.
> > >
> > > Can you do that when you merge it or does Palmer have to send the
> > > PR
> > > again?
> >
> > Palmer needs to respin it -- pulls are signed and I can't
> > modify them, only either apply them or not. (Technically I
> > could in theory cherry-pick all the other commits out of them
> > but that would be a huge amount of manual labour.)
>
> No worries.
>
> @Palmer can you please drop these two patches from this PR?
>
> hw/riscv: Load OpenSBI as the default firmware
> roms: Add OpenSBI version 0.3
>
> Sorry for the all the last minute changes. I'll wait until OpenSBI 0.4
> to respin those two patches.

OpenSBI v0.4 is now available.
(Refer, https://github.com/riscv/opensbi/releases/tag/v0.4)

Regards,
Anup


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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-02  7:02                 ` Anup Patel
  0 siblings, 0 replies; 113+ messages in thread
From: Anup Patel @ 2019-07-02  7:02 UTC (permalink / raw)
  To: Alistair Francis
  Cc: peter.maydell, qemu-riscv, codyprime, palmer, qemu-devel,
	stefanha, pbonzini, alistair23, bmeng.cn, eblake

On Tue, Jul 2, 2019 at 2:57 AM Alistair Francis
<Alistair.Francis@wdc.com> wrote:
>
> On Mon, 2019-07-01 at 19:13 +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 19:09, Alistair Francis <
> > Alistair.Francis@wdc.com> wrote:
> > > On Mon, 2019-07-01 at 19:01 +0100, Peter Maydell wrote:
> > > > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <
> > > > Alistair.Francis@wdc.com> wrote:
> > > > > PS: It seems like there are still some issues with this patch
> > > > > so
> > > > > maybe
> > > > > it's worth dropping this patch from the PR so that we can get
> > > > > everything else merged.
> > > >
> > > > Yeah, that would be my suggestion.
> > >
> > > Can you do that when you merge it or does Palmer have to send the
> > > PR
> > > again?
> >
> > Palmer needs to respin it -- pulls are signed and I can't
> > modify them, only either apply them or not. (Technically I
> > could in theory cherry-pick all the other commits out of them
> > but that would be a huge amount of manual labour.)
>
> No worries.
>
> @Palmer can you please drop these two patches from this PR?
>
> hw/riscv: Load OpenSBI as the default firmware
> roms: Add OpenSBI version 0.3
>
> Sorry for the all the last minute changes. I'll wait until OpenSBI 0.4
> to respin those two patches.

OpenSBI v0.4 is now available.
(Refer, https://github.com/riscv/opensbi/releases/tag/v0.4)

Regards,
Anup


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-02  4:12           ` [Qemu-riscv] " Markus Armbruster
@ 2019-07-02 10:32             ` Paolo Bonzini
  -1 siblings, 0 replies; 113+ messages in thread
From: Paolo Bonzini @ 2019-07-02 10:32 UTC (permalink / raw)
  To: Markus Armbruster, Peter Maydell
  Cc: qemu-riscv, Jeff Cody, palmer, qemu-devel, Alistair Francis,
	Stefan Hajnoczi, bmeng.cn

On 02/07/19 06:12, Markus Armbruster wrote:
>> Yeah, if we're not building the apache-2.0 parts then I think
>> we're OK, and as you say there's the question of whether QEMU's
>> GPL affects what we ship as mere bios blobs to run as guest
>> code anyway. But it's sufficiently not a "really obviously ok"
>> that I'd like a second opinion; cc'd some people who might have
>> second opinions.
> 
> You need an expert opinion.
> 
> My non-expert opinion: we can't distribute anything that's not
> compatible with GPLv2

Guest code is not part of QEMU.  We don't say that SeaBIOS, SLOF, etc. 
are part of QEMU; it constitutes mere aggregation with the GPLv2 QEMU 
sources, so it _is_ possible to distribute APSL2 guest code with QEMU.  
IANAL, but I'm fairly sure about this.

However I agree that LICENSE needs to be updated, something like this:

diff --git a/LICENSE b/LICENSE
index 0e0b4b9553..81b9b3572d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,13 +1,18 @@
-The following points clarify the QEMU license:
+The QEMU distribution includes both the QEMU emulator and
+various firmware files.  These are separate programs that are
+distributed together for our users' convenience, and they have
+separate license.
 
-1) QEMU as a whole is released under the GNU General Public License,
-version 2.
+The following points clarify the license of the QEMU emulator:
 
-2) Parts of QEMU have specific licenses which are compatible with the
-GNU General Public License, version 2. Hence each source file contains
-its own licensing information.  Source files with no licensing information
-are released under the GNU General Public License, version 2 or (at your
-option) any later version.
+1) The QEMU emulator as a whole is released under the GNU General
+Public License, version 2.
+
+2) Parts of the QEMU emulator have specific licenses which are compatible
+with the GNU General Public License, version 2. Hence each source file
+contains its own licensing information.  Source files with no licensing
+information are released under the GNU General Public License, version
+2 or (at your option) any later version.
 
 As of July 2013, contributions under version 2 of the GNU General Public
 License (and no later version) are only accepted for the following files

Paolo


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-02 10:32             ` Paolo Bonzini
  0 siblings, 0 replies; 113+ messages in thread
From: Paolo Bonzini @ 2019-07-02 10:32 UTC (permalink / raw)
  To: Markus Armbruster, Peter Maydell
  Cc: Alistair Francis, qemu-riscv, Jeff Cody, palmer, qemu-devel,
	Stefan Hajnoczi, bmeng.cn

On 02/07/19 06:12, Markus Armbruster wrote:
>> Yeah, if we're not building the apache-2.0 parts then I think
>> we're OK, and as you say there's the question of whether QEMU's
>> GPL affects what we ship as mere bios blobs to run as guest
>> code anyway. But it's sufficiently not a "really obviously ok"
>> that I'd like a second opinion; cc'd some people who might have
>> second opinions.
> 
> You need an expert opinion.
> 
> My non-expert opinion: we can't distribute anything that's not
> compatible with GPLv2

Guest code is not part of QEMU.  We don't say that SeaBIOS, SLOF, etc. 
are part of QEMU; it constitutes mere aggregation with the GPLv2 QEMU 
sources, so it _is_ possible to distribute APSL2 guest code with QEMU.  
IANAL, but I'm fairly sure about this.

However I agree that LICENSE needs to be updated, something like this:

diff --git a/LICENSE b/LICENSE
index 0e0b4b9553..81b9b3572d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,13 +1,18 @@
-The following points clarify the QEMU license:
+The QEMU distribution includes both the QEMU emulator and
+various firmware files.  These are separate programs that are
+distributed together for our users' convenience, and they have
+separate license.
 
-1) QEMU as a whole is released under the GNU General Public License,
-version 2.
+The following points clarify the license of the QEMU emulator:
 
-2) Parts of QEMU have specific licenses which are compatible with the
-GNU General Public License, version 2. Hence each source file contains
-its own licensing information.  Source files with no licensing information
-are released under the GNU General Public License, version 2 or (at your
-option) any later version.
+1) The QEMU emulator as a whole is released under the GNU General
+Public License, version 2.
+
+2) Parts of the QEMU emulator have specific licenses which are compatible
+with the GNU General Public License, version 2. Hence each source file
+contains its own licensing information.  Source files with no licensing
+information are released under the GNU General Public License, version
+2 or (at your option) any later version.
 
 As of July 2013, contributions under version 2 of the GNU General Public
 License (and no later version) are only accepted for the following files

Paolo


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-02 10:32             ` [Qemu-riscv] " Paolo Bonzini
@ 2019-07-02 16:07               ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-02 16:07 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Maydell, qemu-riscv, Jeff Cody, palmer, Markus Armbruster,
	qemu-devel, Alistair Francis, Stefan Hajnoczi, bmeng.cn

On Tue, Jul 2, 2019 at 3:34 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 02/07/19 06:12, Markus Armbruster wrote:
> >> Yeah, if we're not building the apache-2.0 parts then I think
> >> we're OK, and as you say there's the question of whether QEMU's
> >> GPL affects what we ship as mere bios blobs to run as guest
> >> code anyway. But it's sufficiently not a "really obviously ok"
> >> that I'd like a second opinion; cc'd some people who might have
> >> second opinions.
> >
> > You need an expert opinion.
> >
> > My non-expert opinion: we can't distribute anything that's not
> > compatible with GPLv2
>
> Guest code is not part of QEMU.  We don't say that SeaBIOS, SLOF, etc.
> are part of QEMU; it constitutes mere aggregation with the GPLv2 QEMU
> sources, so it _is_ possible to distribute APSL2 guest code with QEMU.
> IANAL, but I'm fairly sure about this.

This is my understanding as well. We aren't linking OpenSBI with QEMU
so we should be fine to release it with any license.

>
> However I agree that LICENSE needs to be updated, something like this:
>
> diff --git a/LICENSE b/LICENSE
> index 0e0b4b9553..81b9b3572d 100644
> --- a/LICENSE
> +++ b/LICENSE
> @@ -1,13 +1,18 @@
> -The following points clarify the QEMU license:
> +The QEMU distribution includes both the QEMU emulator and
> +various firmware files.  These are separate programs that are
> +distributed together for our users' convenience, and they have
> +separate license.
>
> -1) QEMU as a whole is released under the GNU General Public License,
> -version 2.
> +The following points clarify the license of the QEMU emulator:
>
> -2) Parts of QEMU have specific licenses which are compatible with the
> -GNU General Public License, version 2. Hence each source file contains
> -its own licensing information.  Source files with no licensing information
> -are released under the GNU General Public License, version 2 or (at your
> -option) any later version.
> +1) The QEMU emulator as a whole is released under the GNU General
> +Public License, version 2.
> +
> +2) Parts of the QEMU emulator have specific licenses which are compatible
> +with the GNU General Public License, version 2. Hence each source file
> +contains its own licensing information.  Source files with no licensing
> +information are released under the GNU General Public License, version
> +2 or (at your option) any later version.
>
>  As of July 2013, contributions under version 2 of the GNU General Public
>  License (and no later version) are only accepted for the following files

Ok, I'll update the QEMU LICENSE file in the next patch version.

Alistair

>
> Paolo
>


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-02 16:07               ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-02 16:07 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Markus Armbruster, Peter Maydell, qemu-riscv, Jeff Cody, palmer,
	qemu-devel, Alistair Francis, Stefan Hajnoczi, bmeng.cn

On Tue, Jul 2, 2019 at 3:34 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 02/07/19 06:12, Markus Armbruster wrote:
> >> Yeah, if we're not building the apache-2.0 parts then I think
> >> we're OK, and as you say there's the question of whether QEMU's
> >> GPL affects what we ship as mere bios blobs to run as guest
> >> code anyway. But it's sufficiently not a "really obviously ok"
> >> that I'd like a second opinion; cc'd some people who might have
> >> second opinions.
> >
> > You need an expert opinion.
> >
> > My non-expert opinion: we can't distribute anything that's not
> > compatible with GPLv2
>
> Guest code is not part of QEMU.  We don't say that SeaBIOS, SLOF, etc.
> are part of QEMU; it constitutes mere aggregation with the GPLv2 QEMU
> sources, so it _is_ possible to distribute APSL2 guest code with QEMU.
> IANAL, but I'm fairly sure about this.

This is my understanding as well. We aren't linking OpenSBI with QEMU
so we should be fine to release it with any license.

>
> However I agree that LICENSE needs to be updated, something like this:
>
> diff --git a/LICENSE b/LICENSE
> index 0e0b4b9553..81b9b3572d 100644
> --- a/LICENSE
> +++ b/LICENSE
> @@ -1,13 +1,18 @@
> -The following points clarify the QEMU license:
> +The QEMU distribution includes both the QEMU emulator and
> +various firmware files.  These are separate programs that are
> +distributed together for our users' convenience, and they have
> +separate license.
>
> -1) QEMU as a whole is released under the GNU General Public License,
> -version 2.
> +The following points clarify the license of the QEMU emulator:
>
> -2) Parts of QEMU have specific licenses which are compatible with the
> -GNU General Public License, version 2. Hence each source file contains
> -its own licensing information.  Source files with no licensing information
> -are released under the GNU General Public License, version 2 or (at your
> -option) any later version.
> +1) The QEMU emulator as a whole is released under the GNU General
> +Public License, version 2.
> +
> +2) Parts of the QEMU emulator have specific licenses which are compatible
> +with the GNU General Public License, version 2. Hence each source file
> +contains its own licensing information.  Source files with no licensing
> +information are released under the GNU General Public License, version
> +2 or (at your option) any later version.
>
>  As of July 2013, contributions under version 2 of the GNU General Public
>  License (and no later version) are only accepted for the following files

Ok, I'll update the QEMU LICENSE file in the next patch version.

Alistair

>
> Paolo
>


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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-01 18:01         ` [Qemu-riscv] " Peter Maydell
@ 2019-07-04 16:00           ` Stefan Hajnoczi
  -1 siblings, 0 replies; 113+ messages in thread
From: Stefan Hajnoczi @ 2019-07-04 16:00 UTC (permalink / raw)
  To: Alistair Francis, palmer
  Cc: Peter Maydell, qemu-riscv, Jeff Cody, qemu-devel, Paolo Bonzini,
	bmeng.cn

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Mon, Jul 01, 2019 at 07:01:12PM +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
> >
> > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > wrote:
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > Also, new git modules in .gitmodules should be qemu.org
> > > URLs, not random external ones. (ie, we should set up
> > > mirroring of any new external repo we start shipping
> > > code and binaries for). We can set this up and fix up the
> > > gitmodules file after the fact, but the ideal is to do
> > > it in advance rather than afterwards.
> >
> > Ok, who can setup a git mirror for the QEMU repo?
> 
> That would be Jeff or Stefan (cc'd).

Please let me know when you're ready and I'll set up a git mirror.

Your commit can be merged as normal and then I'll send another one
updating it to a git.qemu.org mirror.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-riscv] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-04 16:00           ` Stefan Hajnoczi
  0 siblings, 0 replies; 113+ messages in thread
From: Stefan Hajnoczi @ 2019-07-04 16:00 UTC (permalink / raw)
  To: Alistair Francis, palmer
  Cc: Peter Maydell, qemu-riscv, bmeng.cn, qemu-devel, Eric Blake,
	Paolo Bonzini, Jeff Cody

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Mon, Jul 01, 2019 at 07:01:12PM +0100, Peter Maydell wrote:
> On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
> >
> > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > wrote:
> > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > Also, new git modules in .gitmodules should be qemu.org
> > > URLs, not random external ones. (ie, we should set up
> > > mirroring of any new external repo we start shipping
> > > code and binaries for). We can set this up and fix up the
> > > gitmodules file after the fact, but the ideal is to do
> > > it in advance rather than afterwards.
> >
> > Ok, who can setup a git mirror for the QEMU repo?
> 
> That would be Jeff or Stefan (cc'd).

Please let me know when you're ready and I'll set up a git mirror.

Your commit can be merged as normal and then I'll send another one
updating it to a git.qemu.org mirror.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
  2019-07-04 16:00           ` [Qemu-riscv] " Stefan Hajnoczi
@ 2019-07-04 19:35             ` Alistair Francis
  -1 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-04 19:35 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Peter Maydell, qemu-riscv, Jeff Cody, palmer, qemu-devel,
	Alistair Francis, Paolo Bonzini, bmeng.cn

On Thu, Jul 4, 2019 at 9:11 AM Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Mon, Jul 01, 2019 at 07:01:12PM +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
> > >
> > > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > > wrote:
> > > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > Also, new git modules in .gitmodules should be qemu.org
> > > > URLs, not random external ones. (ie, we should set up
> > > > mirroring of any new external repo we start shipping
> > > > code and binaries for). We can set this up and fix up the
> > > > gitmodules file after the fact, but the ideal is to do
> > > > it in advance rather than afterwards.
> > >
> > > Ok, who can setup a git mirror for the QEMU repo?
> >
> > That would be Jeff or Stefan (cc'd).
>
> Please let me know when you're ready and I'll set up a git mirror.

I'm ready whenever. We have a long weekend here so I'll be back at
work on Monday and send the new version of the patch with version 0.4
of OpenSBI.

>
> Your commit can be merged as normal and then I'll send another one
> updating it to a git.qemu.org mirror.

Works for me. If the mirror is setup by Monday I will use it in the
first commit as well.

Thanks for helping with this Stefan

Alistair

>
> Stefan


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3
@ 2019-07-04 19:35             ` Alistair Francis
  0 siblings, 0 replies; 113+ messages in thread
From: Alistair Francis @ 2019-07-04 19:35 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Alistair Francis, palmer, Peter Maydell, qemu-riscv, Jeff Cody,
	qemu-devel, Paolo Bonzini, bmeng.cn

On Thu, Jul 4, 2019 at 9:11 AM Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Mon, Jul 01, 2019 at 07:01:12PM +0100, Peter Maydell wrote:
> > On Mon, 1 Jul 2019 at 18:50, Alistair Francis <Alistair.Francis@wdc.com> wrote:
> > >
> > > On Mon, 2019-07-01 at 17:54 +0100, Peter Maydell wrote:
> > > > On Thu, 27 Jun 2019 at 16:24, Palmer Dabbelt <palmer@sifive.com>
> > > > wrote:
> > > > > From: Alistair Francis <alistair.francis@wdc.com>
> > > > Also, new git modules in .gitmodules should be qemu.org
> > > > URLs, not random external ones. (ie, we should set up
> > > > mirroring of any new external repo we start shipping
> > > > code and binaries for). We can set this up and fix up the
> > > > gitmodules file after the fact, but the ideal is to do
> > > > it in advance rather than afterwards.
> > >
> > > Ok, who can setup a git mirror for the QEMU repo?
> >
> > That would be Jeff or Stefan (cc'd).
>
> Please let me know when you're ready and I'll set up a git mirror.

I'm ready whenever. We have a long weekend here so I'll be back at
work on Monday and send the new version of the patch with version 0.4
of OpenSBI.

>
> Your commit can be merged as normal and then I'll send another one
> updating it to a git.qemu.org mirror.

Works for me. If the mirror is setup by Monday I will use it in the
first commit as well.

Thanks for helping with this Stefan

Alistair

>
> Stefan


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

* Re: [Qemu-devel] [Qemu-riscv] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
  2019-06-27 18:23       ` [Qemu-riscv] [Qemu-devel] " Richard Henderson
@ 2019-07-08 12:46         ` Palmer Dabbelt
  -1 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-07-08 12:46 UTC (permalink / raw)
  To: richard.henderson
  Cc: Peter Maydell, qemu-riscv, qemu-devel, fintelia,
	Alistair Francis, Hesham.Almatary

On Thu, 27 Jun 2019 11:23:20 PDT (-0700), richard.henderson@linaro.org wrote:
> On 6/27/19 7:44 PM, Jonathan Behrens wrote:
>> I think this patch is slightly incorrect. If the PMP region is valid for
>> the size of the access, but not the rest of the page then a few lines down
>> in this function the entire page should not be placed into the TLB. Instead
>> only the portion of the page that passed the access check should be
>> included. To give an example of where this goes wrong, in the code below
>> access to address 0x90000008 should always fail due to PMP rules, but if
>> the TLB has already been primed by loading the (allowed) address 0x90000000
>> then no fault will be triggered. Notably, this code also executes
>> improperly without the patch because the first `ld` instruction traps when
>> it shouldn't.
>>
>>   li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
>>   csrw pmpaddr0, t0
>>
>>   li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
>>   csrw pmpaddr1, t0
>>
>>   li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
>>   csrw pmpcfg0, t0
>>
>>   sfence.vma
>>
>>   li t0, 0x90000000
>>   ld s0, 0(t0)
>>   ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!
>
> Nice test case.
>
>> I think that the proper fix would be to first do a PMP check for the full
>> PAGE_SIZE and execute normally if it passes. Then in the event the full
>> page fails, there could be a more granular PMP check with only the accessed
>> region inserted as an entry in the TLB.
>
> This feature looks to be almost identical to the ARM m-profile MPU.
>
> The fix is:
>
> If the PMP check is valid for the entire page, then continue to call
> tlb_set_page with size=TARGET_PAGE_SIZE.
>
> If the PMP check is valid for the current access, but not for the entire page,
> then call tlb_set_page with any size < TARGET_PAGE_SIZE.  This change alone is
> sufficient, even though the full argument tuple (paddr, vaddr, size) no longer
> quite make perfect sense.  (For the arm mpu, we compute some 1 << rsize, but
> the actual value is never used; setting size=1 would be sufficient.)
>
> Any size < TARGET_PAGE_SIZE will cause TLB_RECHECK to be set for the page,
> which will force all accesses to the page to go back through riscv_cpu_tlb_fill
> for re-validation.

RISC-V allows another option: support for fine-grained PMPs is optional, which
allows implementations ignore this issue to save on hardware costs.  It looks
like Rocket leaves this as a parameter

   https://github.com/chipsalliance/rocket-chip/blob/master/src/main/scala/rocket/TLB.scala#L159

but our implementations always have page-granularity PMPs if virtual memory is
supported.

Unless anyone objects, I'll restrict the PMP granularity to 4K on all systems
that support virtual memory as a bug fix.  We can add the configuration option
in as a feature.

>> Unrelated question: should I be sending "Reviewed By" lines if I read
>> through patches that seem reasonable? Or there some formal process I'd have
>> to go through first to be approved?
>
> No formal process.  More eyes are always welcome.
>
>
> r~


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

* Re: [Qemu-riscv] [Qemu-devel] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size
@ 2019-07-08 12:46         ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-07-08 12:46 UTC (permalink / raw)
  To: richard.henderson
  Cc: fintelia, Peter Maydell, Hesham.Almatary, Alistair Francis,
	qemu-riscv, qemu-devel

On Thu, 27 Jun 2019 11:23:20 PDT (-0700), richard.henderson@linaro.org wrote:
> On 6/27/19 7:44 PM, Jonathan Behrens wrote:
>> I think this patch is slightly incorrect. If the PMP region is valid for
>> the size of the access, but not the rest of the page then a few lines down
>> in this function the entire page should not be placed into the TLB. Instead
>> only the portion of the page that passed the access check should be
>> included. To give an example of where this goes wrong, in the code below
>> access to address 0x90000008 should always fail due to PMP rules, but if
>> the TLB has already been primed by loading the (allowed) address 0x90000000
>> then no fault will be triggered. Notably, this code also executes
>> improperly without the patch because the first `ld` instruction traps when
>> it shouldn't.
>>
>>   li t0, 0x0000000024000000 // region[0]: 0x90000000..0x90000007
>>   csrw pmpaddr0, t0
>>
>>   li t0, 0x00000000240001FF // region[1]: 0x90000000..0x90000fff
>>   csrw pmpaddr1, t0
>>
>>   li t0, 0x1F0000000000989F // cfg[0] = LXRW, cfg[1] = L
>>   csrw pmpcfg0, t0
>>
>>   sfence.vma
>>
>>   li t0, 0x90000000
>>   ld s0, 0(t0)
>>   ld s1, 8(t0) // NO TRAP: address is incorrectly in TLB!
>
> Nice test case.
>
>> I think that the proper fix would be to first do a PMP check for the full
>> PAGE_SIZE and execute normally if it passes. Then in the event the full
>> page fails, there could be a more granular PMP check with only the accessed
>> region inserted as an entry in the TLB.
>
> This feature looks to be almost identical to the ARM m-profile MPU.
>
> The fix is:
>
> If the PMP check is valid for the entire page, then continue to call
> tlb_set_page with size=TARGET_PAGE_SIZE.
>
> If the PMP check is valid for the current access, but not for the entire page,
> then call tlb_set_page with any size < TARGET_PAGE_SIZE.  This change alone is
> sufficient, even though the full argument tuple (paddr, vaddr, size) no longer
> quite make perfect sense.  (For the arm mpu, we compute some 1 << rsize, but
> the actual value is never used; setting size=1 would be sufficient.)
>
> Any size < TARGET_PAGE_SIZE will cause TLB_RECHECK to be set for the page,
> which will force all accesses to the page to go back through riscv_cpu_tlb_fill
> for re-validation.

RISC-V allows another option: support for fine-grained PMPs is optional, which
allows implementations ignore this issue to save on hardware costs.  It looks
like Rocket leaves this as a parameter

   https://github.com/chipsalliance/rocket-chip/blob/master/src/main/scala/rocket/TLB.scala#L159

but our implementations always have page-granularity PMPs if virtual memory is
supported.

Unless anyone objects, I'll restrict the PMP granularity to 4K on all systems
that support virtual memory as a bug fix.  We can add the configuration option
in as a feature.

>> Unrelated question: should I be sending "Reviewed By" lines if I read
>> through patches that seem reasonable? Or there some formal process I'd have
>> to go through first to be approved?
>
> No formal process.  More eyes are always welcome.
>
>
> r~


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

* [Qemu-devel] [PULL 24/34] RISC-V: Update syscall list for 32-bit support.
  2019-06-28 17:31 [Qemu-devel] [PULL] RISC-V Patches for the 4.1 Soft Freeze, Part 2 v2 Palmer Dabbelt
@ 2019-06-28 17:32 ` Palmer Dabbelt
  0 siblings, 0 replies; 113+ messages in thread
From: Palmer Dabbelt @ 2019-06-28 17:32 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Laurent Vivier, Palmer Dabbelt, qemu-riscv, qemu-devel, Jim Wilson

From: Jim Wilson <jimw@sifive.com>

32-bit RISC-V uses _llseek instead of lseek as syscall number 62.
Update syscall list from open-embedded build, primarily because
32-bit RISC-V requires statx support.

Tested with cross gcc testsuite runs for rv32 and rv64, with the
pending statx patch also applied.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 linux-user/riscv/syscall_nr.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h
index dab6509e3ade..5c8728220994 100644
--- a/linux-user/riscv/syscall_nr.h
+++ b/linux-user/riscv/syscall_nr.h
@@ -72,7 +72,11 @@
 #define TARGET_NR_pipe2 59
 #define TARGET_NR_quotactl 60
 #define TARGET_NR_getdents64 61
+#ifdef TARGET_RISCV32
+#define TARGET_NR__llseek 62
+#else
 #define TARGET_NR_lseek 62
+#endif
 #define TARGET_NR_read 63
 #define TARGET_NR_write 64
 #define TARGET_NR_readv 65
@@ -286,7 +290,16 @@
 #define TARGET_NR_membarrier 283
 #define TARGET_NR_mlock2 284
 #define TARGET_NR_copy_file_range 285
+#define TARGET_NR_preadv2 286
+#define TARGET_NR_pwritev2 287
+#define TARGET_NR_pkey_mprotect 288
+#define TARGET_NR_pkey_alloc 289
+#define TARGET_NR_pkey_free 290
+#define TARGET_NR_statx 291
+#define TARGET_NR_io_pgetevents 292
+#define TARGET_NR_rseq 293
+#define TARGET_NR_kexec_file_load 294
 
-#define TARGET_NR_syscalls (TARGET_NR_copy_file_range + 1)
+#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
 
 #endif
-- 
2.21.0



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

end of thread, other threads:[~2019-07-08 12:48 UTC | newest]

Thread overview: 113+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 15:19 [Qemu-devel] [PULL] RISC-V Patches for the 4.1 Soft Freeze, Part 2 Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 01/34] target/riscv: Allow setting ISA extensions via CPU props Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 02/34] sifive_prci: Read and write PRCI registers Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 03/34] target/riscv: Fix PMP range boundary address bug Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 04/34] target/riscv: Implement riscv_cpu_unassigned_access Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 05/34] RISC-V: Only Check PMP if MMU translation succeeds Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 06/34] RISC-V: Raise access fault exceptions on PMP violations Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 07/34] RISC-V: Check for the effective memory privilege mode during PMP checks Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 08/34] RISC-V: Check PMP during Page Table Walks Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 09/34] RISC-V: Fix a PMP bug where it succeeds even if PMP entry is off Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 10/34] RISC-V: Fix a PMP check with the correct access size Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 17:44   ` [Qemu-devel] " Jonathan Behrens
2019-06-27 17:44     ` Jonathan Behrens
2019-06-27 18:23     ` [Qemu-devel] " Richard Henderson
2019-06-27 18:23       ` [Qemu-riscv] [Qemu-devel] " Richard Henderson
2019-07-08 12:46       ` [Qemu-devel] [Qemu-riscv] " Palmer Dabbelt
2019-07-08 12:46         ` [Qemu-riscv] [Qemu-devel] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 11/34] riscv: virt: Correct pci "bus-range" encoding Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 12/34] RISC-V: Fix a memory leak when realizing a sifive_e Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 13/34] target/riscv: Restructure deprecatd CPUs Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 14/34] target/riscv: Add the privledge spec version 1.11.0 Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 15/34] target/riscv: Add the mcountinhibit CSR Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 16/34] target/riscv: Set privledge spec 1.11.0 as default Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 17/34] qemu-deprecated.texi: Deprecate the RISC-V privledge spec 1.09.1 Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 18/34] target/riscv: Require either I or E base extension Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 19/34] target/riscv: Remove user version information Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 20/34] target/riscv: Add support for disabling/enabling Counters Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 21/34] RISC-V: Add support for the Zifencei extension Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:19 ` [Qemu-devel] [PULL 22/34] RISC-V: Add support for the Zicsr extension Palmer Dabbelt
2019-06-27 15:19   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 23/34] RISC-V: Clear load reservations on context switch and SC Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 24/34] RISC-V: Update syscall list for 32-bit support Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 25/34] riscv: virt: Add cpu-topology DT node Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 26/34] disas/riscv: Disassemble reserved compressed encodings as illegal Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 27/34] disas/riscv: Fix `rdinstreth` constraint Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 28/34] riscv: sifive_u: Do not create hard-coded phandles in DT Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 29/34] riscv: sifive_u: Update the plic hart config to support multicore Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 30/34] hw/riscv: Split out the boot functions Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 31/34] hw/riscv: Add support for loading a firmware Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 32/34] hw/riscv: Extend the kernel loading support Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-27 15:20 ` [Qemu-devel] [PULL 33/34] roms: Add OpenSBI version 0.3 Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-28  9:46   ` [Qemu-devel] " Jonathan Cameron
2019-06-28  9:46     ` [Qemu-riscv] " Jonathan Cameron
2019-06-28 16:12     ` Alistair Francis
2019-06-28 16:12       ` [Qemu-riscv] " Alistair Francis
2019-06-28 17:10       ` Palmer Dabbelt
2019-06-28 17:10         ` [Qemu-riscv] " Palmer Dabbelt
2019-07-01 12:40       ` Jonathan Cameron
2019-07-01 12:40         ` [Qemu-riscv] " Jonathan Cameron
2019-07-01 13:23         ` [Qemu-devel] [Qemu-riscv] " Anup Patel
2019-07-01 13:23           ` [Qemu-riscv] [Qemu-devel] " Anup Patel
2019-07-01 16:39           ` [Qemu-devel] [Qemu-riscv] " Alistair Francis
2019-07-01 16:39             ` [Qemu-riscv] [Qemu-devel] " Alistair Francis
2019-07-01 16:54   ` Peter Maydell
2019-07-01 16:54     ` [Qemu-riscv] " Peter Maydell
2019-07-01 17:50     ` [Qemu-devel] " Alistair Francis
2019-07-01 17:50       ` [Qemu-riscv] " Alistair Francis
2019-07-01 18:01       ` [Qemu-devel] " Peter Maydell
2019-07-01 18:01         ` [Qemu-riscv] " Peter Maydell
2019-07-01 18:09         ` [Qemu-devel] " Alistair Francis
2019-07-01 18:09           ` [Qemu-riscv] " Alistair Francis
2019-07-01 18:13           ` [Qemu-devel] " Peter Maydell
2019-07-01 18:13             ` [Qemu-riscv] " Peter Maydell
2019-07-01 18:19             ` [Qemu-devel] " Alistair Francis
2019-07-01 18:19               ` [Qemu-riscv] " Alistair Francis
2019-07-02  7:02               ` [Qemu-devel] " Anup Patel
2019-07-02  7:02                 ` Anup Patel
2019-07-02  4:12         ` [Qemu-devel] " Markus Armbruster
2019-07-02  4:12           ` [Qemu-riscv] " Markus Armbruster
2019-07-02 10:32           ` Paolo Bonzini
2019-07-02 10:32             ` [Qemu-riscv] " Paolo Bonzini
2019-07-02 16:07             ` Alistair Francis
2019-07-02 16:07               ` [Qemu-riscv] " Alistair Francis
2019-07-04 16:00         ` Stefan Hajnoczi
2019-07-04 16:00           ` [Qemu-riscv] " Stefan Hajnoczi
2019-07-04 19:35           ` [Qemu-devel] " Alistair Francis
2019-07-04 19:35             ` [Qemu-riscv] " Alistair Francis
2019-06-27 15:20 ` [Qemu-devel] [PULL 34/34] hw/riscv: Load OpenSBI as the default firmware Palmer Dabbelt
2019-06-27 15:20   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-28 17:31 [Qemu-devel] [PULL] RISC-V Patches for the 4.1 Soft Freeze, Part 2 v2 Palmer Dabbelt
2019-06-28 17:32 ` [Qemu-devel] [PULL 24/34] RISC-V: Update syscall list for 32-bit support Palmer Dabbelt

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.