Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Jan Kiszka
Marcelo Tosatti wrote: > On Thu, Apr 08, 2010 at 11:05:56AM +0300, Avi Kivity wrote: >> On 04/08/2010 10:54 AM, Jan Kiszka wrote: >> Looks like KVM_SET_REGS should write rmode.save_iopl (and a new save_vm)? >> > Just like we manipulate the flags for guest debugging in the > set/get_

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Marcelo Tosatti
On Thu, Apr 08, 2010 at 09:54:35AM +0200, Jan Kiszka wrote: > The following patch fixes it, but it has some drawbacks: > > - cpu_synchronize_state+writeback is noticeably slow with tpr patching, > this makes it slower. > > > >>> Isn't it a very rare event?

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Avi Kivity
On 04/08/2010 05:16 PM, Marcelo Tosatti wrote: On Thu, Apr 08, 2010 at 11:05:56AM +0300, Avi Kivity wrote: On 04/08/2010 10:54 AM, Jan Kiszka wrote: Looks like KVM_SET_REGS should write rmode.save_iopl (and a new save_vm)? Just like we manipulate the flags for

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Marcelo Tosatti
On Thu, Apr 08, 2010 at 11:05:56AM +0300, Avi Kivity wrote: > On 04/08/2010 10:54 AM, Jan Kiszka wrote: > > > Looks like KVM_SET_REGS should write rmode.save_iopl (and a new save_vm)? > > >>>Just like we manipulate the flags for guest debugging in the > >>>set/get_rflags vendor handlers, t

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Avi Kivity
On 04/08/2010 10:54 AM, Jan Kiszka wrote: Looks like KVM_SET_REGS should write rmode.save_iopl (and a new save_vm)? Just like we manipulate the flags for guest debugging in the set/get_rflags vendor handlers, the same should happen for IOPL and VM. This is no business of enter_p

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Jan Kiszka
Avi Kivity wrote: > On 04/08/2010 10:22 AM, Jan Kiszka wrote: >> Avi Kivity wrote: >> >>> On 04/07/2010 11:24 PM, Marcelo Tosatti wrote: >>> During initialization, WinXP.32 switches to virtual-8086 mode, with paging enabled, to use VGABIOS functions. Since enter_pmode

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Avi Kivity
On 04/08/2010 10:22 AM, Jan Kiszka wrote: Avi Kivity wrote: On 04/07/2010 11:24 PM, Marcelo Tosatti wrote: During initialization, WinXP.32 switches to virtual-8086 mode, with paging enabled, to use VGABIOS functions. Since enter_pmode unconditionally clears IOPL and VM bits in RFLAGS

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Jan Kiszka
Avi Kivity wrote: > On 04/07/2010 11:24 PM, Marcelo Tosatti wrote: >> During initialization, WinXP.32 switches to virtual-8086 mode, with >> paging enabled, to use VGABIOS functions. >> >> Since enter_pmode unconditionally clears IOPL and VM bits in RFLAGS >> >> flags = vmcs_readl(GUEST_RF

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-07 Thread Avi Kivity
On 04/07/2010 11:24 PM, Marcelo Tosatti wrote: During initialization, WinXP.32 switches to virtual-8086 mode, with paging enabled, to use VGABIOS functions. Since enter_pmode unconditionally clears IOPL and VM bits in RFLAGS flags = vmcs_readl(GUEST_RFLAGS); flags&= ~(X86_EFLA

VMX and save/restore guest in virtual-8086 mode

2010-04-07 Thread Marcelo Tosatti
During initialization, WinXP.32 switches to virtual-8086 mode, with paging enabled, to use VGABIOS functions. Since enter_pmode unconditionally clears IOPL and VM bits in RFLAGS flags = vmcs_readl(GUEST_RFLAGS); flags &= ~(X86_EFLAGS_IOPL | X86_EFLAGS_VM); flags |= (vmx->