keystone-enclave / keystone

Keystone Enclave (QEMU + HiFive Unleashed)
Other
461 stars 132 forks source link

Keystone enclave for CVA6 #405

Open JefferryDengCJ opened 8 months ago

JefferryDengCJ commented 8 months ago

i want to run keystone with CVA6 as processor and working on xilinx S7-SP701 FPGA board.
SDK git from : https://github.com/keystone-enclave/keystone.git ,and work on orange/master. build steps followed CVA6_INSTALL.md : ./fast-setup.sh mkdir cd
export BUILD_ROOT= cmake .. -Dcva6=y
make

make[8]: No rule to make target '/home/jefferry/Desktop/work/keystone_work/keystone/buildroot.build/images/fw_jump.bin', needed by 'attestation/pkg/fw_jump.bin'. Stop. make[7]: [CMakeFiles/Makefile2:595: attestation/CMakeFiles/attestor-package.dir/all] Error 2 make[7]: Waiting for unfinished jobs.... ...... make[6]: [CMakeFiles/Makefile2:203: CMakeFiles/examples.dir/rule] Error 2 make[5]: [Makefile:124: examples] Error 2 make[4]: [package/pkg-generic.mk:293: /home/jefferry/Desktop/work/keystone_work/keystone/buildroot.build/build/keystone-examples-22b2325810431955/.stamp_built] Error 2 make[3]: [Makefile:91: _all] Error 2 make[3]: Leaving directory '/home/jefferry/Desktop/work/keystone_work/keystone/buildroot' make[2]: [CMakeFiles/buildroot.dir/build.make:77: CMakeFiles/buildroot] Error 2 make[2]: Leaving directory '/home/jefferry/Desktop/work/keystone_work/keystone' make[1]: [CMakeFiles/Makefile2:91: CMakeFiles/buildroot.dir/all] Error 2 make[1]: Leaving directory '/home/jefferry/Desktop/work/keystone_work/keystone' make: [Makefile:94: all] Error 2

Upstream Keystone does no longer use cmake for the build, and also those instructions are thus no longer working instructions.

asyarifstudio commented 8 months ago

hi @JefferryDengCJ

current CVA6 support in Keystone is not working. I have PR #396 that will allow you to build CVA6 on fpga/ariane platform using the latest Makefile build system. it's currently under review but you can try it in the fork.

I think there will be no modification needed to make it run on other FPGA platform but let me know if you face any issue

JefferryDengCJ commented 8 months ago

hi @JefferryDengCJ

current CVA6 support in Keystone is not working. I have PR #396 that will allow you to build CVA6 on fpga/ariane platform using the latest Makefile build system. it's currently under review but you can try it in the fork.

I think there will be no modification needed to make it run on other FPGA platform but let me know if you face any issue hi, @asyarifstudio Thank you first. i found your PR #369 after i submited this issue. then changed to your branch : 1, run ./fast-setup.sh 2, set KEYSTONE_PLATFORM to cva6

  1. make
  2. sudo make flash; write the images into SD card.
  3. run the program in target xilinx sp701. but kernel panic.---> [ 25.939885] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004, details of consol output, in the attached file. consol-out.md Any suggestions for the kernel panic?

q2. when i set KEYSTONE_PLATFORM to generic, is it working for QEMU ? But when i do it later, compiled error: Makefile:65: warning: overriding recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:56: warning: ignoring old recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:68: warning: overriding recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:65: warning: ignoring old recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:73: warning: overriding recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:68: warning: ignoring old recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:80: warning: overriding recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' Makefile:73: warning: ignoring old recipe for target '/home/jefferry/Desktop/work/keystone_work/dev-cva6-support/keystone//build-generic' make: *** mkutils/plat/generic: Is a directory. Stop.

asyarifstudio commented 8 months ago

Hi

  1. I've seen this kernel panic issue while running the 32 bit version on Genesys2. The cause was the 32bit version of CVA6 does not support D extension. could you check whether the CVA6 you build, I presume it's 64bit, enable the D extension?

  2. never seen this issue before, but switching between QEMU and CVA6 is okey on my side. KEYSTONE_PLATFORM=cva6 make and just make for QEMU

JefferryDengCJ commented 8 months ago
  1. Okay, i got it. i am tracking this panic. But i have been set to 64 bits, and the cva6 processor is support imafdc, it worked fine before . by the way, DTS files you set default , is in this location : ? keystone/overlays/keystone/board/cva6/cva6-sdk/u-boot/arch/riscv/dts cv64a6_genesysII.dts or cv32a6_genesysII.dts @asyarifstudio
asyarifstudio commented 8 months ago

Hi @JefferryDengCJ

Keystone does not use u-boot, so the device-tree used is the one located at https://github.com/openhwgroup/cva6/blob/master/corev_apu/bootrom/ariane.dts.

you need to rebuild the cva6 bootrom and resynthesize the cva6 soc if you modify this DTS.