lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fUtEvW9h7N=w3vvYBB3vytnTXJsXrHDD6zLA2DzYFOBHQ@mail.gmail.com>
Date:   Thu, 7 Sep 2023 23:23:46 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf annotate: Add more x86 mov instruction cases

On Thu, Sep 7, 2023 at 10:22 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> Instructions with sign- and zero- extention like movsbl and movzwq were
> not handled properly.  As it can check different size suffix (-b, -w, -l
> or -q) we can omit that and add the common parts even though some
> combinations are not possible.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/arch/x86/annotate/instructions.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c
> index 5f4ac4fc7fcf..5cdf457f5cbe 100644
> --- a/tools/perf/arch/x86/annotate/instructions.c
> +++ b/tools/perf/arch/x86/annotate/instructions.c
> @@ -74,12 +74,15 @@ static struct ins x86__instructions[] = {
>         { .name = "movdqa",     .ops = &mov_ops,  },
>         { .name = "movdqu",     .ops = &mov_ops,  },
>         { .name = "movsd",      .ops = &mov_ops,  },
> -       { .name = "movslq",     .ops = &mov_ops,  },
>         { .name = "movss",      .ops = &mov_ops,  },
> +       { .name = "movsb",      .ops = &mov_ops,  },
> +       { .name = "movsw",      .ops = &mov_ops,  },
> +       { .name = "movsl",      .ops = &mov_ops,  },

In Intel's manual some of these names are "Move Data From String to
String" operations, movsb and movsw in particular. These instructions
can be used to make simple memcpy loops. Could it be the past omission
was deliberate due to the different way the addressing works in the
instructions?

Thanks,
Ian

>         { .name = "movupd",     .ops = &mov_ops,  },
>         { .name = "movups",     .ops = &mov_ops,  },
> -       { .name = "movzbl",     .ops = &mov_ops,  },
> -       { .name = "movzwl",     .ops = &mov_ops,  },
> +       { .name = "movzb",      .ops = &mov_ops,  },
> +       { .name = "movzw",      .ops = &mov_ops,  },
> +       { .name = "movzl",      .ops = &mov_ops,  },
>         { .name = "mulsd",      .ops = &mov_ops,  },
>         { .name = "mulss",      .ops = &mov_ops,  },
>         { .name = "nop",        .ops = &nop_ops,  },
> --
> 2.42.0.283.g2d96d420d3-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ