diff -r d1b0a5adaeab xen/arch/x86/oprofile/xenoprof.c --- a/xen/arch/x86/oprofile/xenoprof.c Wed Nov 29 23:40:40 2006 +++ b/xen/arch/x86/oprofile/xenoprof.c Thu Nov 30 02:00:10 2006 @@ -37,11 +37,11 @@ int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs) { + if ( is_hvm_vcpu(v) ) + return ((regs->cs & 3) != 3); + if ( !guest_mode(regs) ) return 2; - - if ( is_hvm_vcpu(v) ) - return ((regs->cs & 3) != 3); return guest_kernel_mode(v, regs); }