* [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
@ 2018-05-08 20:07 Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-08 20:07 UTC (permalink / raw)
To: qemu-devel, Peter Maydell, qemu-stable
Cc: patches, Michael Clark, Alistair Francis, KONRAD Frederic,
Palmer Dabbelt, Sagar Karandikar, Bastian Koppelmann
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-2
for you to fetch changes up to fc28db142ea9331d24d08a6418efa93e258a6876:
riscv: requires libfdt (2018-05-09 07:57:57 +1200)
----------------------------------------------------------------
RISC-V: QEMU 2.13 Minor Fixes
* Require libfdt when configuring for 'riscv*-softmmu'
* Increase HTIF priority and allow zero base address
Consider backporting to stable branch for 2.12.1
----------------------------------------------------------------
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(-)
--
2.7.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0
2018-05-08 20:07 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
@ 2018-05-08 20:07 ` Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion Michael Clark
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-08 20:07 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, KONRAD Frederic, Michael Clark
From: KONRAD Frederic <frederic.konrad@adacore.com>
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.
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Message-Id: <1525360636-18229-2-git-send-email-frederic.konrad@adacore.com>
---
hw/riscv/riscv_htif.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index 3e17f3025106..be252ec8cce9 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -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);
--
2.7.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion
2018-05-08 20:07 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
@ 2018-05-08 20:07 ` Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 3/3] riscv: requires libfdt Michael Clark
2018-05-08 20:49 ` [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Peter Maydell
3 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-08 20:07 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, KONRAD Frederic, Michael Clark
From: KONRAD Frederic <frederic.konrad@adacore.com>
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
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Message-Id: <1525360636-18229-3-git-send-email-frederic.konrad@adacore.com>
---
hw/riscv/riscv_htif.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index be252ec8cce9..f73512941fb6 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -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;
--
2.7.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 3/3] riscv: requires libfdt
2018-05-08 20:07 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion Michael Clark
@ 2018-05-08 20:07 ` Michael Clark
2018-05-08 20:49 ` [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Peter Maydell
3 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-08 20:07 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, KONRAD Frederic, Michael Clark
From: KONRAD Frederic <frederic.konrad@adacore.com>
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
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Message-Id: <1525360636-18229-4-git-send-email-frederic.konrad@adacore.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 1443422e83f1..479e9a787e6e 100755
--- a/configure
+++ b/configure
@@ -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
--
2.7.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
2018-05-08 20:07 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
` (2 preceding siblings ...)
2018-05-08 20:07 ` [Qemu-devel] [PULL 3/3] riscv: requires libfdt Michael Clark
@ 2018-05-08 20:49 ` Peter Maydell
2018-05-08 22:05 ` Michael Clark
3 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2018-05-08 20:49 UTC (permalink / raw)
To: Michael Clark
Cc: QEMU Developers, qemu-stable, RISC-V Patches, Alistair Francis,
KONRAD Frederic, Palmer Dabbelt, Sagar Karandikar,
Bastian Koppelmann
On 8 May 2018 at 21:07, Michael Clark <mjc@sifive.com> wrote:
> 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-2
>
> for you to fetch changes up to fc28db142ea9331d24d08a6418efa93e258a6876:
>
> riscv: requires libfdt (2018-05-09 07:57:57 +1200)
>
> ----------------------------------------------------------------
> RISC-V: QEMU 2.13 Minor Fixes
>
> * Require libfdt when configuring for 'riscv*-softmmu'
> * Increase HTIF priority and allow zero base address
>
> Consider backporting to stable branch for 2.12.1
Ah, if you want something flagged to be backported to
the stable branch, the way to do that is to include
the line "Cc: qemu-stable@nongnu.org" in the commit
message. We use the same approach for flagging things
for stable as the Linux kernel. (Individual submaintainers
are generally in the best position to decide whether
something should go into stable, and this system leaves
that choice up to them. A patch submitter can also suggest
something for stable when you submit the initial patch for
review by adding the Cc: line and cc'ing qemu-stable on the
patchmail.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
2018-05-08 20:49 ` [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Peter Maydell
@ 2018-05-08 22:05 ` Michael Clark
2018-05-09 11:14 ` Peter Maydell
0 siblings, 1 reply; 10+ messages in thread
From: Michael Clark @ 2018-05-08 22:05 UTC (permalink / raw)
To: Peter Maydell
Cc: QEMU Developers, qemu-stable, RISC-V Patches, Alistair Francis,
KONRAD Frederic, Palmer Dabbelt, Sagar Karandikar,
Bastian Koppelmann
On Wed, May 9, 2018 at 8:49 AM, Peter Maydell <peter.maydell@linaro.org>
wrote:
> On 8 May 2018 at 21:07, Michael Clark <mjc@sifive.com> wrote:
> > The following changes since commit c8b7e627b4269a3bc3ae41d9f42054
> 7a47e6d9b9:
> >
> > 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-2
> >
> > for you to fetch changes up to fc28db142ea9331d24d08a6418efa93e258a6876:
> >
> > riscv: requires libfdt (2018-05-09 07:57:57 +1200)
> >
> > ----------------------------------------------------------------
> > RISC-V: QEMU 2.13 Minor Fixes
> >
> > * Require libfdt when configuring for 'riscv*-softmmu'
> > * Increase HTIF priority and allow zero base address
> >
> > Consider backporting to stable branch for 2.12.1
>
> Ah, if you want something flagged to be backported to
> the stable branch, the way to do that is to include
> the line "Cc: qemu-stable@nongnu.org" in the commit
> message. We use the same approach for flagging things
> for stable as the Linux kernel. (Individual submaintainers
> are generally in the best position to decide whether
> something should go into stable, and this system leaves
> that choice up to them. A patch submitter can also suggest
> something for stable when you submit the initial patch for
> review by adding the Cc: line and cc'ing qemu-stable on the
> patchmail.)
>
Okay. Given the 'Cc is missing in the commit (only on the cover) I could
send a separate patch.
Or I can respin with the 'Cc on the configure libfdt dependency fix commit
and remove the backport message from the tag...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
2018-05-08 22:05 ` Michael Clark
@ 2018-05-09 11:14 ` Peter Maydell
2018-05-09 14:37 ` Michael Clark
0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2018-05-09 11:14 UTC (permalink / raw)
To: Michael Clark
Cc: QEMU Developers, qemu-stable, RISC-V Patches, Alistair Francis,
KONRAD Frederic, Palmer Dabbelt, Sagar Karandikar,
Bastian Koppelmann
On 8 May 2018 at 23:05, Michael Clark <mjc@sifive.com> wrote:
>
>
> On Wed, May 9, 2018 at 8:49 AM, Peter Maydell <peter.maydell@linaro.org>
> wrote:
>>
>> On 8 May 2018 at 21:07, Michael Clark <mjc@sifive.com> wrote:
>> > 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-2
>> >
>> > for you to fetch changes up to fc28db142ea9331d24d08a6418efa93e258a6876:
>> >
>> > riscv: requires libfdt (2018-05-09 07:57:57 +1200)
>> >
>> > ----------------------------------------------------------------
>> > RISC-V: QEMU 2.13 Minor Fixes
>> >
>> > * Require libfdt when configuring for 'riscv*-softmmu'
>> > * Increase HTIF priority and allow zero base address
>> >
>> > Consider backporting to stable branch for 2.12.1
>>
>> Ah, if you want something flagged to be backported to
>> the stable branch, the way to do that is to include
>> the line "Cc: qemu-stable@nongnu.org" in the commit
>> message. We use the same approach for flagging things
>> for stable as the Linux kernel. (Individual submaintainers
>> are generally in the best position to decide whether
>> something should go into stable, and this system leaves
>> that choice up to them. A patch submitter can also suggest
>> something for stable when you submit the initial patch for
>> review by adding the Cc: line and cc'ing qemu-stable on the
>> patchmail.)
>
>
> Okay. Given the 'Cc is missing in the commit (only on the cover) I could
> send a separate patch.
>
> Or I can respin with the 'Cc on the configure libfdt dependency fix commit
> and remove the backport message from the tag...
Tag messages are just informational (we use them to help
in writing up the changelog for releases), mostly. So I
would recommend respinning the pullreq with the Cc: line
in the relevant commit(s).
thanks
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
2018-05-09 11:14 ` Peter Maydell
@ 2018-05-09 14:37 ` Michael Clark
0 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-09 14:37 UTC (permalink / raw)
To: Peter Maydell
Cc: Alistair Francis, Bastian Koppelmann, KONRAD Frederic,
Palmer Dabbelt, QEMU Developers, RISC-V Patches, Sagar Karandikar,
qemu-stable
On Wed, 9 May 2018 at 11:14 PM, Peter Maydell <peter.maydell@linaro.org>
wrote:
> On 8 May 2018 at 23:05, Michael Clark <mjc@sifive.com> wrote:
> >
> >
> > On Wed, May 9, 2018 at 8:49 AM, Peter Maydell <peter.maydell@linaro.org>
> > wrote:
> >>
> >> On 8 May 2018 at 21:07, Michael Clark <mjc@sifive.com> wrote:
> >> > 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-2
> >> >
> >> > for you to fetch changes up to
> fc28db142ea9331d24d08a6418efa93e258a6876:
> >> >
> >> > riscv: requires libfdt (2018-05-09 07:57:57 +1200)
> >> >
> >> > ----------------------------------------------------------------
> >> > RISC-V: QEMU 2.13 Minor Fixes
> >> >
> >> > * Require libfdt when configuring for 'riscv*-softmmu'
> >> > * Increase HTIF priority and allow zero base address
> >> >
> >> > Consider backporting to stable branch for 2.12.1
> >>
> >> Ah, if you want something flagged to be backported to
> >> the stable branch, the way to do that is to include
> >> the line "Cc: qemu-stable@nongnu.org" in the commit
> >> message. We use the same approach for flagging things
> >> for stable as the Linux kernel. (Individual submaintainers
> >> are generally in the best position to decide whether
> >> something should go into stable, and this system leaves
> >> that choice up to them. A patch submitter can also suggest
> >> something for stable when you submit the initial patch for
> >> review by adding the Cc: line and cc'ing qemu-stable on the
> >> patchmail.)
> >
> >
> > Okay. Given the 'Cc is missing in the commit (only on the cover) I could
> > send a separate patch.
> >
> > Or I can respin with the 'Cc on the configure libfdt dependency fix
> commit
> > and remove the backport message from the tag...
>
> Tag messages are just informational (we use them to help
> in writing up the changelog for releases), mostly. So I
> would recommend respinning the pullreq with the Cc: line
> in the relevant commit(s).
I respun the PR with a Cc: qemu-stable in the configure libfdt dependency
patch. You should have received a PR with the tag
‘riscv-qemu-2.13-minor-fixes-3’
Thanks,
Michael
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
@ 2018-05-09 10:20 Michael Clark
2018-05-09 10:20 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
0 siblings, 1 reply; 10+ messages in thread
From: Michael Clark @ 2018-05-09 10:20 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: patches, Michael Clark, Alistair Francis, KONRAD Frederic,
Palmer Dabbelt, Sagar Karandikar, Bastian Koppelmann
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-3
for you to fetch changes up to a666409f0df5dce113a5bd2c4c144a0792f2a4a3:
riscv: requires libfdt (2018-05-09 22:14:28 +1200)
----------------------------------------------------------------
RISC-V: QEMU 2.13 Minor Fixes
* Require libfdt when configuring for 'riscv*-softmmu'
* Increase HTIF priority and allow zero base 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(-)
--
2.7.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0
2018-05-09 10:20 Michael Clark
@ 2018-05-09 10:20 ` Michael Clark
0 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-09 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, KONRAD Frederic, Michael Clark
From: KONRAD Frederic <frederic.konrad@adacore.com>
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.
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Message-Id: <1525360636-18229-2-git-send-email-frederic.konrad@adacore.com>
---
hw/riscv/riscv_htif.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index 3e17f3025106..be252ec8cce9 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -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);
--
2.7.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes
@ 2018-05-07 23:14 Michael Clark
2018-05-07 23:14 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
0 siblings, 1 reply; 10+ messages in thread
From: Michael Clark @ 2018-05-07 23:14 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: patches, Michael Clark, KONRAD Frederic, Alistair Francis,
Palmer Dabbelt, Sagar Karandikar, Bastian Koppelmann, qemu-stable
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(-)
--
2.7.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0
2018-05-07 23:14 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
@ 2018-05-07 23:14 ` Michael Clark
0 siblings, 0 replies; 10+ messages in thread
From: Michael Clark @ 2018-05-07 23:14 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, KONRAD Frederic
From: KONRAD Frederic <frederic.konrad@adacore.com>
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.
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <1525360636-18229-2-git-send-email-frederic.konrad@adacore.com>
---
hw/riscv/riscv_htif.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index 3e17f3025106..be252ec8cce9 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -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);
--
2.7.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-05-09 14:37 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-08 20:07 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 2/3] riscv: htif: increase the priority of the htif subregion Michael Clark
2018-05-08 20:07 ` [Qemu-devel] [PULL 3/3] riscv: requires libfdt Michael Clark
2018-05-08 20:49 ` [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Peter Maydell
2018-05-08 22:05 ` Michael Clark
2018-05-09 11:14 ` Peter Maydell
2018-05-09 14:37 ` Michael Clark
-- strict thread matches above, loose matches on Subject: below --
2018-05-09 10:20 Michael Clark
2018-05-09 10:20 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
2018-05-07 23:14 [Qemu-devel] [PULL 0/3] RISC-V: QEMU 2.13 Minor Fixes Michael Clark
2018-05-07 23:14 ` [Qemu-devel] [PULL 1/3] riscv: spike: allow base == 0 Michael Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).