Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Avi Kivity
On 08/15/2010 07:11 PM, Gleb Natapov wrote: Neither are possible. We can have one cpu in big real mode and others in paged mode, so even in real mode we cannot rule out a spurious page fault due to shadow write protection. Correct, just checking X86EMUL_MODE_REAL is not enough due to smp, b

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Gleb Natapov
On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: > If emulation fails due to the instruction being unemulated. Return immediately > instead of restarting the instruction and infinitely trying to execute it. > This is already handled correctly as far as I can see. Sometimes instructi

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Gleb Natapov
On Sun, Aug 15, 2010 at 03:43:15PM +0300, Mohammed Gamal wrote: > 2010/8/15 Gleb Natapov : > > On Sun, Aug 15, 2010 at 03:40:00PM +0300, Mohammed Gamal wrote: > >> On Sun, Aug 15, 2010 at 10:32 AM, Gleb Natapov wrote: > >> > On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: > >> >> I

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Gleb Natapov
On Sun, Aug 15, 2010 at 06:58:06PM +0300, Avi Kivity wrote: > On 08/15/2010 03:49 PM, Gleb Natapov wrote: > >> > >>True. Can we do it for real mode in general (i.e. X86EMUL_MODE_REAL)? > >If we flush all shadow pages when moving from paged mode to non paged > >checking for X86EMUL_MODE_REAL sounds

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Gleb Natapov
On Sun, Aug 15, 2010 at 03:40:00PM +0300, Mohammed Gamal wrote: > On Sun, Aug 15, 2010 at 10:32 AM, Gleb Natapov wrote: > > On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: > >> If emulation fails due to the instruction being unemulated. Return > >> immediately > >> instead of rest

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Avi Kivity
On 08/15/2010 03:49 PM, Gleb Natapov wrote: True. Can we do it for real mode in general (i.e. X86EMUL_MODE_REAL)? If we flush all shadow pages when moving from paged mode to non paged checking for X86EMUL_MODE_REAL sounds enough to me, but Avi knows better. Or we can add is_big_real_mode() cal

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Avi Kivity
On 08/15/2010 03:43 PM, Mohammed Gamal wrote: 2010/8/15 Gleb Natapov: On Sun, Aug 15, 2010 at 03:40:00PM +0300, Mohammed Gamal wrote: On Sun, Aug 15, 2010 at 10:32 AM, Gleb Natapov wrote: On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: If emulation fails due to the instructi

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Mohammed Gamal
On Sun, Aug 15, 2010 at 10:32 AM, Gleb Natapov wrote: > On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: >> If emulation fails due to the instruction being unemulated. Return >> immediately >> instead of restarting the instruction and infinitely trying to execute it. >> > This is a

Re: [PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-15 Thread Mohammed Gamal
2010/8/15 Gleb Natapov : > On Sun, Aug 15, 2010 at 03:40:00PM +0300, Mohammed Gamal wrote: >> On Sun, Aug 15, 2010 at 10:32 AM, Gleb Natapov wrote: >> > On Sat, Aug 14, 2010 at 06:51:34PM +0300, Mohammed Gamal wrote: >> >> If emulation fails due to the instruction being unemulated. Return >> >> i

[PATCH 2/2] x86: Bail out on unemulated instructions

2010-08-14 Thread Mohammed Gamal
If emulation fails due to the instruction being unemulated. Return immediately instead of restarting the instruction and infinitely trying to execute it. Signed-off-by: Mohammed Gamal --- arch/x86/kvm/x86.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kv