All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: "Auer, Lukas" <lukas.auer@aisec.fraunhofer.de>
Cc: "palmer@sifive.com" <palmer@sifive.com>,
	"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
	 "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	 "kbastian@mail.uni-paderborn.de"
	<kbastian@mail.uni-paderborn.de>,
	 "sagark@eecs.berkeley.edu" <sagark@eecs.berkeley.edu>,
	 "Alistair.Francis@wdc.com" <Alistair.Francis@wdc.com>
Subject: Re: [Qemu-riscv] [Qemu-devel] [PATCH] hw/riscv/virt: re-add machine-specific compatible string to /soc/ node
Date: Wed, 13 Mar 2019 09:51:20 +0800	[thread overview]
Message-ID: <CAEUhbmX5ygthHtEoMvRMND3hbmhXrp-ok_hyvAqC+REafNSNbQ@mail.gmail.com> (raw)
In-Reply-To: <33758c6945c9b1968247c5b6dfb12418e57e71e0.camel@aisec.fraunhofer.de>

Hi Lukas,

On Tue, Mar 12, 2019 at 10:39 PM Auer, Lukas
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> Hi Bin,
>
> On Mon, 2019-03-11 at 23:28 +0800, Bin Meng wrote:
> > Hi Lukas,
> >
> > On Mon, Mar 11, 2019 at 2:03 AM Auer, Lukas
> > <lukas.auer@aisec.fraunhofer.de> wrote:
> > > Hi Bin,
> > >
> > > On Sun, 2019-03-10 at 22:57 +0800, Bin Meng wrote:
> > > > Hi Lukas,
> > > >
> > > > On Sun, Mar 10, 2019 at 9:44 PM Auer, Lukas
> > > > <lukas.auer@aisec.fraunhofer.de> wrote:
> > > > > Hi Bin,
> > > > >
> > > > > On Sun, 2019-03-10 at 09:07 +0800, Bin Meng wrote:
> > > > > > Hi Lukas,
> > > > > >
> > > > > > On Mon, Feb 11, 2019 at 6:13 AM Lukas Auer
> > > > > > <lukas.auer@aisec.fraunhofer.de> wrote:
> > > > > > > Re-add the previous compatible string "riscv-virtio-soc" to
> > > > > > > the
> > > > > > > soc
> > > > > > > device tree node to allow U-Boot and Linux to bind machine-
> > > > > > > specific
> > > > > > > drivers to it. The current compatible string "simple-bus"
> > > > > > > is
> > > > > > > retained.
> > > > > > >
> > > > > > > This is required by U-Boot to bind devices early, as part
> > > > > > > of
> > > > > > > the
> > > > > > > pre-relocation driver model.
> > > > > > >
> > > > > >
> > > > > > I see no problem with U-Boot working with current compatible
> > > > > > string
> > > > > > "simple-bus". In fact I had planned to remove the compatible
> > > > > > string
> > > > > > "riscv-virtio-soc" in U-Boot but did not get time to work on
> > > > > > it.
> > > > > >
> > > > >
> > > > > It is only required if U-Boot is running in machine-mode. For
> > > > > relocation it needs to use the CLINT driver to send appropriate
> > > > > IPIs to
> > > > > the other harts. To be able to probe the driver, the device and
> > > > > its
> > > > > parent device tree node (soc) must therefore be available in
> > > > > the
> > > > > pre-
> > > > > relocation device model.
> > > > > This patch was the easiest way I could think of for achieving
> > > > > this.
> > > > > It
> > > > > could be that there is a better way of solving this.
> > > > >
> > > >
> > > > I tested your SMP U-Boot series in both M-mode and S-mode, using
> > > > a 4
> > > > core 'virt' target. Works fine. I am using QEMU 3.1.0 so it is
> > > > "simple-bus".
> > > >
> > >
> > > That is actually my fault, it should not work.
> > > What is happening is that U-Boot fails to relocate the secondary
> > > harts,
> > > because the CLINT driver cannot get the memory address of the CLINT
> > > device. This error is currently silently ignored.
> >
> > I still don't understand. Why does the CLINT driver fail to get the
> > memory address? U-Boot has been supporting "simpile-bus" for a long
> > time. It was because QEMU 3.0.0 generated the /soc node with
> > "riscv-virtio-soc" compatible string, U-Boot was taught to treat such
> > compatible string as a "simple-bus" too (that was the U-Boot commit
> > 27dc2c130e29)
>
> That's correct. The problem with the default simple-bus U-Boot driver
> is that it does not have the DM_FLAG_PRE_RELOC flag set. The /soc and
> /soc/clint nodes are therefore not available before relocation, meaning
> that IPIs cannot be sent to relocate the secondary harts.
>

Thanks for the clarifications. Now I see the problem. But I think we
should fix U-Boot "simple-bus" driver instead. As seen on FU540 or
likely other hardware, QEMU generates the "simple-bus" compatible
string for the /soc node, as well as the DT provided by the hardware.

Regards,
Bin


  reply	other threads:[~2019-03-13  1:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-10 20:17 [Qemu-devel] [PATCH] hw/riscv/virt: re-add machine-specific compatible string to /soc/ node Lukas Auer
2019-02-10 20:17 ` [Qemu-riscv] " Lukas Auer
2019-02-11 23:43 ` [Qemu-devel] " Alistair Francis
2019-02-11 23:43   ` [Qemu-riscv] " Alistair Francis
2019-03-10  1:07 ` Bin Meng
2019-03-10  1:07   ` [Qemu-riscv] " Bin Meng
2019-03-10 13:44   ` Auer, Lukas
2019-03-10 13:44     ` [Qemu-riscv] " Auer, Lukas
2019-03-10 14:57     ` Bin Meng
2019-03-10 14:57       ` [Qemu-riscv] " Bin Meng
2019-03-10 18:03       ` Auer, Lukas
2019-03-10 18:03         ` [Qemu-riscv] " Auer, Lukas
2019-03-11 15:28         ` Bin Meng
2019-03-11 15:28           ` [Qemu-riscv] " Bin Meng
2019-03-12 14:39           ` Auer, Lukas
2019-03-13  1:51             ` Bin Meng [this message]
2019-03-14 21:01               ` Auer, Lukas
2019-03-15  1:54                 ` Bin Meng
2019-03-17 18:57                   ` Auer, Lukas
2019-03-19 12:19 ` [Qemu-riscv] " Palmer Dabbelt
2019-03-19 12:32   ` Auer, Lukas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEUhbmX5ygthHtEoMvRMND3hbmhXrp-ok_hyvAqC+REafNSNbQ@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=lukas.auer@aisec.fraunhofer.de \
    --cc=palmer@sifive.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=sagark@eecs.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.