sgdisk --clear \
--new=1:2048:4095 --change-name=1:uboot --typecode=1:$(FSBL) \
--new=2:4096:69631 --change-name=2:bootloader --typecode=2:$(BBL) \
--new=3:264192: --change-name=3:root --typecode=3:$(LINUX) \
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/20181011132455.GA7242%40lst.de.
The SiFive FSBL is replaced with U-Boot and stores in SD card and runs in M-mode at present.The u-boot requires bbl image (bbl+vmlinux) to boot Linux at present.Our next step is to change M-mode to S-mode in u-boot and removing bbl from Linux image (bbl+vmlinux).
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/dfaca48a-b9b5-4408-94a2-c26aa8523874%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/20181012080840.GA27426%40lst.de.
Yes - for RISC-V U-boot, it's best to follow the example set by
the ARM64 U-boot folks and support booting in any mode:
https://github.com/theopolis/u-boot/blob/master/doc/README.arm64
- Paul
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAP6exYKr_uHoX1FvKSTnPB8gPkYzYY0LOKB%2BbvTvYiyV%3DcfgfA%40mail.gmail.com.
I agree that we shouldn't trust vendor firmware. It is always buggy at best.
On Friday, 12 October 2018 22:12:08 UTC+1, alist...@gmail.com wrote:I agree that we shouldn't trust vendor firmware. It is always buggy at best.But once the source is open/available surely one can see what's going on and address problems/bugs as needed?
I agree that we shouldn't trust vendor firmware. It is always buggy at best.The problem that I see with starting coreboot or u-boot (the last stage bootloaders) in M mode is that we then end up with duplicated work between the projects.
This is where a model like Arm Trusted Firmware fits in well. We can see something like this:
(interested text removed :-)
The advantage I see with this is that we only need to implement the M mode functionality once and then coreboot, u-boot and anything else can utilise it. It also keeps bigger later stage boot loaders out of M mode which has a mild security benefit of smaller attack surfaces.
ron
I just see a lot of value in separating the firmware from the last stage bootloader. As part of this though we would need to come up with a firmware option that can be used for those who want to.
On Fri, Oct 12, 2018 at 10:12 PM <alist...@gmail.com> wrote:
> The problem that I see with starting coreboot or u-boot (the last stage bootloaders)
> in M mode is that we then end up with duplicated work between the projects.
yes. that has not stopped either project from continuing. it also
hasn't stopped libreboot, or grub, or the system which allows a linux
kernel to actually *be* the bootloader (which runs an initramfs and
calls kexec).
each of these bootloaders has different fans and userbases. they
don't necessarily talk to each other, and that's just how it is.
expecting each independent team to cooperate, particularly when some
of them are hard forks of other bootloader projects, is not realistic.
> This is where a model like Arm Trusted Firmware fits in well.
you mean, ARM _treacherous_ firmware? the "trust" you refer to is
directed at *manufacturers*, providing the specific goal of
*betraying* users. "Trust Us. We Will HELP You To Prevent And
Prohibit Users From Owning Their Devices".
l.
That seems a little harsh. ATF is open source and you can compile it yourself from the source to deploy. You are also free to re-write it if need be.
A mix-mash of ways seems like a dangerous path to lead to fragmentation and confusion and that is what I'm afraid of.
Huh? You're saying that if the sources are available you *can't* see and fix bugs if necessary? Doesn't make any sense to me...
On Friday, October 12, 2018 at 4:23:10 PM UTC-7, Luke Kenneth Casson Leighton wrote:
On Fri, Oct 12, 2018 at 10:12 PM <alist...@gmail.com> wrote:
> The problem that I see with starting coreboot or u-boot (the last stage bootloaders)
> in M mode is that we then end up with duplicated work between the projects.
yes. that has not stopped either project from continuing. it also
hasn't stopped libreboot, or grub, or the system which allows a linux
kernel to actually *be* the bootloader (which runs an initramfs and
calls kexec).
each of these bootloaders has different fans and userbases. they
don't necessarily talk to each other, and that's just how it is.
expecting each independent team to cooperate, particularly when some
of them are hard forks of other bootloader projects, is not realistic.
> This is where a model like Arm Trusted Firmware fits in well.
you mean, ARM _treacherous_ firmware? the "trust" you refer to is
directed at *manufacturers*, providing the specific goal of
*betraying* users. "Trust Us. We Will HELP You To Prevent And
Prohibit Users From Owning Their Devices".That seems a little harsh. ATF is open source and you can compile it yourself from the source to deploy. You are also free to re-write it if need be.
>We can see something like this:
> 1. CPU boots up and ROM does it's thing
> 2. ROM boots into an open source firmware (ATF equivalent) in M mode
> - This will end up being pretty SoC specific
yes. and may not fit into the available memory, which may be
absolutely tiny.
the ROM bootloader, which is best made about as ridiculously dumb and
tiny as can possibly be made, is usually just about capable of loading
from a single (16k) sector of a Micro-SD or eMMC device, or 16k from
an SPI device, or 16k from an ONFI NAND, and so on. that sub-16k
executable the "first stage" bootloader.
16K is the "normal" amount of available SRAM that SoCs are prepared to
allocate for these first-stage bootloaders. that 1st stage basically
does things like "initialise the DDR3 RAM, set up IRQs"... oh and it
happens to initialise the
device-from-which-the-next-phase-is-to-be-loaded.
in u-boot, this first stage bootloader is called the "SPL", and it's
compiled from u-boot with some special #defines that *MASSIVELY* cut
down u-boot to the absolute, absolute bare minimum (surprise: under
16k).
all of this is typically entirely hidden from end-users. you don't
have to know. you don't have to care. people have *no idea* that
their system goes through a four, five or even six stage boot process
to get to an OS. even intel x86 systems.
basically i'm saying that "one size does not fit all", that creating
standards in this area is not only unrealistic but also completely
undesirable it is so heavily application-specific, and that
restricting vendors through standardisation to be not permitted to run
from the absolute lowest possible level (M-Mode) will almost certainly
cause a massive back-lash.
*on the other hand*, if there exists *informal reference source code*
out there, that's absolutely fantastic, as it will cut down massively
on development NREs. example ROM bootloaders, for example, would be
fantastic.
why would it be fantastic? because the entire process is so
proprietary, so secret, that very few people actually know what's
involved. full libre-licensed source code - preferably with
libre-licensed overview documents - would completely change how SoCs
are developed.The risk that I see with just letting everyone go their own way is that we will end up with a similar situation to the ARM world.That is that every SoC vendor does their own thing. This can result in a less open ecosystem as every vendor writes their own boot code and keeps it closed.The other problem I see is a fragmented boot process. Where some boards use coreboot and some use u-boot and some use something else. We will then get to a point where every board is different. x86 has this pretty much sorted as I can boot my Linux USB stick on every PC I own. ARM is the exact opposite of this. I would like to see RISC-V not go down this fragmentation route. One way to do this is just to have a "best" way to setup the boot process. Then SoC vendors will hopefully opt to follow it.A mix-mash of ways seems like a dangerous path to lead to fragmentation and confusion and that is what I'm afraid of.
Yes - for RISC-V U-boot, it's best to follow the example set by the ARM64 U-boot folks and support booting in any mode:
https://github.com/theopolis/u-boot/blob/master/doc/README.arm64
On 10/12/18 8:57 AM, ron minnich wrote:
I'm surprised to see this idea but in any event coreboot replaces bbl and has m mode code and I don't expect that to change. I'm done with trusting vendor supplied fsbl no matter what the source.
On Fri, Oct 12, 2018, 1:08 AM Christoph Hellwig <h...@lst.de> wrote:
On Fri, Oct 12, 2018 at 01:35:02PM +0530, Anup Patel wrote:
> > Awesome. Does that mean you are planning to implement SBI as well in uboot or bbl continue to exist in M mode ?
> > Can you please explain the boot flow design if u-boot runs in S-mode ?
>
> Please no M-mode code in U-boot or any general purpose bootloader.
Indeed, that is what I feared :(
> Instead of replacing SiFive FSBL with U-Boot, I suggest to boot
> bbl+uboot.bin from SiFive FSBL
That would be more useful indeed.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/20181012080840.GA27426%40lst.de.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAP6exYKr_uHoX1FvKSTnPB8gPkYzYY0LOKB%2BbvTvYiyV%3DcfgfA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/57aee989-fc06-34f7-925e-dc646711dbef%40sifive.com.
I'd submit that the Important criterion is that the hardware or platform
specifications don't foreclose either approach.
On 10/14/18 3:42 PM, ron minnich wrote:
> So, I apologize for anything I did to make this thread longer. I think
> we're all in agreement that we don't agree about the boot solutions,
> but we do agree that things must be completely open, buildable, and
> flashable. And that's the only thing I really care about.
>
M-mode only, no SBI implementation yet. The plan is to boot Linux
directly without BBL.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAP6exYJGHN0JX87FP1-p_HWyh9j%2BGxJD0uYHm5wVBVZfvSbb9A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAP6exYJGHN0JX87FP1-p_HWyh9j%2BGxJD0uYHm5wVBVZfvSbb9A%40mail.gmail.com.
On Sat, Oct 27, 2018 at 12:58 PM Michael Clark <michae...@mac.com> wrote:The point being, if SBI code moves to Linux, then there is no SBI, however the issue is the M-mode S-mode privilege boundary. i.e. Linux can’t provide an M-mode payload to the boot loader to run with higher privileges; as that would be a gaping privilege escalation hole, ...
I've never understood the argument that kernel access to M mode is a
priv escalation. Let's just say the kernel replaces M mode with some
other code. What did it do? Attack itself? The argument that it is a
priv escalation makes no sense to me.
From my point of view, the existence of runtime firmware that the
kernel can not view or change is the real security issue, and events
of the last 10 years have strengthened that view.
The abililty of a kernel to change the M mode code was, in my view, a
real step forward from systems like x86 system management mode, with
its hidden code running on the main CPU in SMM or UEFI.
Now if you want to argue that a kernel should be able to install
something like SMM or M mode code, then lock it down so it can't be
changed, that's not so bad, and for SMM I've done this proof of
concept: https://docs.google.com/presentation/d/1ECTPzrt4hT37Ef729GAXh0o9lMvx4MJrkJxN88-k9Ps/edit?usp=sharing
I've never viewed the RISCV architectural extensions (such as PMP)
that would allow ODMs to create SMM-like code a step forward for RISCV
security. The work that I and others are doing on LinuxBoot is aimed
at disabling, removing, or replacing runtime firmware blobs, be it on
the main CPU or attach CPUs such as ME or PSP. Again, if the kernel
can use PMP to lock down regions it wants to protect, fine; if vendors
are using PMP to lock in M mode code that a kernel can not read or
change, that's a very bad idea.
At many companies, runtime firmware such as UEFI or SMM is living on
borrowed time. I would not like to see it reappear on RISCV, but that
seems to be the goal in some cases.