From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129473 invoked by alias); 23 Mar 2018 17:15:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 120050 invoked by uid 89); 23 Mar 2018 17:15:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Style, Mr, schwab@suse.de, Wrong X-HELO: mail-lf0-f66.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YWmtgC0CKrUT6wffgQwQIKGGHd49PIO0SEA1DCRHuNY=; b=Sk7oph8IqrQtck7uj3DlpUbYQ3/2Oox4wb/NNfKiFrXS6Y3pW9STfRi7rRi2ThPg6z nyIczl4DT7qf6ivTTixPjFZfDa6vLWkKHqkOXCCZ9HGckOSEhVWLCJDiB5VfrnCHmwtp 8GxKrNIsDczTHxgehsWMrqzQ+yk3yFKqZAoDhVU28UuFmFxImNVyPp/wfR59DZUrUUsH hIzF+hnX+S6wvmgOS6Li02ddYMVkGXFySBjAaCxEkvYMf4Uo4S1oElRPx8eDLDcm8vZX txbjUEv98usZe1WlGpQf0Sge33LBPYjl48NvQs9sRq/aR2X8Q+Fik9MwEEVxOmsPQ1e9 aW6w== X-Gm-Message-State: AElRT7Gc4KBop/0ZZheTRkUsNUUfEuJ3QwxdimZQMi0NBluMFZAEozn3 n7djreycgNnrAgYXO2TkDEunqSWbDZ+PJfkMkghIMw== X-Google-Smtp-Source: AG47ELvZUyotuFOjC/2iq0ku6jqJzGzu4DcWXb1gd7naGCHHhW42ldZe+YYjtSgkfZ0tBaYexh5VgB54qdV5JVy6ejc= X-Received: by 2002:a19:1d12:: with SMTP id d18-v6mr19459763lfd.128.1521825323106; Fri, 23 Mar 2018 10:15:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <597954a1-85da-e524-1454-27c46af57413@redhat.com> <8c8ab285-bddc-90e6-a50e-7be89703367a@redhat.com> From: Andrew Senkevich Date: Fri, 23 Mar 2018 17:15:00 -0000 Message-ID: Subject: Re: [PATCH] Fix i386 memmove issue [BZ #22644] To: Andreas Schwab Cc: "H.J. Lu" , Florian Weimer , Szabolcs Nagy , nd , libc-alpha , Max Horn , thomas@grindinggear.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-03/txt/msg00537.txt.bz2 2018-03-20 9:58 GMT+01:00 Andreas Schwab : > On M=C3=A4r 19 2018, Andrew Senkevich wrot= e: > >> diff --git a/string/test-memmove.c b/string/test-memmove.c >> index edc7a4c..9f1437d 100644 >> --- a/string/test-memmove.c >> +++ b/string/test-memmove.c >> @@ -24,6 +24,7 @@ >> # define TEST_NAME "memmove" >> #endif >> #include "test-string.h" >> +#include >> >> char *simple_memmove (char *, const char *, size_t); >> >> @@ -245,6 +246,60 @@ do_random_tests (void) >> } >> } >> >> +static void >> +do_test2 (void) >> +{ >> + size_t size =3D 0x20000000; >> + uint32_t * large_buf; >> + >> + large_buf =3D mmap ((void*)0x70000000, size, PROT_READ | PROT_WRITE, >> + MAP_PRIVATE | MAP_ANON, -1, 0); > > Style: line up indentation with paren. > >> + >> + if (large_buf =3D=3D MAP_FAILED) >> + error (EXIT_UNSUPPORTED, errno, "Large mmap failed"); >> + >> + if ((uintptr_t)large_buf > 0x80000000 - 128 >> + || 0x80000000 - (uintptr_t)large_buf > 0x20000000) > > Style: space after cast. > >> + { >> + error (0, 0,"Large mmap allocated improperly"); > > Style: space after comma. > >> + ret =3D EXIT_UNSUPPORTED; >> + munmap((void *)large_buf, size); > > Style: space before paren and after cast. > >> + return; >> + } >> + >> + size_t bytes_move =3D 0x80000000 - (uintptr_t)large_buf; > > Style: space after cast. > >> + size_t arr_size =3D bytes_move / sizeof(uint32_t); > > Style: space before paren. > >> + size_t i; >> + >> + FOR_EACH_IMPL (impl, 0) >> + { >> + for (i =3D 0; i < arr_size; i++) >> + large_buf[i] =3D i; >> + >> + uint32_t * dst =3D &large_buf[33]; >> + >> +#ifdef TEST_BCOPY >> + CALL (impl, (char *)large_buf, (char *)dst, bytes_move); >> +#else >> + CALL (impl, (char *)dst, (char *)large_buf, bytes_move); >> +#endif > > Styles: space after cast. > >> + >> + for (i =3D 0; i < arr_size; i++) >> + { >> + if (dst[i] !=3D i) >> + { > > Style: wrong indentation. > >> + error (0, 0, >> + "Wrong result in function %s dst \"%p\" src \"%p\" offset \"%d\"", >> + impl->name, dst, large_buf, i); > > Style: line up indentation with paren. > >> + ret =3D 1; >> + break; >> + } >> + } >> + } >> + >> + munmap((void *)large_buf, size); > > Style: space before paren and after cast. Thanks, committed with fixed style. I will also backport it to affected branches. -- WBR, Andrew