Alexander Graf wrote: > Hi, > > this patch adds support for SVM (the virtual machine extension on amd64) > to qemu's x86_64 target. It still needs cleanup (splitting, indentation, > etc) and lacks some basic functionality but maybe someone will find > interest in it as it is already. > > In kvm real and protected modes work flawlessly as far as I can tell > (minix and 32-bit linux worked). > Long mode seems to work quite ok as well, though I am not able to get a > Linux kernel booted up (MenuetOS works). > > What does work? > > - VMRUN, VMLOAD, VMSAVE, VMEXIT, STGI, CLGI > - Event injection > - All interceptions (well, maybe I did oversee one or two) > - Context switching to the VM and back to the VMM > > What is missing? > > - According to the SVM specification NPTs are optional, so I did not > include them (yet) > - Everything related to device virtualisation > - The "Secure" part of the extension (would need TPM emulation for that) > - Debugging support (maybe it does work, I actually have never tried to > debug a kvm virtualised machine) > - I included a dirty hack to update EIP on every instruction. > - TSC_OFFSET > - ASID support > - Sanity checks > - Task switch and Ferr_Freeze Intercepts > - VMMCALL > - SMM support > - SVM-Lock > > I hope this is useful to someone. > I am going to continue to refine this patch until it implements all of > the SVM specification. > > Comments as well as patches are greatly appreciated. > > > Thanks, > > Alexander Graf > This is a reworked version of the same patch, where I can now boot into a x86_64 Linux kernel. I rewrote all the access functions for the VMCB, so this time everything should work just fine on BE-machines. As suggested I moved the injection detection to translate.c, so the non-virtualized machine should be as fast as before (w/o svm support), while the virtual one got a speed boost from that as well. I removed the EIP hack and set EIP every time an interception occurs, so unlike the previous version this patch really should have no negative effect on speed any more. If any of the people on this list using SVM (kvm developers, maybe xen developers) could have a deep look into this I'd be really thankful. Thanks, Alexander Graf