Skip to contentSkip to conversation

RISC-V: QEMU 2.13 Minor Fixes

GIT PULL Michael Clark 2 participants 6 messages May 7, 2018 – May 8, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

The following changes since commit c8b7e627b4269a3bc3ae41d9f420547a47e6d9b9:

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-05-04' into staging (2018-05-04 14:42:46 +0100)

are available in the git repository at:

https://github.com/riscv/riscv-qemu.git tags/riscv-qemu-2.13-minor-fixes-1

for you to fetch changes up to d4a63373c0e6349c6f36f56a6290ad639bfa20cb:

riscv: requires libfdt (2018-05-08 10:57:21 +1200)

----------------------------------------------------------------
RISC-V: QEMU 2.13 Minor Fixes

* Require libfdt when configuring for 'riscv*-softmmu'
* Increase HTIF priority and allow zero address

----------------------------------------------------------------
KONRAD Frederic (3):
riscv: spike: allow base == 0
riscv: htif: increase the priority of the htif subregion
riscv: requires libfdt

 configure             |  2 +-
 hw/riscv/riscv_htif.c | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.0
#1 lore raw

[Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0

From: KONRAD Frederic <[email protected]>

The sanity check on base doesn't allow htif to be mapped @0. Check if the symbol exists instead so we can map it where we want.

Message-Id: <[email protected]>

---
 hw/riscv/riscv_htif.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/riscv/riscv_htif.c +5 -2
index 3e17f3025106..be252ec8cce9 100644
@@ -41,17 +41,20 @@
     } while (0)
 
 static uint64_t fromhost_addr, tohost_addr;
+static int address_symbol_set;
 
 void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value,
-    uint64_t st_size)
+                          uint64_t st_size)
 {
     if (strcmp("fromhost", st_name) == 0) {
+        address_symbol_set |= 1;
         fromhost_addr = st_value;
         if (st_size != 8) {
             error_report("HTIF fromhost must be 8 bytes");
             exit(1);
         }
     } else if (strcmp("tohost", st_name) == 0) {
+        address_symbol_set |= 2;
         tohost_addr = st_value;
         if (st_size != 8) {
             error_report("HTIF tohost must be 8 bytes");
@@ -248,7 +251,7 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
     qemu_chr_fe_init(&s->chr, chr, &error_abort);
     qemu_chr_fe_set_handlers(&s->chr, htif_can_recv, htif_recv, htif_event,
         htif_be_change, s, NULL, true);
-    if (base) {
+    if (address_symbol_set == 3) {
         memory_region_init_io(&s->mmio, NULL, &htif_mm_ops, s,
                             TYPE_HTIF_UART, size);
         memory_region_add_subregion(address_space, base, &s->mmio);
Signature · 1 line
2.7.0
#2 lore raw

[Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion

In reply to Michael Clark

From: KONRAD Frederic <[email protected]>

The htif device is supposed to be mapped over an other subregion. So increase its priority to one to avoid any conflict.

Here is the output of info mtree:

Before:
(qemu) info mtree
address-space: memory
0000000000000000-ffffffffffffffff (prio 0, i/o): system

     0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart
     0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
     0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
     0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram

address-space: I/O
0000000000000000-000000000000ffff (prio 0, i/o): io

address-space: cpu-memory-0
0000000000000000-ffffffffffffffff (prio 0, i/o): system

     0000000000000000-000000000000000f (prio 0, i/o): riscv.htif.uart
     0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
     0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
     0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram

After:
(qemu) info mtree
address-space: memory
0000000000000000-ffffffffffffffff (prio 0, i/o): system

     0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart
     0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
     0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
     0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram

address-space: I/O
0000000000000000-000000000000ffff (prio 0, i/o): io

address-space: cpu-memory-0
0000000000000000-ffffffffffffffff (prio 0, i/o): system

     0000000000000000-000000000000000f (prio 1, i/o): riscv.htif.uart
     0000000000000000-0000000000011fff (prio 0, ram): riscv.spike.bootrom
     0000000002000000-000000000200ffff (prio 0, i/o): riscv.sifive.clint
     0000000080000000-0000000087ffffff (prio 0, ram): riscv.spike.ram

Message-Id: <[email protected]>

---
 hw/riscv/riscv_htif.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/riscv/riscv_htif.c +3 -2
index be252ec8cce9..f73512941fb6 100644
@@ -253,8 +253,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
         htif_be_change, s, NULL, true);
     if (address_symbol_set == 3) {
         memory_region_init_io(&s->mmio, NULL, &htif_mm_ops, s,
-                            TYPE_HTIF_UART, size);
-        memory_region_add_subregion(address_space, base, &s->mmio);
+                              TYPE_HTIF_UART, size);
+        memory_region_add_subregion_overlap(address_space, base,
+                                            &s->mmio, 1);
     }
 
     return s;
Signature · 1 line
2.7.0
#3 lore raw

[Qemu-devel] [PULL 3/3] riscv: requires libfdt

In reply to Michael Clark

From: KONRAD Frederic <[email protected]>

When compiling on a machine without libfdt installed the configure script should try to get libfdt from the git or should die because otherwise CONFIG_LIBFDT is not set and the build process end in an error in the link phase.. eg:

hw/riscv/virt.o: In function `riscv_virt_board_init':
qemu/src/hw/riscv/virt.c:317: undefined reference to qemu_fdt_setprop_cell' qemu/src/hw/riscv/virt.c:319: undefined reference to qemu_fdt_setprop_cell' qemu/src/hw/riscv/virt.c:345: undefined reference to `qemu_fdt_dumpdtb'
collect2: error: ld returned 1 exit status
make[1]: *** [qemu-system-riscv64] Error 1
make: *** [subdir-riscv64-softmmu] Error 2

Message-Id: <[email protected]>

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 1443422e83f1..479e9a787e6e 100755
@@ -3761,7 +3761,7 @@ fi
 fdt_required=no
 for target in $target_list; do
   case $target in
-    aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu)
+    aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu)
       fdt_required=yes
     ;;
   esac
Signature · 1 line
2.7.0
#4 lore raw
In reply to Michael Clark
Quoted 15 lines · Michael Clark

The following changes since commit c8b7e627b4269a3bc3ae41d9f420547a47e6d9b9:

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-05-04' into staging (2018-05-04 14:42:46 +0100)

are available in the git repository at:

https://github.com/riscv/riscv-qemu.git tags/riscv-qemu-2.13-minor-fixes-1

for you to fetch changes up to d4a63373c0e6349c6f36f56a6290ad639bfa20cb:

riscv: requires libfdt (2018-05-08 10:57:21 +1200)

----------------------------------------------------------------
RISC-V: QEMU 2.13 Minor Fixes

Quoted 8 lines

* Require libfdt when configuring for 'riscv*-softmmu'
* Increase HTIF priority and allow zero address

----------------------------------------------------------------
KONRAD Frederic (3):
riscv: spike: allow base == 0
riscv: htif: increase the priority of the htif subregion
riscv: requires libfdt

Hi Michael -- these patches from Fred need your Signed-off-by:
line in the commit messages as well as his. (This indicates that they've passed through your hands to get to master; see item 3 in https://wiki.qemu.org/Contribute/SubmitAPullRequest )

I did a build test and they passed that fine, so if you can just respin this pullreq with the signoff lines added to each commit message I should be able to apply it.

thanks
-- PMM

#5 lore raw
Quoted 28 lines · Peter Maydell
Quoted 1 line · Michael Clark

The following changes since commit c8b7e627b4269a3bc3ae41d9f42054

7a47e6d9b9:

Quoted 2 lines

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-05-04'

into staging (2018-05-04 14:42:46 +0100)

Quoted 4 lines

are available in the git repository at:

https://github.com/riscv/riscv-qemu.git tags/riscv-qemu-2.13-minor-

fixes-1

Quoted 8 lines

for you to fetch changes up to d4a63373c0e6349c6f36f56a6290ad639bfa20cb:

riscv: requires libfdt (2018-05-08 10:57:21 +1200)

----------------------------------------------------------------
RISC-V: QEMU 2.13 Minor Fixes

Quoted 8 lines

* Require libfdt when configuring for 'riscv*-softmmu'
* Increase HTIF priority and allow zero address

----------------------------------------------------------------
KONRAD Frederic (3):
riscv: spike: allow base == 0
riscv: htif: increase the priority of the htif subregion
riscv: requires libfdt

Quoted 5 lines

Hi Michael -- these patches from Fred need your Signed-off-by:
line in the commit messages as well as his. (This indicates that they've passed through your hands to get to master; see item 3 in https://wiki.qemu.org/Contribute/SubmitAPullRequest )

I was thinking about that but was not sure. This is my first pull with changes that originated outside the riscv tree.

Quoted 4 lines

I did a build test and they passed that fine, so if you can just respin this pullreq with the signoff lines added to each commit message I should be able to apply it.

Okay, thanks. I've boot tested Linux kernel in the 'spike' machines. These changes are very low risk. I'll respin with my "Signed-off-by" added.

The configure libfdt patch is the main one to cherry-pick for 2.12.1, however, the other changes are innocuous enough if you want to merge the whole PR to stable, as there are 3 commits. BTW I still need to test 'sifive_u' in stable 2.12.0 to figure out the changes that need to be cherry-picked or I can backport changes if necessary.