Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while installing the riscv-pk -- ../pk/pk.c:188: Error: unknown CSR `senvcfg' #329

Open
advaneharshal opened this issue Jun 20, 2024 · 2 comments

Comments

@advaneharshal
Copy link

I am getting the following error while doing the installation of riscv-pk

Steps I followed
mkdir build
cd build
../configure --prefix=/home/advanehs/riscv_toolchain/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14/ --host=riscv64-unknown-elf
make
At this step I am getting the following error
../pk/pk.c: Assembler messages:
../pk/pk.c:188: Error: unknown CSR senvcfg' ../pk/pk.c:188: Error: unknown CSR senvcfg'

Please let me know how to resolve the same

gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu122.04)
Ubuntu 12.3.0-1ubuntu1
22.04

@leandro-ro
Copy link

leandro-ro commented Jun 28, 2024

same for me, but with riscv32-unknown-elf

@aswaterman
Copy link
Collaborator

You need a more recent assembler. senvcfg was added to binutils in early 2022, so probably version 2.39 or later would work. (I'm using 2.41.)

As a temporary workaround, you can delete the problematic two lines of code:

index dbfaa5a..bb60f79 100644
--- a/pk/pk.c
+++ b/pk/pk.c
@@ -184,8 +184,6 @@ static void run_loaded_program(size_t argc, char** argv, uintptr_t kstack_top)
   init_tf(&tf, current.entry, stack_top);
   __riscv_flush_icache();
   write_csr(sscratch, kstack_top);
-  if (zicfilp_enabled)
-    set_csr(senvcfg, SENVCFG_LPE);
   start_user(&tf);
 }
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants