Thank you Jun! I see that in case of VMX does not emulated the instruction that produced a UD exception, it just queues the exception and returns 1. After that KVM will still try to enter virtualized execution and so forth, the execution probably finishing with a DF and shut down. It does not seem that KVM, in case of VMX, will exit immediately on UD. I am not sure what you meant with MOVBE emulation. Thanks, Alex On Mon, May 5, 2014 at 12:34 PM, Nakajima, Jun <jun.nakajima@xxxxxxxxx> wrote: > On Mon, May 5, 2014 at 8:56 AM, Alexandru Duţu <alex.dutu@xxxxxxxxx> wrote: >> Dear all, >> >> It seems that currently, on UD interception KVM does not exit >> completely. Virtualized execution finishes, KVM executes >> ud_intercept() after which it enters virtualized execution again. > > Maybe you might want to take a look at the VMX side (to port it to > SVM). The MOVBE emulation, for example, should be helpful. > >> >> I am working on accelerating with virtualized execution a simulator >> that emulates system calls. Essentially doing virtualized execution >> without a OS kernel. In order to make this work, I had to modify my >> the KVM kernel module such that ud_intercept() return 0 and not 1 >> which break KVM __vcpu_run loop. This is necessary as I need to trap >> syscall instructions, exit virtualized execution with UD exception, >> emulate the system call in the simulator and after the system call is >> done enter back in virtualized mode and start execution with the help >> of KVM. >> >> So by modifying ud_intercept() to return 0, I got all this to work. Is >> it possible to achieve the same effect (exit on undefined opcode) >> without modifying ud_intercept()? >> >> It seems that re-entering virtualized execution on UD interception >> gives the user the flexibility of running binaries with newer >> instructions on older hardware, if kvm is able to emulate the newer >> instructions. I do not fully understand the details of this scenario, >> is there such a scenario or is it likely that ud_interception() will >> change? >> >> Thank you in advance! >> >> Best regards, >> Alex >> -- > > -- > Jun > Intel Open Source Technology Center -- Alex -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html