dgilmore changed the topic of #fedora-riscv to: Fedora on RISC-V https://fedoraproject.org/wiki/Architectures/RISC-V || Logs: https://libera.irclog.whitequark.org/fedora-riscv || Alt Arch discussions are welcome in #fedora-alt-arches
esv_ has joined #fedora-riscv
esv has quit [Ping timeout: 265 seconds]
<BrandonDunne[m]> <davidlt[m]> "Brandon Dunne: Yes, you can help..." <- I've done some RPM packaging for ManageIQ (RH CloudForms now IBM Infrastructure Management), but I'm not too familiar with the Fedora side
esv_ is now known as esv
skip77 has joined #fedora-riscv
skip77 has quit [Changing host]
skip77 has joined #fedora-riscv
foxtran has quit [Quit: Leaving.]
foxtran has joined #fedora-riscv
esv has quit [Ping timeout: 240 seconds]
unlord has quit [Ping timeout: 256 seconds]
<dtometzki> Good morning
<dtometzki> davidlt: great it works
jcajka has joined #fedora-riscv
unlord has joined #fedora-riscv
oaken-source has quit [Quit: Lost terminal]
oaken-source has joined #fedora-riscv
<dtometzki> <davidlt[m]> "Note that Fedora 38 images don't..." <- Hello davidlt i had to change it because there was the old entries as descriebed in the doc
<davidlt[m]> If you use Unmatched image you need to change it, but QEMU image has it changed (unless I messed up somehow).
<dtometzki> yes i downloaded this file Fedora-Developer-38-20230519.n.0-nvme.raw.img.xz
<Entei[m]> <davidlt[m]> "There is a new one available..." <- This one booted nicely. But I am unable to login. The website says login as root with password riscv, but it keeps prompting Login incorrect
<dtometzki> Entei you should see a message with the passwort
<Entei[m]> dtometzki: Oh I just saw it. Didn't pay attention.
<Entei[m]> thanks
<davidlt[m]> dtometzki: I just checked, and all is good.
<dtometzki> davidlt: what is the u-boot.itb ?
<dtometzki> * the u-boot.itb (Fedora-Developer-38-20230519.n.0-u-boot.itb)?
<davidlt[m]> Device Tree Binary containing U-Boot proper bin, DTB for the board, OpenSBI FW_DYNAMIC generic firmware.
esv has joined #fedora-riscv
<dtometzki> davidlt: the u-boot image in the itb file is the same as u-boot-spl.bin or is it an other ?
<davidlt[m]> No
<davidlt[m]> SPL is a smaller U-Boot.
<davidlt[m]> SPL loads U-Boot ITB. Looks at it's internal configuration (there is only one). Loads OpenSBI binary. Fills the structure about the next boot stage. Calls OpenSBI, which then calls U-Boot proper binary.
<davidlt[m]> There is also TPL. That's even a smaller U-Boot, but rarely used.
<davidlt[m]> SPL is also the stage at which DRAM gets initialized (typically).
<davidlt[m]> SPL only has L2 to work with.
<dtometzki> ah ok thanks for the info
<davidlt[m]> I use the a very similar bootflow on QEMU as on the board to make my life easier with testing.
<davidlt[m]> But that will change to EDK2 firmware at some point.
<davidlt[m]> It's still WIP on the QEMU side.
<dtometzki> do you know a good documentation link about this ?
<davidlt[m]> No, it's mailing list emails.
<Entei[m]> Any central place to specify build flags? I am running the Fedora riscv image built for rv64gc, say I wish to rebuild packages for rv64ima, or rebuild gcc with different ISA spec version(--with-isa) and default CPU (--with-arch) etc?
<Entei[m]> * for rv64ima (-march flag), or
<davidlt[m]> Well that's not gonna be easy.
<davidlt[m]> That would affect ABI.
<davidlt[m]> You most likely need to bootstrap from zero.
<davidlt[m]> I would advise you to look at OpenEmbedded or/and Buildroot. Those might be able to produce you a Linux image with IMA only.
<rwmjones> davidlt[m]: quick booting questions ...
<rwmjones> FW_PAYLOAD & FW_JUMP are obsolete, right?
<rwmjones> I mean to say, FW_DYNAMIC is the only one anyone should care about?
<rwmjones> and what is the different between
<rwmjones> /usr/share/opensbi/generic/firmware/fw_payload.bin
<rwmjones> /usr/share/opensbi/generic/firmware/fw_payload.elf
<rwmjones> what does the *.elf file do?
<davidlt[m]> Payload is not really used these days. FW_DYNAMIC is dominating, but load address will change per vendor. For example JH7110 already requires changing it for that SoC.
<Entei[m]> <davidlt[m]> "I would advise you to look at..." <- I tried openembedded. kinda wanted to port Fedora for the custom architecture, but at some point I just got stuck. That point is mock, with the ridiculous amounts of dependencies.
<davidlt[m]> I think ELF files used to work with QEMU, etc. My head is fuzzy about them already.
<davidlt[m]> Entei[m]: Yeah. Other "rich features" Linux distributions also will not support IMA. This specific extensions mix is only used by the firmware binaries (U-Boot, GRUB, etc.)
<davidlt[m]> Now in the older days (BBL instead of OpenSBI) you could emulated F and D.
<davidlt[m]> OpenSBI doesn't provide any extension emulation via trapping.
<davidlt[m]> But even FPGA implementations incl. F, D, C, bitmanip, and more.
<davidlt[m]> The problem with IMA is that without F and D that changes default ABI. You also need to use soft-floats here.
<Entei[m]> Right now I have a rebuilt mock package on openembedded produced image, with some rebuilt packages and going nodeps for most part. Finally doing mock --version gives Password is invalid, unable to troubleshoot this problem
<davidlt[m]> Basically you cannot talk to existing binaries if they use floating points.
<davidlt[m]> Doing a full distribution bootstrap will be expensive (time and money on compute side).
<Entei[m]> davidlt[m]: The IMA was just example. I am porting to architecture with imafd, aka, g. Need an image without compressed instructions
<davidlt[m]> Without the compressed it's easy.
<davidlt[m]> C has not affect on the ABI.
<Entei[m]> davidlt[m]: oh I like the sound of that
<Entei[m]> So where do I specify my build flags so all rpmbuilds automatically set those flags?
<davidlt[m]> Do you want just a quick hack?
<Entei[m]> davidlt[m]: Anything that could get me started. Any help is appreciated.
<Entei[m]> Of course I'd like to avoid editing each spec file
<davidlt[m]> The quick hack would be to recompile redhat-rpm-config
<rwmjones> davidlt[m]: thanks
<davidlt[m]> Modify optflags: riscv64 line.
<davidlt[m]> Not ideal, but should work in most of the cases.
<davidlt[m]> In parallel you could recompile GCC with a different default (takes ~10 days on Unmatched to compile).
<davidlt[m]> Actually SHAKTI (from India) team might have Fedora without C.
<davidlt[m]> Their initial SoCs were built without C.
<Entei[m]> davidlt[m]: Damn 10 days!!! That's a long time. But iirc Unmatched has only 4 cores right?
<davidlt[m]> Yeah.
<davidlt[m]> 64-core systems are incoming.
<thefossguy> davidlt[m]: I remember a similar discussion. Thats highly likely.
<davidlt[m]> I would still advice to stick to OpenEmbedded or Buildroot as that's way less work.
<Entei[m]> davidlt[m]: I just looked on their website, just one gitlab repo with buildroot.
<thefossguy> Did anyone attend the Barcelona RISC-V summit?
<davidlt[m]> Entei[m]: I didn't. I actually even forgot about it 👀
<davidlt[m]> thefossguy: I didn't. I actually forgot about it ... 👀
<thefossguy> I thought you might’ve since you’re closer 
<thefossguy> But we xan always catch up on YT it seems
<Entei[m]> davidlt[m]: That's great. I have access to some 24 core Xeons, might be able to compile faster on QEMU right now.
<thefossguy> *can
<davidlt[m]> Those Summits tend to be boring, not really that technical down to the ground stuff.
<davidlt[m]> More of RVI, scientific papers, some announcements, very little users touching software bits.
<davidlt[m]> Entei: QEMU will make life easier on the larger packages that scale with -jX. On single thread builds the board wins.
<davidlt[m]> I think rwmjones did some benchmarks (board vs QEMU) recently.
<thefossguy> On the topic RVI, whats up with rv128i? Has that gotten any real interests from any chip maker? Especially the AI ones that build the stack themselves?
<davidlt[m]> I used EPYC with 32-core VM + 80GB of RAM for GCC build testing (bootstrap disabled, etc.) that took 8 hours or so without tests, and 2 days with tests IIRC>
<davidlt[m]> Nah, RV128 is just a placeholder for the whatever future.
<davidlt[m]> I don't think AI need RV128 at all.
<thefossguy> And here I thought we would get 16 byte machines 
<davidlt[m]> Well, we are getting more 16-byte instructions in RVA23 :)
<davidlt[m]> I don't really like that. Makes life a bit more complicated, and who knows if there is enough benefits.
<davidlt[m]> Especially if they keep adding more of them.
<thefossguy> davidlt[m]: With a 16 byte word I think they can cram more BFs in. Or am I misunderstanding something 🙃
<davidlt[m]> You have vector specification for all these kind of things.
<davidlt[m]> And those can go up to 2K IIRC.
<thefossguy> That I forgot until you reminded 😅
<davidlt[m]> Not that anyone will implement something like that.
<thefossguy> AMX is 4K afaik
<davidlt[m]> Yeah, but that's matrix :)
<thefossguy> Not AMX but whatever Intel calls Advanced Matrix Extension 
<thefossguy> Nvm, it is amx
<davidlt[m]> T-HEAD has matrix extension for RISCV.
<thefossguy> I will take a look soon. But is this to be integrated with RVV or as a standalone extension? 
<davidlt[m]> This is a vendor extensions, but might be used as a proposal.
<davidlt[m]> IIRC matrix stuff was originally in vector isa, but a lot of stuff was removed to make progress.
<davidlt[m]> There are bigger issues than matrix extension in RVI.
<rwmjones> I did some fixes to the opensbi package ...
<rwmjones> I think I'm going to leave the forge macros there, as they are not banned and they make it a lot easier to manage
<rwmjones> I ended up packaging both 32- and 64-bit firmwares (as both are needed by qemu)
<rwmjones> however that means I had to rename them
<rwmjones> riscv32_fw_dynamic.bin vs riscv64_fw_dynamic.bin
<rwmjones> I left in the *.elf files even though I've no idea what they do
<rwmjones> didn't open a review bug yet, but if there's any immediate feedback you can write it here
<rwmjones> we might need a symlink to deal with where qemu expects the firmware
<rwmjones> /usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.bin
<rwmjones> /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
<rwmjones> not sure if we should put that in qemu or in opensbi
<rwmjones> there are upside and downsides to both
<davidlt[m]> Description is wrong.
<davidlt[m]> This is not for the QEMU.
<davidlt[m]> Don't care about 32-bit as no one supports it. This will not get tested.
<davidlt[m]> 1.2 is not good enough.
<davidlt[m]> I want to use specific commits from main/master branch.
<davidlt[m]> Also we will need to have different soon. "Generic" doesn't mean generic for all the boards as load address might still be different.
<davidlt[m]> A single binary works on QEMU, Unleashed, Unmatched, but stops working with JH7110.
<davidlt[m]> We might want to do something similar as in U-Boot and build for different targets, then de-dup whatever is identical or something.
<davidlt[m]> I don't use forge macros so those are a bit annoying (i.e. yet another macros I don't know anything about).
<davidlt[m]> Oh, this should configured to work as native too.
<davidlt[m]> I mean it wouldn't build on riscv64 host.
<rwmjones> I find it annoying that a single binary doesn't cover all targets
<davidlt[m]> That's expected (as companies stop copying SiFive stuff).
<davidlt[m]> For JH7110 we need FW_DYNAMIC generic with FW_TEXT_START=0x40000000
<rwmjones> so about the directory name, the opensbi make install rule creates %{_datadir}/%{name}/%{PLATFORM}/firmware
<davidlt[m]> The only parameter that changes is FW_TEXT_START per board.
<rwmjones> I thought the point is that the start address can be found automatically?
* rwmjones reads fw.md again ...
<rwmjones> > The FW_DYNAMIC firmware gets information about the next booting stage entry, e.g. a bootloader or an OS kernel, from previous booting stage at runtime.
<rwmjones> so in %ao?
<rwmjones> a0
<davidlt[m]> I don't recall the details. There is a struct that we pass on to OpenSBI.
<davidlt[m]> So in most cases SPL creates this struct, and then probably uses a0 to store address to it before transferring execution to OpenSBI.
<rwmjones> so that's pretty sensible, but why doesn't it work on JH7110?
<davidlt[m]> FW_TEXT_START is differnet.
<davidlt[m]> Pretty much every SoC has a different value where OpenSBI is executed.
<rwmjones> oh I see that's the location of opensbi itself
<rwmjones> can't it be relocatable and find its own start address?
<davidlt[m]> Don't know, but you can always investigate and prepare patches ;)
<rwmjones> ..
<rwmjones> I wish suggest to atish
<davidlt[m]> Nuclei, for example, use 0xA0000000.
<davidlt[m]> Basically OpenSBI doesn't know at what address main memory starts.
<davidlt[m]> That's SoC specific thing.
<davidlt[m]> On SiFive cores main memory starts at 0x80000000 address.
<davidlt[m]> There are other blocks/etc. mapped below that address.
<davidlt[m]> At 0x40000000 on FU740 you find "AXI4 System port"
<rwmjones> davidlt[m]: so there's an FW_PIC=y option (default on) which appears to make opensbi relocatable
<rwmjones> and I checked the code and it does seem to save its own start address
<rwmjones> see firmware/fw_base.S _fw_start
<rwmjones> I mean, _start
zsun has joined #fedora-riscv
<davidlt[m]> It's probably used in the linker script
zsun has quit [Quit: Leaving.]
zsun has joined #fedora-riscv
zsun has quit [Quit: Leaving.]
zsun has joined #fedora-riscv
zsun has quit [Quit: Leaving.]
zsun has joined #fedora-riscv
<dtometzki> it seems that every SoC vendor has it own FW_TEXT_START
<dtometzki> It would be interesting to know if this is simply defined by the vendor or if there is really a dependency on the HW.
zsun has quit [Quit: Leaving.]
esv has quit [Read error: Connection reset by peer]
esv has joined #fedora-riscv
<davidlt[m]> Both
esv has quit [Ping timeout: 268 seconds]
esv has joined #fedora-riscv
<dtometzki> davidlt: what do you you mean with both ?
zsun has joined #fedora-riscv
zsun has quit [Client Quit]
jcajka has quit [Quit: Leaving]
<davidlt[m]> Some of this could be related to bootflow design decissions.
<davidlt[m]> Some of that could also be related to IP design.
<davidlt[m]> There are multiple things that could influence this decission.
<davidlt[m]> Platform specs says:
<davidlt[m]> > 5.2.4. Memory Map
<davidlt[m]> > It is recommended that main memory and loadable code (not ROM) start at address 0x8000_0000.
<davidlt[m]> >
<davidlt[m]> But again, not required.
<davidlt[m]> Well, platform spec is not finished and ratified :)
fuwei has quit [Remote host closed the connection]
fuwei has joined #fedora-riscv
jbowen has quit [Ping timeout: 250 seconds]
jbowen has joined #fedora-riscv
<dtometzki> davidlt: thanks