From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CCF0C43219 for ; Thu, 2 May 2019 15:45:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE5D8204EC for ; Thu, 2 May 2019 15:45:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WXcXbi53"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aGlS/CAU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE5D8204EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=/ilJ9aPGFdccGBIU7lRdfvAT2LP4kXsr8l/NRLDkAUg=; b=WXcXbi53UW55CO7nELEV6PKv3w MBJatUY3L74B3Hej3EE+X+mv8LPkkvCpJdtB2ArjTNUKC92YF96r6AAE3S99zr+Cx7zpZ7p6ZRPe5 7ZrChau8VUHHuqO/CYarTaDffmDWll3lcBsf+Hs9SlMSvE3jPJNPTe8TuLnJh2CIXKVOyLJ1yIwS3 V6SjkiIc6yeqITdSiUM8KJ4LDDDjd3ve31bE8PDUdwRY9/g2CS8phu8UdWaRCzNbY8JFWu1GYZtSR j20fcWNTwpGvngPG2g1AXEFFSe/AKnRz6K2OD3/AStajXnvD4a1fU63HMuqtUNNh9HghFYqy3XcHM fgVQxurA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMDuC-0003vJ-Ju; Thu, 02 May 2019 15:45:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMDu3-0003OU-Uk for linux-riscv@bombadil.infradead.org; Thu, 02 May 2019 15:45:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:References:In-Reply-To:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0fiiqckF8Mi/GhwvClse+sT5/ssDG7190qvloGo2iVQ=; b=aGlS/CAUlg+ZNxLZ4yn+5mxiw dfxUoRf2iQq/+XdQJHT969ITH0H0pmZOBeBqFNCfi0pgtCfwaJYZv0IlxwMxUxT1UomSpQTOkL1lq cK/aINCSaAtbt868mqF+e8skJ60bxnw1w0SVPgaJHFBZ1908vm+0ipoGptF2G2WQcn5j97WY5J7ZL IDFk5ZFIozagz5wuHyuteRiZE2VNhseXeXuM0MPJJdCE92CIa4T9Cacili3xk2W113TdnBvtIdvGm agKJ7iugxDnr6+Ep02UxrVjJ1N09Z+ECsdNo7hjaHbOOmWSAq+IfoO1+WCjU4G2BQYpsl3cctS7rD dJNhCrJxA==; Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMDf1-0002qo-3k for linux-riscv@lists.infradead.org; Thu, 02 May 2019 15:30:13 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x42FT9VG007537 for ; Thu, 2 May 2019 11:30:10 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2s8235ucp0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 02 May 2019 11:30:09 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 May 2019 16:30:07 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 2 May 2019 16:29:58 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x42FTvKB47251698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 May 2019 15:29:57 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E57AAE04D; Thu, 2 May 2019 15:29:57 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 062F3AE051; Thu, 2 May 2019 15:29:53 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.205.209]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 2 May 2019 15:29:52 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 02 May 2019 18:29:52 +0300 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 12/15] powerpc/nohash/64: switch to generic version of pte allocation Date: Thu, 2 May 2019 18:28:39 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> References: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19050215-4275-0000-0000-00000330AE6F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050215-4276-0000-0000-000038400E24 Message-Id: <1556810922-20248-13-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-02_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=852 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905020103 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190502_163011_368753_37F6A2EE X-CRM114-Status: GOOD ( 21.83 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Hocko , Catalin Marinas , Palmer Dabbelt , linux-mips@vger.kernel.org, Guo Ren , linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, Michael Ellerman , Helge Deller , x86@kernel.org, Russell King , Matthew Wilcox , Mike Rapoport , Geert Uytterhoeven , Matt Turner , Sam Creasey , Arnd Bergmann , linux-um@lists.infradead.org, Richard Weinberger , linux-m68k@lists.linux-m68k.org, Greentime Hu , nios2-dev@lists.rocketboards.org, Guan Xuetao , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Kuo , Paul Burton , linux-alpha@vger.kernel.org, Ley Foon Tan , linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org The 64-bit book-E powerpc implements pte_alloc_one(), pte_alloc_one_kernel(), pte_free_kernel() and pte_free() the same way as the generic version. Switch it to the generic version that does exactly the same thing. Signed-off-by: Mike Rapoport --- arch/powerpc/include/asm/nohash/64/pgalloc.h | 35 ++-------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 66d086f..bfb53a0 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h @@ -11,6 +11,8 @@ #include #include +#include /* for pte_{alloc,free}_one */ + struct vmemmap_backing { struct vmemmap_backing *list; unsigned long phys; @@ -92,39 +94,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) kmem_cache_free(PGT_CACHE(PMD_CACHE_INDEX), pmd); } - -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) -{ - return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); -} - -static inline pgtable_t pte_alloc_one(struct mm_struct *mm) -{ - struct page *page; - pte_t *pte; - - pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT); - if (!pte) - return NULL; - page = virt_to_page(pte); - if (!pgtable_page_ctor(page)) { - __free_page(page); - return NULL; - } - return page; -} - -static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) -{ - free_page((unsigned long)pte); -} - -static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) -{ - pgtable_page_dtor(ptepage); - __free_page(ptepage); -} - static inline void pgtable_free(void *table, int shift) { if (!shift) { -- 2.7.4 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv