rivosinc / salus

Risc-V hypervisor for TEE development
96 stars 25 forks source link

Vm: Use EcallAction::Forward for share/unshare calls from guest. #285

Closed rajnesh-kanwal closed 1 year ago

rajnesh-kanwal commented 1 year ago

Given we do post processing after the share/unshare calls from guest in try_complete_pending_op and use set_ecall_result to set the ECALL results returned from the host, we end up incrementing sepc second time. First time when we call set_ecall_result from run_vcpu under EcallAction::Break case.

This skips the next instruction(s) (fp load and stack pointer adjustment instructions in case of kvm) and leads to strange issues.

sboeuf commented 1 year ago

Thanks for fixing this @rajnesh-kanwal