linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>, Sam Creasey <sammy@sammy.net>,
	linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] m68k/page_no.h: force __va argument to be unsigned long
Date: Tue, 3 Jul 2018 18:47:51 +0300	[thread overview]
Message-ID: <20180703154751.GF4809@rapoport-lnx> (raw)
In-Reply-To: <20180703151401.GQ16767@dhcp22.suse.cz>

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.


  parent reply	other threads:[~2018-07-03 15:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 10:29 [PATCH 0/3] m68k: switch to MEMBLOCK + NO_BOOTMEM Mike Rapoport
2018-07-03 10:29 ` [PATCH 1/3] m68k/bitops: convert __ffs to match generic declaration Mike Rapoport
2018-07-03 10:29 ` [PATCH 2/3] m68k/page_no.h: force __va argument to be unsigned long Mike Rapoport
2018-07-03 14:20   ` Michal Hocko
2018-07-03 15:03     ` Mike Rapoport
2018-07-03 15:05       ` Matthew Wilcox
2018-07-03 15:14         ` Michal Hocko
2018-07-03 15:39           ` Mike Rapoport
2018-07-03 15:47           ` Mike Rapoport [this message]
2018-07-03 15:55             ` Michal Hocko
2018-07-03 15:30         ` Mike Rapoport
2018-07-03 10:29 ` [PATCH 3/3] m68k: switch to MEMBLOCK + NO_BOOTMEM Mike Rapoport
2018-07-04  1:39   ` Greg Ungerer
2018-07-04  2:02     ` Greg Ungerer
2018-07-04  4:22       ` Mike Rapoport
2018-07-04  4:39         ` Greg Ungerer
2018-07-04  4:50           ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180703154751.GF4809@rapoport-lnx \
    --to=rppt@linux.vnet.ibm.com \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=sammy@sammy.net \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).