From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by kanga.kvack.org (Postfix) with ESMTP id 26BFA6B0271 for ; Tue, 3 Jul 2018 11:48:03 -0400 (EDT) Received: by mail-wr0-f197.google.com with SMTP id e5-v6so1213920wro.2 for ; Tue, 03 Jul 2018 08:48:03 -0700 (PDT) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id 89-v6si1251446wrs.415.2018.07.03.08.48.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 08:48:01 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w63Fhjhu012972 for ; Tue, 3 Jul 2018 11:48:00 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k09su6xcr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 11:48:00 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 16:47:58 +0100 Date: Tue, 3 Jul 2018 18:47:51 +0300 From: Mike Rapoport Subject: Re: [PATCH 2/3] m68k/page_no.h: force __va argument to be unsigned long References: <1530613795-6956-1-git-send-email-rppt@linux.vnet.ibm.com> <1530613795-6956-3-git-send-email-rppt@linux.vnet.ibm.com> <20180703142054.GL16767@dhcp22.suse.cz> <20180703150315.GC4809@rapoport-lnx> <20180703150535.GA21590@bombadil.infradead.org> <20180703151401.GQ16767@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180703151401.GQ16767@dhcp22.suse.cz> Message-Id: <20180703154751.GF4809@rapoport-lnx> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Matthew Wilcox , Geert Uytterhoeven , Greg Ungerer , Sam Creasey , linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org On Tue, Jul 03, 2018 at 05:14:01PM +0200, Michal Hocko wrote: > On Tue 03-07-18 08:05:35, Matthew Wilcox wrote: > > On Tue, Jul 03, 2018 at 06:03:16PM +0300, Mike Rapoport wrote: > > > On Tue, Jul 03, 2018 at 04:20:54PM +0200, Michal Hocko wrote: > > > > On Tue 03-07-18 13:29:54, Mike Rapoport wrote: > > > > > Add explicit casting to unsigned long to the __va() parameter > > > > > > > > Why is this needed? > > > > > > To make it consitent with other architecures and asm-generic :) > > > > > > But more importantly, __memblock_free_late() passes u64 to page_to_pfn(). > > > > Why does memblock work in terms of u64 instead of phys_addr_t? > > Yes, phys_addr_t was exactly that came to my mind as well. Casting > physical address to unsigned long just screams for potential problems. Not sure if for m68k-nommu the physical address can really go beyond 32 bits, but in general this is something that should be taken care of. I think adding the cast in m68k-nommu case is a viable band aid to allow sorting out the bootmem vs nobootmem. In any case care should be taken of all those #define __va(x) ((void *)((unsigned long)(x))) all around. Regardless, I can s/u64/phys_addr_t/ in memblock.c. > -- > Michal Hocko > SUSE Labs > -- Sincerely yours, Mike.