Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2075483imu; Sat, 26 Jan 2019 19:07:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN6sA5jXj8+h/MiCYD5K9TIWXXfCY0g9HXah3w/dTPnZVeIz288LFO72Aq+gPGib9mkzp8i3 X-Received: by 2002:a62:8c11:: with SMTP id m17mr16973550pfd.224.1548558454452; Sat, 26 Jan 2019 19:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548558454; cv=none; d=google.com; s=arc-20160816; b=NhwOiCirCTpQeCMbxAw08Bag4OfHqQW129SnBZo6kodE2xBVdAwyMlWPJzerxvFEOW vOQj/fdjOJ2Kh/mfIMXEtLxrhWV35xS00y+E6k5HpLPKnAeAhoVC87dDf/266FPd2FJL zN8spbxmm853tvZ0J7qo9iVnJpmE74w4lnpGDqYXs0xLEnNCqxRxqmQH6HXSdvR3P+bV 2BR6QGjuTg3HlK5W9JSVkFQsXSOcEomHFxcFHvc2fYLCidsUuzzwpKsBCFQbUS+2k0d5 Eq3bwacMNp/vKiFMiZG/wdshopg1QmKoBpaIOu3ynfPkrBiPXmsc/ol35inGF7P2XRAS LVaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5gqtElyGAjgWA1IcD3f1+6EYOKOhZl25WPW+/clLjQw=; b=v/Z0ZEa5dGkvMit9eh8npxgFUeOMXq+eE7hxJ95duE+Vp6+P1N8cTMlba87R5/Ijdu Q2orTM8v/fQCHQ4hEvmrETRw4ziaKxrbRDQFUH1hIljS/c8FU051tT1heohGA0VTRZ2b 4D6vXPskaEF5CgSU5InGZIVXKU9BF+YcslKSUMlj8F3FMApG7lbeQXBFewMt2Qq4rryx YQY3DZPIuFx2WGy8W+gTG6JWr+qFaEo+S60gvVAlx7BTnKW+Bc7Y3YqJmANObUDy3njW ADLy+nfVH4eSFFAGkZMiH7ro92+/ifqal0vMpWHqberkMyHA3bic2jDI6AmyM/hUGQWa BXaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DQJUgaYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n128si11775084pga.423.2019.01.26.19.07.17; Sat, 26 Jan 2019 19:07:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DQJUgaYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbfA0DHN (ORCPT + 99 others); Sat, 26 Jan 2019 22:07:13 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:41475 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbfA0DHM (ORCPT ); Sat, 26 Jan 2019 22:07:12 -0500 Received: by mail-pl1-f194.google.com with SMTP id u6so6245263plm.8; Sat, 26 Jan 2019 19:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5gqtElyGAjgWA1IcD3f1+6EYOKOhZl25WPW+/clLjQw=; b=DQJUgaYyc2s9cDIgDXTbhgKcePEzBol2WZvwvI6xmrwG+LJZGqMLESHYlxBSvlyyQ+ oUI2SaaDg/nIxSIVyyBEipyPmK2fYHmtCyy+DuhILnqyKmu6E9VS52zUYIar2ouPKRdT spF0yBPuFHYuwM3tKB7m/bM+hdtYY8xeINYQ75T8D69QJml4TyVnU8zheDFZ5xRv/+d0 fZacP6AYd7yMLzeYEBYuBCZR0ps5yO4SEfRDf0avcrWF/WhVzAvlgh4beOcKHCs3Rmim bGR8TFht5XxX3GHKhLXiZmgiwFe5kndg4WxAiv/zrboSXN3mxjy6wEx8Agq+Buk9nU7Q w6cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5gqtElyGAjgWA1IcD3f1+6EYOKOhZl25WPW+/clLjQw=; b=BMQ3W1xhnkMVrdYnOInCElkDEtIksCOFew/hBK95eGuxZs5voHK4HOJrFO1J9Axaxt 3SDnkYzZdzIThd/O3Jm1MCMTfsIqKVWAOKl8sjSwJyyxsZW0DXfZ6s8Hi0ndZdQYBA/a HFhIeal5Nw2WJltZJMOJlTlPA2ugSYpEAxlj60usGLkpXCA3e+wUnUoHZHhsPhAUlKnA tTFdshsa3uyf9JzVp7O79JlB8/AYXTTLvxZI8634/A8R4Uslm7PqxbvmPDQTNlcD12q1 R0+x6U6GyVXYZXAs3fv9xdtS8FWNxgHB8gyh1HPMZLWWawOm66yfOU0nfo6c3eYRiqWT 9+1Q== X-Gm-Message-State: AJcUukfD5SXfuf9Z6AzfivPuNW66vt63Wn1vQGxdjEQz5aflDenm22pv bUAWkDELE52iuq/PQLoHcrU= X-Received: by 2002:a17:902:584:: with SMTP id f4mr17453617plf.28.1548558431604; Sat, 26 Jan 2019 19:07:11 -0800 (PST) Received: from localhost (g206.124-44-15.ppp.wakwak.ne.jp. [124.44.15.206]) by smtp.gmail.com with ESMTPSA id t24sm53501159pfm.127.2019.01.26.19.07.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 19:07:10 -0800 (PST) Date: Sun, 27 Jan 2019 12:07:08 +0900 From: Stafford Horne To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , Catalin Marinas , Christoph Hellwig , "David S. Miller" , Dennis Zhou , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Guan Xuetao , Guo Ren , Heiko Carstens , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Paul Burton , Petr Mladek , Rich Felker , Richard Weinberger , Rob Herring , Russell King , Tony Luck , Vineet Gupta , Yoshinori Sato , 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 Subject: Re: [PATCH v2 01/21] openrisc: prefer memblock APIs returning virtual address Message-ID: <20190127030708.GU3235@lianli.shorne-pla.net> References: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> <1548057848-15136-2-git-send-email-rppt@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548057848-15136-2-git-send-email-rppt@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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