I recently tried to recompile the latest upstream linux-stable kernel code on my machine to enable TUN/TAP to enable virt-manager to be able to run. I ran into a couple of problems when compiling which I had to patch in order to get it to compile successfully. I already submitted a pull request for one of these issues, and I plan on submitting two more small PRs for the remaining issues. However, the more pressing issue is that once I was able to get the kernel to compile, I tried to install the built kernel and it gave me an error telling me that there was potentially missing firmware. The newly built kernel would then hang on boot. How do I resolve this?
For my senior project, I will be attempting to perform a cold boot attack against the machine. After performing the attack, I will be attempting to spend the rest of my time during the semester to use SystemVerilog to attempt to get the ball rolling on a potential hardware mitigation on a RISC-V SoC to prevent these kinds of attacks from happening. However, since I am releasing all of my tools to the public under an MIT license, I want to build a custom Linux RAW image which can be flashed to a USB stick which already has the proper tools and configuration installed. To do this, I need to be able to re-compile the main kernel on the pre-installed Ubuntu installation in order to enable TUN/TAP for my virtual machine which I will be using to build the image. I will also need to re-compile the kernel on the target VM image to allow access to /dev/mem. How do I resolve the missing firmware problem to allow my newly built kernel to boot? Thank you very much!!
No code snippets, link? How can you expect people to solve your problem w/o describing the actual problem? It sounds more like a generic Ubuntu issue rather than something P550/riscv specific. Please provide details so folks can help you diagnosing further.
My pull request can be found here. At first, it failed to build simply because the AI driver didn’t have the necessary IOMMU header included. After I resolved that, I simply had two more compilation problems related to implicit typecasts of different character types. That simply involved including the correct typecasts to get it to finish compiling. I plan on submitting separate pull requests for each of those minor changes as well. What was more concerning and what I think likely lead to its inability to properly boot was the error messages stating that it likely had missing firmware. There doesn’t seem to be a guide on how to build the latest stable kernel for the machine with the necessary firmware included. I don’t think my issue is in any way related to the compilation errors I ran into or Ubuntu specifically. I think it is due to the missing firmware issue…
gee, I thought you were hacking the actual upstream linux kernel. ESWIN’s kernel code is so messy that I just won’t touch it. That kernel code does have DSP/NPU stuff, but I don’t care about AI on ESWIN. The missing firmware you were expecting is most likely for DSP/NPU. What I would do in your case is to unpack the images from Releases · eswincomputing/hifive-premier-p550-ubuntu · GitHub and extract the firmware from there. I see eic7700_dsp_fw and eic7700_die0/die1_e31_fw in that image. You can give that a try.
Me myself have been working on Sifive’s 6.12 branch GitHub - sifiveinc/riscv-linux at rel/kernel-6.12/hifive-premier-p550, which, although lacking the ESWIN AI crap, is a lot cleaner. ESWIN’s also upstreaming some device drivers to Linux, including clock/reset/sdio/emmc/sata/gmac. They have an v6.18-rc6 integration test branch at GitHub - eswincomputing/linux-next at dev/test-upstream-v6.18-rc6, which is intended for testing code to-be-upstreamed. It’s even cleaner than Sifive 6.12 branch, but lacking some device drivers, most importantly GPU and SATA phy.
Depending on your needs, I feel it’s nothing related to AI/DSP/NPU, so perhaps the other 2 branches are easier to work with? I also feel Sifive may not be willing to answer anything for ESWIN. idillicah was asking something related to the ESWIN image, and Raza from Sifive just told him to post on ESWIN’s forum. That ESWIN forum website is pretty much unusable to me.
I actually did get replies on the ESWIN forums, FWIW. Just none that helped. It ended up being an issue with my own board due to it being an engineering sample, which @ganboing helped me solve, actually
There is also a 6.18 dev branch from sifive which I tested a few days ago. With that one SATA works fine, but for some reason I could not get ethernet to work. Maybe it’s just a mistake in my config, although I did diff the defconfig from 6.12 and add all the changes to my own config… Also it needs a different DTB than 6.12, but that’s just par for the course unfortunately.
Thank you all for the replies! As you can see from this image, I tried the 6.12 branch, but not the 6.18 branch. It seems as though no matter what kernel/branch I try (both ESWIN and SiFive), the kernel seems to freeze the moment the bootloader tries to exit boot services. Does anyone know why this might be? What do you all do to rebuild the kernel and get it to boot? I have been trying to work on my senior project at university, and getting a custom built kernel to boot on this board would help a lot. Thank you all so much!!