Message ID | 1548057848-15136-2-git-send-email-rppt@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D6A66C2 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 21 Jan 2019 08:04:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D5D628524 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 21 Jan 2019 08:04:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FFAC29B02; Mon, 21 Jan 2019 08:04:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12CBB28524 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 21 Jan 2019 08:04:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EA758E0016; Mon, 21 Jan 2019 03:04:38 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 19B718E0001; Mon, 21 Jan 2019 03:04:38 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 019498E0016; Mon, 21 Jan 2019 03:04:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id C61A68E0001 for <linux-mm@kvack.org>; Mon, 21 Jan 2019 03:04:37 -0500 (EST) Received: by mail-qt1-f200.google.com with SMTP id q3so20349130qtq.15 for <linux-mm@kvack.org>; Mon, 21 Jan 2019 00:04:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=XSshgjB0C0kKfjNsvkyiTVYGRX+ftGTVLg/2ZSZXAaU=; b=icTv+O07vDHKwYnE4GPgULo2F0+aIhGb5Ikzis3W/AP9YET1SxZAmPDLX49ZhqXfSA Ia3Q9Btdq17FRrnMQKg7oQYMHEwCt8i3no/eOdEHGQTP5fU8yJygNPobU4oA/IApTNu/ MieKqZkorMvHVrOCYzZuDwHB3dUTIvAoRjGTSTWX9mfoDYRiVQmUO9dAI2xWV230oKaR eCzahSQLz0v04yqVogI0s6IMJtf3h6q6z+v5uIc98+3SpkBFxCBa/e+9nQSObASy1c66 f8SMc/6R3CVu+Jbkc6VomUZpy4Zuwcj9cyfKeRP3yaiqoarSaO2yLZ53j7P5n1LZPYxe LIhg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AJcUukezsl6imsDm3tokq6odjmaqzifIBGw6poSPac5sqQYZ7ub+fLdp 1Bk9vE2+hovDx5jTXdLgqnROOqIGoziFkT53Q0RIc9MPo1PcbU/6HuXnLrfUzqT04Oq7k0Gctzw bvz5EGpyeGXLQDg6BPLuDVnK3xl3TSJgd5HXeFXmSemEYqCvcRFFFPWIBHLkgVAMsMg== X-Received: by 2002:a37:360a:: with SMTP id d10mr23572291qka.40.1548057877574; Mon, 21 Jan 2019 00:04:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN5YuGXiGEt6N54UD1/Sji2kdEji89ItaVTID4BWbopCfEgXbbPGBNZ5NKRT6jfNZiZqdXoo X-Received: by 2002:a37:360a:: with SMTP id d10mr23572274qka.40.1548057876995; Mon, 21 Jan 2019 00:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057876; cv=none; d=google.com; s=arc-20160816; b=ShL71CN4BgUPXyjM84xwJ1yKS9uU9DHHUGea8sdj5nkZ7MIdX8ekULKxIEnMZSDNb+ JV29a1KNuwsB+xQIbkUIJCvEWor5bNwULoJmuLcUQ6HIu6hNj1Gkrg8CMdC+V9frv8yj OdHdjBNRC1uLVZijlj5SROQ/aryB89Ihb3u2wDSAcSA3yczunGBPsfO/ShLyUaSn2anY 1dAVbmOuT+FiL8gUVUsYddwfGnZzCnrXiNwO0CozgP0SyiBBo5nq9UnsEvC2ePS24JeF OXa/qZWYiu0eKHqG0tsjyPIOCzVCy0aQm10Nl1A61XPf7WvfGRngt9jOtwWFpCfs9eio KM9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=XSshgjB0C0kKfjNsvkyiTVYGRX+ftGTVLg/2ZSZXAaU=; b=UWB6F9uBA0q29xd6zsXOyrveTcHVeLV5NYIgb5FID6FsAOJKEELIrQKvKWlLY1KlRp 9UyAEDIF7Qx9QeIPgkCSj15BU+D8TqQp3+U+fcC/V8WkeRWBN3KbJ6eDKFEuCLT5Qqfc W2kgkXNic1Kl0+V0ox1dLMnYo5yDaFwwUP8ZFRxiU4kOYF/yUSMHNkGNxc1GddGqkTZO aip+BfG7yLkrI114sfPo+gIGzoI4HN5SM8qJCsit7bcJ9clCJBpcQN+5O5/jFG24RFEV Hxu6jUXgzEWOhhvZTlW6ldOCUe5fFZ8UQHRJwI1jFt+e91fF38v9Cnjew7iDFniL5yZq CK5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id s4si5619640qtd.227.2019.01.21.00.04.36 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 00:04:36 -0800 (PST) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com 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 x0L84N5I084558 for <linux-mm@kvack.org>; Mon, 21 Jan 2019 03:04:36 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q57yk5hs8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for <linux-mm@kvack.org>; Mon, 21 Jan 2019 03:04:35 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <linux-mm@kvack.org> from <rppt@linux.ibm.com>; Mon, 21 Jan 2019 08:04:33 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 Jan 2019 08:04:22 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0L84Lhu8913234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 08:04:21 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E22D4204C; Mon, 21 Jan 2019 08:04:21 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D46242045; Mon, 21 Jan 2019 08:04:16 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.125]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 21 Jan 2019 08:04:16 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 21 Jan 2019 10:04:15 +0200 From: Mike Rapoport <rppt@linux.ibm.com> To: linux-mm@kvack.org Cc: Andrew Morton <akpm@linux-foundation.org>, Catalin Marinas <catalin.marinas@arm.com>, Christoph Hellwig <hch@lst.de>, "David S. Miller" <davem@davemloft.net>, Dennis Zhou <dennis@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Greentime Hu <green.hu@gmail.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Guan Xuetao <gxt@pku.edu.cn>, Guo Ren <guoren@kernel.org>, Heiko Carstens <heiko.carstens@de.ibm.com>, Mark Salter <msalter@redhat.com>, Matt Turner <mattst88@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>, Michael Ellerman <mpe@ellerman.id.au>, Michal Simek <monstr@monstr.eu>, Paul Burton <paul.burton@mips.com>, Petr Mladek <pmladek@suse.com>, Rich Felker <dalias@libc.org>, Richard Weinberger <richard@nod.at>, Rob Herring <robh+dt@kernel.org>, Russell King <linux@armlinux.org.uk>, Stafford Horne <shorne@gmail.com>, Tony Luck <tony.luck@intel.com>, Vineet Gupta <vgupta@synopsys.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, devicetree@vger.kernel.org, kasan-dev@googlegroups.com, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-usb@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org, xen-devel@lists.xenproject.org, Mike Rapoport <rppt@linux.ibm.com> Subject: [PATCH v2 01/21] openrisc: prefer memblock APIs returning virtual address Date: Mon, 21 Jan 2019 10:03:48 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> References: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19012108-0016-0000-0000-000002482BC2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012108-0017-0000-0000-000032A25B18 Message-Id: <1548057848-15136-2-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-21_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=889 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901210066 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Refine memblock API
|
expand
|
On Mon, Jan 21, 2019 at 10:03:48AM +0200, Mike Rapoport wrote: > The allocation of the page tables memory in openrics uses > memblock_phys_alloc() and then converts the returned physical address to > virtual one. Use memblock_alloc_raw() and add a panic() if the allocation > fails. > > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> > --- > arch/openrisc/mm/init.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c > index d157310..caeb418 100644 > --- a/arch/openrisc/mm/init.c > +++ b/arch/openrisc/mm/init.c > @@ -105,7 +105,10 @@ static void __init map_ram(void) > } > > /* Alloc one page for holding PTE's... */ > - pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE)); > + pte = memblock_alloc_raw(PAGE_SIZE, PAGE_SIZE); > + if (!pte) > + panic("%s: Failed to allocate page for PTEs\n", > + __func__); > set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte))); > > /* Fill the newly allocated page with PTE'S */ This seems reasonable to me. Acked-by: Stafford Horne <shorne@gmail.com>
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index d157310..caeb418 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -105,7 +105,10 @@ static void __init map_ram(void) } /* Alloc one page for holding PTE's... */ - pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE)); + pte = memblock_alloc_raw(PAGE_SIZE, PAGE_SIZE); + if (!pte) + panic("%s: Failed to allocate page for PTEs\n", + __func__); set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte))); /* Fill the newly allocated page with PTE'S */
The allocation of the page tables memory in openrics uses memblock_phys_alloc() and then converts the returned physical address to virtual one. Use memblock_alloc_raw() and add a panic() if the allocation fails. Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> --- arch/openrisc/mm/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)