All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Nguyen Anh Quynh <aquynh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] hardware debug register handling
Date: Thu, 19 Jul 2007 11:35:12 +0300	[thread overview]
Message-ID: <469F2240.2090506@qumranet.com> (raw)
In-Reply-To: <9cde8bff0707190045je125293w5c6414e81f86f58b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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/

  parent reply	other threads:[~2007-07-19  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19  7:45 [PATCH] hardware debug register handling Nguyen Anh Quynh
     [not found] ` <9cde8bff0707190045je125293w5c6414e81f86f58b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-07-19  8:35   ` Avi Kivity [this message]
     [not found]     ` <469F2240.2090506-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-19  8:41       ` Nguyen Anh Quynh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=469F2240.2090506@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=aquynh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.