Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/805041/?format=api
{ "id": 805041, "url": "http://patchwork.ozlabs.org/api/patches/805041/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr/", "date": "2017-08-23T14:54:32", "name": "[1/4] powerpc/32: add memset16()", "commit_ref": "da74f659205ea08cb0fd0b3050637b0e0eb31520", "pull_url": null, "state": "accepted", "archived": false, "hash": "2631508a9b586d2997c46523847ccd0b1ca782b8", "submitter": { "id": 5234, "url": "http://patchwork.ozlabs.org/api/people/5234/?format=api", "name": "Christophe Leroy", "email": "christophe.leroy@c-s.fr" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/805041/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/805041/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xcrCl56XWz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 24 Aug 2017 00:58:43 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xcrCl3n91zDql5\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 24 Aug 2017 00:58:43 +1000 (AEST)", "from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xcr700SMnzDqYs\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 24 Aug 2017 00:54:35 +1000 (AEST)", "from localhost (mailhub1-int [192.168.12.234])\n\tby localhost (Postfix) with ESMTP id 3xcr6j6CWbz9ttFM;\n\tWed, 23 Aug 2017 16:54:21 +0200 (CEST)", "from pegase1.c-s.fr ([192.168.12.234])\n\tby localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 5eW6EpCDTPP8; Wed, 23 Aug 2017 16:54:21 +0200 (CEST)", "from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192])\n\tby pegase1.c-s.fr (Postfix) with ESMTP id 3xcr6j5KMzz9ttBy;\n\tWed, 23 Aug 2017 16:54:21 +0200 (CEST)", "from localhost (localhost [127.0.0.1])\n\tby messagerie.si.c-s.fr (Postfix) with ESMTP id B78228B80C;\n\tWed, 23 Aug 2017 16:54:32 +0200 (CEST)", "from messagerie.si.c-s.fr ([127.0.0.1])\n\tby localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new,\n\tport 10023)\n\twith ESMTP id 4VI7D08mqgN6; Wed, 23 Aug 2017 16:54:32 +0200 (CEST)", "from po15668-vm-win7.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr\n\t[172.25.231.1])\n\tby messagerie.si.c-s.fr (Postfix) with ESMTP id 943C88B802;\n\tWed, 23 Aug 2017 16:54:32 +0200 (CEST)", "by po15668-vm-win7.idsi0.si.c-s.fr (Postfix, from userid 0)\n\tid 8C40F679CE; Wed, 23 Aug 2017 16:54:32 +0200 (CEST)" ], "X-Virus-Scanned": [ "Debian amavisd-new at c-s.fr", "amavisd-new at c-s.fr" ], "Message-Id": "<118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr>", "In-Reply-To": "<cover.1503277387.git.christophe.leroy@c-s.fr>", "References": "<cover.1503277387.git.christophe.leroy@c-s.fr>", "From": "Christophe Leroy <christophe.leroy@c-s.fr>", "Subject": "[PATCH 1/4] powerpc/32: add memset16()", "To": "Benjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tPaul Mackerras <paulus@samba.org>,\n\tMichael Ellerman <mpe@ellerman.id.au>, Scott Wood <oss@buserror.net>", "Date": "Wed, 23 Aug 2017 16:54:32 +0200 (CEST)", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "\"Naveen N. Rao\" <naveen.n.rao@linux.vnet.ibm.com>,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "Commit 694fc88ce271f (\"powerpc/string: Implement optimized\nmemset variants\") added memset16(), memset32() and memset64()\nfor the 64 bits PPC.\n\nOn 32 bits, memset64() is not relevant, and as shown below,\nthe generic version of memset32() gives a good code, so only\nmemset16() is candidate for an optimised version.\n\n000009c0 <memset32>:\n 9c0: 2c 05 00 00 cmpwi r5,0\n 9c4: 39 23 ff fc addi r9,r3,-4\n 9c8: 4d 82 00 20 beqlr\n 9cc: 7c a9 03 a6 mtctr r5\n 9d0: 94 89 00 04 stwu r4,4(r9)\n 9d4: 42 00 ff fc bdnz 9d0 <memset32+0x10>\n 9d8: 4e 80 00 20 blr\n\nThe last part of memset() handling the not 4-bytes multiples\noperates on bytes, making it unsuitable for handling word without\nmodification. As it would increase memset() complexity, it is\nbetter to implement memset16() from scratch. In addition it\nhas the advantage of allowing a more optimised memset16() than what\nwe would have by using the memset() function.\n\nSigned-off-by: Christophe Leroy <christophe.leroy@c-s.fr>\n---\n arch/powerpc/include/asm/string.h | 4 +++-\n arch/powerpc/lib/copy_32.S | 14 ++++++++++++++\n 2 files changed, 17 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h\nindex b0e82466d4e8..b9f54bb34db6 100644\n--- a/arch/powerpc/include/asm/string.h\n+++ b/arch/powerpc/include/asm/string.h\n@@ -10,6 +10,7 @@\n #define __HAVE_ARCH_MEMMOVE\n #define __HAVE_ARCH_MEMCMP\n #define __HAVE_ARCH_MEMCHR\n+#define __HAVE_ARCH_MEMSET16\n \n extern char * strcpy(char *,const char *);\n extern char * strncpy(char *,const char *, __kernel_size_t);\n@@ -24,7 +25,6 @@ extern int memcmp(const void *,const void *,__kernel_size_t);\n extern void * memchr(const void *,int,__kernel_size_t);\n \n #ifdef CONFIG_PPC64\n-#define __HAVE_ARCH_MEMSET16\n #define __HAVE_ARCH_MEMSET32\n #define __HAVE_ARCH_MEMSET64\n \n@@ -46,6 +46,8 @@ static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)\n {\n \treturn __memset64(p, v, n * 8);\n }\n+#else\n+extern void *memset16(uint16_t *, uint16_t, __kernel_size_t);\n #endif\n #endif /* __KERNEL__ */\n \ndiff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S\nindex 8aedbb5f4b86..a14d4df2ebc9 100644\n--- a/arch/powerpc/lib/copy_32.S\n+++ b/arch/powerpc/lib/copy_32.S\n@@ -67,6 +67,20 @@ CACHELINE_BYTES = L1_CACHE_BYTES\n LG_CACHELINE_BYTES = L1_CACHE_SHIFT\n CACHELINE_MASK = (L1_CACHE_BYTES-1)\n \n+_GLOBAL(memset16)\n+\trlwinm.\tr0 ,r5, 31, 1, 31\n+\taddi\tr6, r3, -4\n+\tbeq-\t2f\n+\trlwimi\tr4 ,r4 ,16 ,0 ,15\n+\tmtctr\tr0\n+1:\tstwu\tr4, 4(r6)\n+\tbdnz\t1b\n+2:\tandi.\tr0, r5, 1\n+\tbeqlr\n+\tsth\tr4, 4(r6)\n+\tblr\n+EXPORT_SYMBOL(memset16)\n+\n /*\n * Use dcbz on the complete cache lines in the destination\n * to set them to zero. This requires that the destination\n", "prefixes": [ "1/4" ] }