I’ve opened up #development #git tree for in-kernel #Keystone #enclave #driver:
https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-riscv-keystone.git/
Existing branches:
keystone
: follows Linus’ tree.keystone-5.19.y
: I’m actively trying to get Genesys2 FPGA hosting CVA6 working with this kernel version. Buddy allocator works but the use of dma_alloc_coherent()
to allocate contiguous physical memory for enclaves freezes the system when it is being used (not in the call itself).Keystone enclaves are applications hosted by Keystone security monitor running inside #OpenSBI, and partitioned and protected by physical memory protection (usually shortened as PMP) machine registers.
PMP is part of standard RISC-V ISA, which means that Keystone enclaves are usable with any RISC-V CPU with MMU. There is nothing that would prevent this coming eventually a mainline feature because it works for without non-standard or proprietary components involved.
Another favorable element of having Keystone enclaves as kernel feature is that Keystones enclave can run both in U-mode and S-mode meaning that kernel subsystems could use the feature too (if wanted). For instance, #Intel #SGX can host only ring-3 enclaves, which limits its scope.
I can request riscv-keystone@vger.kernel.org
if there is broader interest on this work.