[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 01/21] openrisc: prefer memblock APIs returning virtual address
- To: Mike Rapoport <rppt@xxxxxxxxxxxxx>
- From: Stafford Horne <shorne@xxxxxxxxx>
- Date: Sun, 27 Jan 2019 12:07:08 +0900
- Cc: Rich Felker <dalias@xxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, Catalin Marinas <catalin.marinas@xxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, x86@xxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, Max Filippov <jcmvbkbc@xxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxx>, linux-s390@xxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, linux-sh@xxxxxxxxxxxxxxx, Russell King <linux@xxxxxxxxxxxxxxx>, kasan-dev@xxxxxxxxxxxxxxxx, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Mark Salter <msalter@xxxxxxxxxx>, Dennis Zhou <dennis@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, uclinux-h8-devel@xxxxxxxxxxxxxxxxxxxx, Petr Mladek <pmladek@xxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxxxxxxx, Rob Herring <robh+dt@xxxxxxxxxx>, Greentime Hu <green.hu@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Guan Xuetao <gxt@xxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Michal Simek <monstr@xxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, linux-mm@xxxxxxxxx, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, linux-usb@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Paul Burton <paul.burton@xxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, openrisc@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Sun, 27 Jan 2019 06:36:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.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 <rppt@xxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|