Received: from eggs.gnu.org ([2001:4830:134:3::10]:37426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEGj-0008T5-4m for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoEGf-0002QF-G7 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEGf-0002QB-A6 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:30:41 -0400 Date: Mon, 19 Oct 2015 15:30:36 -0200 From: Eduardo Habkost Message-ID: <20151019173036.GB8672@thinpad.lan.raisama.net> References: <1445012619-23772-1-git-send-email-ehabkost@redhat.com> <1445012619-23772-7-git-send-email-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445012619-23772-7-git-send-email-ehabkost@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 6/9] target-i386: Handle I/O breakpoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson On Fri, Oct 16, 2015 at 01:23:36PM -0300, Eduardo Habkost wrote: > From: Richard Henderson > > Signed-off-by: Richard Henderson > Signed-off-by: Eduardo Habkost > --- > Changes v1 -> v2: > * Rebase on top of new version of "Re-introduce optimal breakpoint > removal" > --- > target-i386/bpt_helper.c | 98 +++++++++++++++++++++++++++++++++++------------- > target-i386/cpu.h | 2 + > target-i386/helper.h | 1 + > target-i386/translate.c | 20 +++++++++- > 4 files changed, 93 insertions(+), 28 deletions(-) > > diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c > index 0563abd..00f3942 100644 > --- a/target-i386/bpt_helper.c > +++ b/target-i386/bpt_helper.c > @@ -49,60 +49,72 @@ static inline int hw_breakpoint_len(unsigned long dr7, int index) > return (len == 2) ? 8 : len + 1; > } > > -static void hw_breakpoint_insert(CPUX86State *env, int index) > +static int hw_breakpoint_insert(CPUX86State *env, int index) > { > CPUState *cs = CPU(x86_env_get_cpu(env)); > - int type = 0, err = 0; > + target_ulong dr7 = env->dr[7]; > + target_ulong drN = env->dr[index]; > + int err = 0; > > - switch (hw_breakpoint_type(env->dr[7], index)) { > + switch (hw_breakpoint_type(dr7, index)) { > case DR7_TYPE_BP_INST: > - if (hw_breakpoint_enabled(env->dr[7], index)) { > - err = cpu_breakpoint_insert(cs, env->dr[index], BP_CPU, > + if (hw_breakpoint_enabled(dr7, index)) { > + err = cpu_breakpoint_insert(cs, drN, BP_CPU, > &env->cpu_breakpoint[index]); > } > break; > - case DR7_TYPE_DATA_WR: > - type = BP_CPU | BP_MEM_WRITE; > - break; > + > case DR7_TYPE_IO_RW: > - /* No support for I/O watchpoints yet */ > + /* Notice when we should enable calls to bpt_io. */ > + return (hw_breakpoint_enabled(env->dr[7], index) > + ? HF_IOBPT_MASK : 0); checkpatch.pl error: ERROR: return is not a function, parentheses are not required #57: FILE: target-i386/bpt_helper.c:69: + return (hw_breakpoint_enabled(env->dr[7], index) total: 1 errors, 0 warnings, 242 lines checked I will fix it in v3. -- Eduardo