qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 6/9] target-i386: Handle I/O breakpoints


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v2 6/9] target-i386: Handle I/O breakpoints
Date: Mon, 19 Oct 2015 15:30:36 -0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Oct 16, 2015 at 01:23:36PM -0300, Eduardo Habkost wrote:
> From: Richard Henderson <address@hidden>
> 
> Signed-off-by: Richard Henderson <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]