All of lore.kernel.org
 help / color / mirror / Atom feed
From: Auer, Lukas <lukas.auer@aisec.fraunhofer.de>
To: u-boot@lists.denx.de
Subject: [PATCH 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow
Date: Sun, 8 Dec 2019 22:31:52 +0000	[thread overview]
Message-ID: <9a94b7aecca157c75b0a77ae40f4147fe483e532.camel@aisec.fraunhofer.de> (raw)
In-Reply-To: <CAN5B=eJMiYT0Vnwmwnpj6yYuCcNEVjdu1fDTmUB2qXS94gVXWw@mail.gmail.com>

Hi Rick,

On Fri, 2019-12-06 at 16:26 +0800, Rick Chen wrote:
> HI Lukas
> 
> > From: Lukas Auer [mailto:lukas.auer at aisec.fraunhofer.de]
> > Sent: Wednesday, December 04, 2019 5:40 AM
> > To: u-boot at lists.denx.de
> > Cc: Rick Jian-Zhi Chen(陳建志); Anup Patel; Bin Meng; Lukas Auer; Anup Patel; Anup Patel; Atish Patra; Marcus Comstedt
> > Subject: [PATCH 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow
> > 
> > Rick's recent patch series, which adds support for U-Boot SPL to the Andes platform, brought several problems of the current U-Boot SPL boot flow on RISC-V to light. Discussion on the relevant parts starts at [1].
> > 
> > The problem showed itself in the form of code corruption. At start, OpenSBI relocates itself to its link address. This allows it to be loaded independently of the link address. In the case that the link address ranges of U-Boot SPL and OpenSBI overlap, code corruption occurs if the relocation starts while some harts are still running U-Boot SPL.
> > This series prevents this problem by specifying the hart that performs the relocation and then making sure that it is the last hart to enter OpenSBI, allowing relocation to be completed safely. A recent version of OpenSBI is required for the changes to work.
> > 
> > This patch series resolves the problems associated with the use case of overlapping link address ranges. However, it is still recommended to select non-overlapping ranges for U-Boot SPL and OpenSBI.
> > 
> > [1]: https://lists.denx.de/pipermail/u-boot/2019-November/389385.html
> > 
> > 
> > Lukas Auer (4):
> >   spl: opensbi: specify main hart as preferred boot hart
> >   riscv: add functions for reading the IPI status
> >   riscv: add option to wait for ack from secondary harts in smp
> >     functions
> >   spl: opensbi: wait for ack from secondary harts before entering
> >     OpenSBI
> > 
> >  arch/riscv/cpu/start.S        |  2 ++
> >  arch/riscv/include/asm/smp.h  |  3 ++-
> >  arch/riscv/lib/andes_plic.c   |  9 ++++++++
> >  arch/riscv/lib/bootm.c        |  2 +-
> >  arch/riscv/lib/sbi_ipi.c      | 11 +++++++++
> >  arch/riscv/lib/sifive_clint.c |  9 ++++++++
> >  arch/riscv/lib/smp.c          | 43 +++++++++++++++++++++++++++--------
> >  arch/riscv/lib/spl.c          |  2 +-
> >  common/spl/spl_opensbi.c      | 13 ++++++++++-
> >  include/opensbi.h             | 18 ++++++++++++++-
> >  10 files changed, 98 insertions(+), 14 deletions(-)
> > 
> > --
> > 2.21.0
> > 
> 
> LGTM.
> 

Thanks for the review and testing of the patches! I have sent an
updated version of the series.

Regards,
Lukas

      reply	other threads:[~2019-12-08 22:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 21:39 [PATCH 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow Lukas Auer
2019-12-03 21:39 ` [PATCH 1/4] spl: opensbi: specify main hart as preferred boot hart Lukas Auer
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA46ABD5F@ATCPCS16.andestech.com>
2019-12-06  8:29     ` Rick Chen
2019-12-06 18:01       ` Anup Patel
2019-12-03 21:39 ` [PATCH 2/4] riscv: add functions for reading the IPI status Lukas Auer
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA46ABD66@ATCPCS16.andestech.com>
2019-12-06  8:33     ` Rick Chen
2019-12-03 21:39 ` [PATCH 3/4] riscv: add option to wait for ack from secondary harts in smp functions Lukas Auer
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA46ABD85@ATCPCS16.andestech.com>
2019-12-06  8:36     ` Rick Chen
2019-12-06 18:05       ` Anup Patel
2019-12-03 21:39 ` [PATCH 4/4] spl: opensbi: wait for ack from secondary harts before entering OpenSBI Lukas Auer
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA46ABD8C@ATCPCS16.andestech.com>
2019-12-06  8:37     ` Rick Chen
2019-12-06 18:06       ` Anup Patel
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA46ABD4F@ATCPCS16.andestech.com>
2019-12-06  8:26   ` [PATCH 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow Rick Chen
2019-12-08 22:31     ` Auer, Lukas [this message]

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=9a94b7aecca157c75b0a77ae40f4147fe483e532.camel@aisec.fraunhofer.de \
    --to=lukas.auer@aisec.fraunhofer.de \
    --cc=u-boot@lists.denx.de \
    /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.