Re: RFC: Task switch emulation fails for VM86 mode

2017-07-10 Thread Nadav Amit
Paolo Bonzini wrote: > On 10/07/2017 17:48, Nadav Amit wrote: Any proposal is a great appreciated. :) >> I don’t see a (very) easy solution. The code was (apparently) never built to >> deal with a task switch during an instruction emulation. >> >> AFAIU kvm_task_switch() expects information

Re: RFC: Task switch emulation fails for VM86 mode

2017-07-10 Thread Paolo Bonzini
On 10/07/2017 17:48, Nadav Amit wrote: >>> >>> Any proposal is a great appreciated. :) > I don’t see a (very) easy solution. The code was (apparently) never built to > deal with a task switch during an instruction emulation. > > AFAIU kvm_task_switch() expects information about the task-switch fro

Re: RFC: Task switch emulation fails for VM86 mode

2017-07-10 Thread Nadav Amit
Wanpeng Li wrote: > Cc Nadav, Jan, > 2017-07-09 15:30 GMT+08:00 Wanpeng Li : >> Hi all, >> >> I found that task switch emulation fails to work for VM86 mode if >> guest state is invalid. It can be reproduced by running >> kvm-unit-tests/taskswitch2.flat, EPT = 0 or EPT=1, >> unrestricted_guest=N

Re: RFC: Task switch emulation fails for VM86 mode

2017-07-10 Thread Wanpeng Li
Cc Nadav, Jan, 2017-07-09 15:30 GMT+08:00 Wanpeng Li : > Hi all, > > I found that task switch emulation fails to work for VM86 mode if > guest state is invalid. It can be reproduced by running > kvm-unit-tests/taskswitch2.flat, EPT = 0 or EPT=1, > unrestricted_guest=N, emulate_invalid_guest_state=Y

RFC: Task switch emulation fails for VM86 mode

2017-07-09 Thread Wanpeng Li
Hi all, I found that task switch emulation fails to work for VM86 mode if guest state is invalid. It can be reproduced by running kvm-unit-tests/taskswitch2.flat, EPT = 0 or EPT=1, unrestricted_guest=N, emulate_invalid_guest_state=Y. When EPT=1, unrestricted_guest=Y, emulate_invalid_state=Y, the