Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1307957imm; Tue, 3 Jul 2018 08:56:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIXteKh8X+sGzQ94EIjhzxrLAYhFqHeedihnHh6B3jPMYQXyoCRwnhodGZDCFKTjdGvqbk8 X-Received: by 2002:a65:6094:: with SMTP id t20-v6mr26473352pgu.264.1530633371350; Tue, 03 Jul 2018 08:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530633371; cv=none; d=google.com; s=arc-20160816; b=KkYm19YtghxzjfmatHpJGTRgBJBC3IKcUYk3nOCPUAsCzZknT/wI1eRDYHE02ej6V+ e/Gj8KXEusqzkopSuc3ENQruWglSEfJr92juuCXmj5IbuRyighQDCDxtugax/yUWNz9k 7nWkvXNSUUvyczmHV/8pICRfWPAfyHBkxT5y65wZ7r40+glT2PHqKVdElhUKK/Nphqow sKf+ADY2w0jBZLoUP6iP8ZJkcAau0Mxd2S6SnXIzw0MwdrbhvnpeNQe7FB3Q23QiqLpc Qu/3xaD8VnXYu9FDBe2gwOJZyOVdhybqyrZdoN2INXPVyDjVVO563xAESH1Crvzgqbcq vsgA== 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:arc-authentication-results; bh=Ew39Te0pWyJ3fXDFqSpRb+QfVLFXGpXO4/FpcRXFFjs=; b=Fa8ax8mjZSp3EiqBNUg96UvpQHeG1WmKV7LrdU7E+0hf8hLNjom+mJvaTcVLvSsjTb cKCZh8JTU4tuVuhqKXzE1GxsXHBjQ4Jtv1ecc8ByjmByefKJ4kmxGbiZbVPczK3sVvvY c3wdEGL6YObFwOzWRBPyiQNXI+icplCgIOhHeqeOrOBh/Sy/9t6Ot4PSx7uP9YBDpA6z EYDJXD/fdg8TOihX1QCpkL51zk82H5ESHEfYCMbcuIeT9flJPXjXPedAyuuWolUg8y9a I3kg5kRqanWLKRQaJjU2ERk3y/G2T+c9bqNHE5O9Q8lJ3anNldfmQ/V8CF0tfuOsydiD iwTg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si591595pfh.346.2018.07.03.08.55.56; Tue, 03 Jul 2018 08:56:11 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932959AbeGCPzL (ORCPT + 99 others); Tue, 3 Jul 2018 11:55:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:45520 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932357AbeGCPzK (ORCPT ); Tue, 3 Jul 2018 11:55:10 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E19B6B077; Tue, 3 Jul 2018 15:55:07 +0000 (UTC) Date: Tue, 3 Jul 2018 17:55:05 +0200 From: Michal Hocko To: Mike Rapoport Cc: Matthew Wilcox , Geert Uytterhoeven , Greg Ungerer , Sam Creasey , 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 Message-ID: <20180703155505.GS16767@dhcp22.suse.cz> 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> <20180703154751.GF4809@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180703154751.GF4809@rapoport-lnx> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-07-18 18:47:51, Mike Rapoport wrote: > 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))) Yeah, sounds like a good idea to me. > all around. > > Regardless, I can s/u64/phys_addr_t/ in memblock.c. Yeah, sounds like a good thing to me. -- Michal Hocko SUSE Labs