It would make sense to implement it in QEMU instead. There was some previous work in the past, don't have a link right now to the original patchseries, but here is the repository[1]. In theory, it could be adapted to the modern QEMU code infrastructure and APIs and be a good starting point. Back in the past I started[2] doing that but quickly dropped because had no time to finish.