ia64/xen-unstable
changeset 18651:3411819435b9
svm: Check exitcode for NRIP validity only in debug builds.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Oct 17 12:12:50 2008 +0100 (2008-10-17) |
parents | 609d0d34450f |
children | 4129f0f2f2ba |
files | xen/arch/x86/hvm/svm/emulate.c |
line diff
1.1 --- a/xen/arch/x86/hvm/svm/emulate.c Fri Oct 17 12:04:11 2008 +0100 1.2 +++ b/xen/arch/x86/hvm/svm/emulate.c Fri Oct 17 12:12:50 2008 +0100 1.3 @@ -68,24 +68,25 @@ static unsigned long svm_nextrip_insn_le 1.4 if ( !cpu_has_svm_nrips || (vmcb->nextrip <= vmcb->rip) ) 1.5 return 0; 1.6 1.7 +#ifndef NDEBUG 1.8 switch ( vmcb->exitcode ) 1.9 { 1.10 case VMEXIT_CR0_READ... VMEXIT_DR15_WRITE: 1.11 /* faults due to instruction intercepts */ 1.12 /* (exitcodes 84-95) are reserved */ 1.13 case VMEXIT_IDTR_READ ... VMEXIT_TR_WRITE: 1.14 - case VMEXIT_RDTSC ... VMEXIT_SWINT: 1.15 - case VMEXIT_INVD ... VMEXIT_INVLPGA: 1.16 + case VMEXIT_RDTSC ... VMEXIT_MSR: 1.17 case VMEXIT_VMRUN ... VMEXIT_MWAIT_CONDITIONAL: 1.18 - case VMEXIT_IOIO: 1.19 /* ...and the rest of the #VMEXITs */ 1.20 case VMEXIT_CR0_SEL_WRITE: 1.21 - case VMEXIT_MSR: 1.22 case VMEXIT_EXCEPTION_BP: 1.23 - return vmcb->nextrip - vmcb->rip; 1.24 + break; 1.25 + default: 1.26 + BUG(); 1.27 } 1.28 - 1.29 - return 0; 1.30 +#endif 1.31 + 1.32 + return vmcb->nextrip - vmcb->rip; 1.33 } 1.34 1.35 /* First byte: Length. Following bytes: Opcode bytes. */