{"id":831047,"url":"http://patchwork.ozlabs.org/api/1.2/patches/831047/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20171027040833.3644-6-aneesh.kumar@linux.vnet.ibm.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.2/projects/2/?format=json","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":"<20171027040833.3644-6-aneesh.kumar@linux.vnet.ibm.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20171027040833.3644-6-aneesh.kumar@linux.vnet.ibm.com/","date":"2017-10-27T04:08:22","name":"[05/16] powerpc/mm: use hash_invalidate for __kernel_map_pages()","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"530f48c3f2b6840ebc77e353f0abadc0f1a9affe","submitter":{"id":664,"url":"http://patchwork.ozlabs.org/api/1.2/people/664/?format=json","name":"Aneesh Kumar K.V","email":"aneesh.kumar@linux.vnet.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20171027040833.3644-6-aneesh.kumar@linux.vnet.ibm.com/mbox/","series":[{"id":10486,"url":"http://patchwork.ozlabs.org/api/1.2/series/10486/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=10486","date":"2017-10-27T04:08:17","name":"Remove hash page table slot tracking from linux PTE","version":1,"mbox":"http://patchwork.ozlabs.org/series/10486/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/831047/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/831047/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 [IPv6:2401:3900:2:1::3])\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 3yNVw42ddTz9t2S\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:17:40 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3yNVw41rfMzDrkB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:17:40 +1100 (AEDT)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3yNVkS0kSpzDrcq\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 27 Oct 2017 15:09:19 +1100 (AEDT)","from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv9R492QI141858\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 27 Oct 2017 00:09:17 -0400","from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2dustahpfb-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 27 Oct 2017 00:09:17 -0400","from localhost\n\tby e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<aneesh.kumar@linux.vnet.ibm.com>; Thu, 26 Oct 2017 22:09:16 -0600","from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17)\n\tby e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 26 Oct 2017 22:09:13 -0600","from b03ledav001.gho.boulder.ibm.com\n\t(b03ledav001.gho.boulder.ibm.com [9.17.130.232])\n\tby b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v9R49C2v65339618; Thu, 26 Oct 2017 21:09:12 -0700","from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 85CC66E121;\n\tThu, 26 Oct 2017 22:09:12 -0600 (MDT)","from skywalker.ibmmodules.com (unknown [9.85.199.61])\n\tby b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 0BA996E175;\n\tThu, 26 Oct 2017 22:09:09 -0600 (MDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=aneesh.kumar@linux.vnet.ibm.com; receiver=<UNKNOWN>)","From":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>","To":"benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au","Subject":"[PATCH 05/16] powerpc/mm: use hash_invalidate for\n\t__kernel_map_pages()","Date":"Fri, 27 Oct 2017 09:38:22 +0530","X-Mailer":"git-send-email 2.13.6","In-Reply-To":"<20171027040833.3644-1-aneesh.kumar@linux.vnet.ibm.com>","References":"<20171027040833.3644-1-aneesh.kumar@linux.vnet.ibm.com>","X-TM-AS-GCONF":"00","x-cbid":"17102704-0012-0000-0000-0000153472AB","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007958; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000239; SDB=6.00937034; UDB=6.00472245;\n\tIPR=6.00717296; \n\tBA=6.00005660; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017735;\n\tXFM=3.00000015; UTC=2017-10-27 04:09:15","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17102704-0013-0000-0000-000050088735","Message-Id":"<20171027040833.3644-6-aneesh.kumar@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-10-27_02:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tpriorityscore=1501\n\tmalwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0\n\tclxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0\n\tclassifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1707230000\n\tdefinitions=main-1710270053","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"linuxppc-dev@lists.ozlabs.org,\n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>","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":"Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\n---\n arch/powerpc/mm/hash_utils_64.c | 32 +++++---------------------------\n 1 file changed, 5 insertions(+), 27 deletions(-)","diff":"diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c\nindex b197fe57547e..8635b241e2d5 100644\n--- a/arch/powerpc/mm/hash_utils_64.c\n+++ b/arch/powerpc/mm/hash_utils_64.c\n@@ -119,11 +119,6 @@ EXPORT_SYMBOL_GPL(mmu_slb_size);\n #ifdef CONFIG_PPC_64K_PAGES\n int mmu_ci_restrictions;\n #endif\n-#ifdef CONFIG_DEBUG_PAGEALLOC\n-static u8 *linear_map_hash_slots;\n-static unsigned long linear_map_hash_count;\n-static DEFINE_SPINLOCK(linear_map_hash_lock);\n-#endif /* CONFIG_DEBUG_PAGEALLOC */\n struct mmu_hash_ops mmu_hash_ops;\n EXPORT_SYMBOL(mmu_hash_ops);\n \n@@ -1744,7 +1739,7 @@ long hpte_insert_repeating(unsigned long hash, unsigned long vpn,\n }\n \n #ifdef CONFIG_DEBUG_PAGEALLOC\n-static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi)\n+static void kernel_map_linear_page(unsigned long vaddr)\n {\n \tunsigned long hash;\n \tunsigned long vsid = get_kernel_vsid(vaddr, mmu_kernel_ssize);\n@@ -1761,12 +1756,7 @@ static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi)\n \tret = hpte_insert_repeating(hash, vpn, __pa(vaddr), mode,\n \t\t\t\t    HPTE_V_BOLTED,\n \t\t\t\t    mmu_linear_psize, mmu_kernel_ssize);\n-\n \tBUG_ON (ret < 0);\n-\tspin_lock(&linear_map_hash_lock);\n-\tBUG_ON(linear_map_hash_slots[lmi] & 0x80);\n-\tlinear_map_hash_slots[lmi] = ret | 0x80;\n-\tspin_unlock(&linear_map_hash_lock);\n }\n \n static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi)\n@@ -1776,35 +1766,23 @@ static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi)\n \tunsigned long vpn = hpt_vpn(vaddr, vsid, mmu_kernel_ssize);\n \n \thash = hpt_hash(vpn, PAGE_SHIFT, mmu_kernel_ssize);\n-\tspin_lock(&linear_map_hash_lock);\n-\tBUG_ON(!(linear_map_hash_slots[lmi] & 0x80));\n-\thidx = linear_map_hash_slots[lmi] & 0x7f;\n-\tlinear_map_hash_slots[lmi] = 0;\n-\tspin_unlock(&linear_map_hash_lock);\n-\tif (hidx & _PTEIDX_SECONDARY)\n-\t\thash = ~hash;\n-\tslot = (hash & htab_hash_mask) * HPTES_PER_GROUP;\n-\tslot += hidx & _PTEIDX_GROUP_IX;\n-\tmmu_hash_ops.hpte_invalidate(slot, vpn, mmu_linear_psize,\n+\tmmu_hash_ops.hash_invalidate(hash, vpn, mmu_linear_psize,\n \t\t\t\t     mmu_linear_psize,\n \t\t\t\t     mmu_kernel_ssize, 0);\n }\n \n void __kernel_map_pages(struct page *page, int numpages, int enable)\n {\n-\tunsigned long flags, vaddr, lmi;\n+\tunsigned long flags, vaddr;\n \tint i;\n \n \tlocal_irq_save(flags);\n \tfor (i = 0; i < numpages; i++, page++) {\n \t\tvaddr = (unsigned long)page_address(page);\n-\t\tlmi = __pa(vaddr) >> PAGE_SHIFT;\n-\t\tif (lmi >= linear_map_hash_count)\n-\t\t\tcontinue;\n \t\tif (enable)\n-\t\t\tkernel_map_linear_page(vaddr, lmi);\n+\t\t\tkernel_map_linear_page(vaddr);\n \t\telse\n-\t\t\tkernel_unmap_linear_page(vaddr, lmi);\n+\t\t\tkernel_unmap_linear_page(vaddr);\n \t}\n \tlocal_irq_restore(flags);\n }\n","prefixes":["05/16"]}