Nguyen Anh Quynh wrote:
> Currently, when handling hardware breakpoints, we always set values
> for all the 4 hardware debug registers, regardless it is needed or
> not. This patch fixes the bug.

Why is this a problem?  Only enabled breakpoints are programmed into dr7.

> @@ -1519,12 +1522,18 @@ static void do_interrupt_requests(struct kvm_vcpu 
> *vcpu,
>  
>  static void kvm_guest_debug_pre(struct kvm_vcpu *vcpu)
>  {
> +#define SET_DEBUGREG(i) \
> +     if (dbg->bp[i].enabled) { \
> +             set_debugreg(dbg->bp[i].address, i); \
> +     }
> +
>       struct kvm_guest_debug *dbg = &vcpu->guest_debug;
>  
> -     set_debugreg(dbg->bp[0], 0);
> -     set_debugreg(dbg->bp[1], 1);
> -     set_debugreg(dbg->bp[2], 2);
> -     set_debugreg(dbg->bp[3], 3);
> +     SET_DEBUGREG(0);
> +     SET_DEBUGREG(1);
> +     SET_DEBUGREG(2);
> +     SET_DEBUGREG(3);
> +#undef SET_DEBUGREG
>   

Why those ugly macros?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to