On 7/19/07, Avi Kivity <[EMAIL PROTECTED]> wrote:
> 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.
>

Ah, I see your point.

> > @@ -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?
>

It checks to see if it is necessary to set debug register.

But as it actually depends on dr7, so just ignore this patch.

Thanks,
Q

-------------------------------------------------------------------------
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