Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1256465imm; Tue, 3 Jul 2018 08:05:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLAPU/kyA7rv+bo47eLAcE/cYLkdf5lV2e88pgRUkd2ogejagn3h/hwjJ5aD6lj5BQojbuh X-Received: by 2002:a65:602c:: with SMTP id p12-v6mr25824204pgu.209.1530630349205; Tue, 03 Jul 2018 08:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530630349; cv=none; d=google.com; s=arc-20160816; b=icTRDQ2Mf8bzAKq5CpLJZe3yuTEYyehmy/jhjveivbC3l7/szUnZ7OnFOX9Q4w+k28 BtiWR+Ys9pFbxT62I93OG7IeK2ECbrGv3sVsY2h1dhJ3Naxpz6k9MO+Tu/LIBq39WejD F/sBGS8HqWFyQnbT2LMZ+sW9WiYqzLMYHXolASBzZ+Czi+rAL5JYPaz78cKvJxghHqk7 GTpEY4ck8v+aS7WsC8GuCKxvL+DJfi31vxAqwaa0vgPNs7yCtY6oP8g9kMACnG9/LJfZ cga6a9tcB2pUSRi5ot7pmKULZZL/B5x3ji88Pl0hZeMJ6Bo7Y/W+BTVBtj9OwYDotI32 3tlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=kaMkF/nETLQQ+JT2WNoc1rodQxA/V+391sVv4LH71DI=; b=wvupuserZh0OvN4oFbbwpYshsVbgPqMhowoMfYgJuw8/7mQq4/kSQE/VdDMTqPIp1f u/loX3/TApPZeU6YYQko+oS6uMe8ZrG3qajB5wyxmcFN4Ip+h76H4YpRfzG+zuVJX87t KQV8GJqBHWCk+rsx4A2LLmPOishUDMdA5eZi6d6RjDEI1kXmWa5bt8MlJWV2o+0Ro7Xu RV2WpctN+1WfOJfp33d0mVlz02BJEZ6OrVnIN58FdeIhAI+J+H/9Mh9ofRj29TnBxwvY usyAOuR0oxwu42fboOr7X6YtrqHPbXn1OriieO9LI9QnSP12Z+9oBuYKKJuWFt2yvmXr 537Q== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si1255218plz.479.2018.07.03.08.05.34; Tue, 03 Jul 2018 08:05:49 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932664AbeGCPD1 (ORCPT + 99 others); Tue, 3 Jul 2018 11:03:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51096 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932273AbeGCPD0 (ORCPT ); Tue, 3 Jul 2018 11:03:26 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w63Ewn6B055830 for ; Tue, 3 Jul 2018 11:03:26 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k0b52gyrn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 11:03:25 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 16:03:23 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Jul 2018 16:03:20 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w63F3JN541156668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Jul 2018 15:03:19 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0880AE058; Tue, 3 Jul 2018 18:03:21 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0268DAE051; Tue, 3 Jul 2018 18:03:21 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.206.209]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 3 Jul 2018 18:03:20 +0100 (BST) Date: Tue, 3 Jul 2018 18:03:16 +0300 From: Mike Rapoport To: Michal Hocko Cc: 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 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180703142054.GL16767@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18070315-4275-0000-0000-00000294BF27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070315-4276-0000-0000-0000379C3EA1 Message-Id: <20180703150315.GC4809@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-03_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=995 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030172 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). On m68k-nommu this results in: CC mm/nobootmem.o In file included from arch/m68k/include/asm/page.h:49, from arch/m68k/include/asm/thread_info.h:6, from include/linux/thread_info.h:38, from include/asm-generic/preempt.h:5, from ./arch/m68k/include/generated/asm/preempt.h:1, from include/linux/preempt.h:81, from include/linux/spinlock.h:51, from include/linux/mmzone.h:8, from include/linux/gfp.h:6, from include/linux/slab.h:15, from mm/memblock.c:14: mm/memblock.c: In function '__memblock_free_late': arch/m68k/include/asm/page_no.h:21:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define __va(paddr) ((void *)(paddr)) ^ arch/m68k/include/asm/page_no.h:26:57: note: in definition of macro 'virt_to_page' #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) ^~~~ arch/m68k/include/asm/page_no.h:24:26: note: in expansion of macro '__va' #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) ^~~~ arch/m68k/include/asm/page_no.h:29:39: note: in expansion of macro 'pfn_to_virt' #define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) ^~~~~~~~~~~ mm/memblock.c:1473:24: note: in expansion of macro 'pfn_to_page' __free_pages_bootmem(pfn_to_page(cursor), cursor, 0); ^~~~~~~~~~~ > > Signed-off-by: Mike Rapoport > > --- > > arch/m68k/include/asm/page_no.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h > > index e644c4d..6bbe520 100644 > > --- a/arch/m68k/include/asm/page_no.h > > +++ b/arch/m68k/include/asm/page_no.h > > @@ -18,7 +18,7 @@ extern unsigned long memory_end; > > #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE > > > > #define __pa(vaddr) ((unsigned long)(vaddr)) > > -#define __va(paddr) ((void *)(paddr)) > > +#define __va(paddr) ((void *)((unsigned long)(paddr))) > > > > #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) > > #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) > > -- > > 2.7.4 > > -- > Michal Hocko > SUSE Labs > -- Sincerely yours, Mike.