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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOG64qNB+aRU+8VCD5MkM4srQaUnTqzZ7rZ8USxVheDAYzgTsQ@mail.gmail.com>
Date:   Sun, 3 Sep 2023 02:28:18 +0700
From:   Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>
To:     Ammar Faizi <ammarfaizi2@...weeb.org>
Cc:     Willy Tarreau <w@....eu>,
        Thomas Weißschuh <linux@...ssschuh.net>,
        David Laight <David.Laight@...lab.com>,
        Nicholas Rosenberg <inori@...x.org>,
        Michael William Jonathan <moe@...weeb.org>,
        "GNU/Weeb Mailing List" <gwml@...r.gnuweeb.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v3 2/4] tools/nolibc: x86-64: Use `rep stosb` for `memset()`

On Sat, Sep 2, 2023 at 8:35 PM Ammar Faizi wrote:
>  __asm__ (
>  ".section .text.nolibc_memmove_memcpy\n"
>  ".weak memmove\n"
>  ".weak memcpy\n"
>  "memmove:\n"
>  "memcpy:\n"
>         "movq %rdx, %rcx\n\t"
>         "movq %rdi, %rax\n\t"
>         "movq %rdi, %rdx\n\t"
>         "subq %rsi, %rdx\n\t"
>         "cmpq %rcx, %rdx\n\t"
>         "jb   .Lbackward_copy\n\t"
>         "rep movsb\n\t"
>         "retq\n"
>  ".Lbackward_copy:"
>         "leaq -1(%rdi, %rcx, 1), %rdi\n\t"
>         "leaq -1(%rsi, %rcx, 1), %rsi\n\t"
>         "std\n\t"
>         "rep movsb\n\t"
>         "cld\n\t"
>         "retq\n"
> +
> +".section .text.nolibc_memset\n"
> +".weak memset\n"
> +"memset:\n"
> +       "xchgl %eax, %esi\n"
> +       "movq  %rdx, %rcx\n"
> +       "pushq %rdi\n"
> +       "rep stosb\n"
> +       "popq  %rax\n"
> +       "retq\n"
>  );

nit: Be consistent. Use \n\t for the memset too.

Apart from that:

Reviewed-by: Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>

-- Viro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ