Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp225875imm; Tue, 24 Jul 2018 17:48:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6N9w8fWZTUs5SMUl8FpUfMS6IUnjA2CwGp/DQa5l8OPvY4X6SiG6hz9dDxPDZXU21y0f3 X-Received: by 2002:a63:c80e:: with SMTP id z14-v6mr17932756pgg.77.1532479685523; Tue, 24 Jul 2018 17:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532479685; cv=none; d=google.com; s=arc-20160816; b=um7i1KqMRva63CLueLo8VS99jzlC2GuvaoY1AubX0sPg1xNM/wMIjZ0jOXLUc+3SxO nmmdajD8a5LY0xwkQ1X7JA61UMtq3y5X4F1BG2JEMwxW3JBT2YpCrkkBnVI1ceq45+le kbZMe7VhYT6jC3JY+dog0KMtC7LF9wmoHOCDzsqMhOs1pqivsdBOTak5zwWxRr0NqAhi RLQeznDAOwzJEf8CA09FGjl/Q1akE15nU6fsV2Y8TXDLiSOhvHW/dbcYgQLdiaMFIlLs SmyA5MrbiUQ1A0oCzfCzmpckIV6BOyLhKIjN2eqWZFChb3sGJ1G64hgWrWxbKRVpIfw/ VupQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Xe7Prntm0L+fJga8OakbHg6P9tNpejHuz028ZBBM4w4=; b=zHKywqhLdP6oQJmi/RlN0mJCD8+tJSxohNzSRz2jYRAFyga+m51YS3o0w80zQ4mJQT e+SdSikVeb/iH3ETCxM4ruNCGpnEYkcthpZeQ+uRP2cX8EOBRlEoNeyxWBJQO6j4o6eM UeJSs066mW/Zb6UJAY3Qu97S6UjCJOh1GThpaC3Thx4ULd8+NCf4x07EkC0wW/dhOSut 3ssdDiSZ5PA73Re4r74dWR4Y1NvVPjI6KJZj8K+ammOmO688t/YUmh3ZENfLJMlKxd8K SGrJSslB7dPoV44VIga1C2sssX4KpDkl/nUPD4Sakdc1V3se5XYW9l4TrIkjC6xqizdZ QJsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=InWmeGfB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o184-v6si12394429pga.520.2018.07.24.17.47.49; Tue, 24 Jul 2018 17:48:05 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=InWmeGfB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388480AbeGYB4C (ORCPT + 99 others); Tue, 24 Jul 2018 21:56:02 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38922 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbeGYB4B (ORCPT ); Tue, 24 Jul 2018 21:56:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Xe7Prntm0L+fJga8OakbHg6P9tNpejHuz028ZBBM4w4=; b=InWmeGfBA0mJlfe64j95JwM6dX UNwetkqTvrt9mx3T9z9Ny2sNRAsnsgBvvzckoQuHVv7//iXskrMPVPKpsCcpI51lNeB0F2glHZcaW ThGod4puSQBiW+ekwOxcxFYJFVUJLo1oLVFZgUTBZnd2YmvizTRx/ju/tAWNhSy+vzyoVpZVw3Xur e15l+ML4up4kExWt1hHPC8Az3MskUkLXcheO78Lza0i3BNYfqlRqBuekQduD667knqdlognYdocDz UhhfwMMG9lbs2UXFD82RxeN57rWUHsiv06dwQjsH5xabuLpJGfAq1aNR50QRJ7s92B4vkB3mHUrQn 7AZ55Meg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi7x9-00062G-82; Wed, 25 Jul 2018 00:46:55 +0000 Subject: Re: [PATCH 2/4] arc: fix type warnings in arc/mm/cache.c To: Vineet Gupta , Randy Dunlap , "linux-kernel@vger.kernel.org" Cc: "linux-snps-arc@lists.infradead.org" References: <20180724204622.2366-1-rd.dunlab@gmail.com> <20180724204622.2366-3-rd.dunlab@gmail.com> From: Randy Dunlap Message-ID: <8fc4281e-604b-46e3-a6ad-320b370fea91@infradead.org> Date: Tue, 24 Jul 2018 17:46:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24/2018 05:02 PM, Vineet Gupta wrote: > On 07/24/2018 01:46 PM, Randy Dunlap wrote: >> From: Randy Dunlap >> >> ../arch/arc/mm/cache.c: In function 'flush_anon_page': >> ../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion] >> __flush_dcache_page((phys_addr_t)page_address(page), page_address(page)); >> ^~~~~~~~~~~~~~~~~~ >> ../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *' >> void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr) >> ~~~~~~~~~~~~~~^~~~~ >> >> Signed-off-by: Randy Dunlap >> Cc: Vineet Gupta >> Cc: Ofer Levi >> Cc: linux-snps-arc@lists.infradead.org >> --- >> arch/arc/mm/cache.c | 11 ++++++----- >> 1 file changed, 6 insertions(+), 5 deletions(-) >> >> --- linux-next-20180723.orig/arch/arc/mm/cache.c >> +++ linux-next-20180723/arch/arc/mm/cache.c >> @@ -1038,7 +1038,7 @@ void flush_cache_mm(struct mm_struct *mm >> void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr, >> unsigned long pfn) >> { >> - unsigned int paddr = pfn << PAGE_SHIFT; >> + phys_addr_t paddr = pfn << PAGE_SHIFT; >> >> u_vaddr &= PAGE_MASK; >> >> @@ -1058,8 +1058,9 @@ void flush_anon_page(struct vm_area_stru >> unsigned long u_vaddr) >> { >> /* TBD: do we really need to clear the kernel mapping */ >> - __flush_dcache_page(page_address(page), u_vaddr); >> - __flush_dcache_page(page_address(page), page_address(page)); >> + __flush_dcache_page((phys_addr_t)page_address(page), u_vaddr); >> + __flush_dcache_page((phys_addr_t)page_address(page), >> + (phys_addr_t)page_address(page)); > > CONFIG_ARC_CACHE_VIPT_ALIASING is a total bitrot and I'm considering removing it > as no sane systems should use it. There's none which I know are using it. > But for now this will do. > > >> >> } >> >> @@ -1084,7 +1085,7 @@ void copy_user_highpage(struct page *to, >> * addr_not_cache_congruent() is 0 >> */ >> if (page_mapcount(from) && addr_not_cache_congruent(kfrom, u_vaddr)) { >> - __flush_dcache_page((unsigned long)kfrom, u_vaddr); >> + __flush_dcache_page((phys_addr_t)kfrom, u_vaddr); > > Was this needed really ? I can't seem to trigger any warnings here. Nope.. glad you caught that. I can't explain it. :( I can only say that if I had _meant_ to patch that, I would have also included the warning messages from gcc. > All of this (original code before your change) is technically incorrect due to the > combination of CONFIG_ARC_CACHE_VIPT_ALIASING and CONFIG_HIGHMEM. @kfrom is > returned by kmap_atomic() and in highmem regime it could be a kernel virtual > address, so calling the low level cache flush interface with a kvaddr, pretending > it is paddr (whethe runsigned long or phys_addr_t) is just not right. This > combinations needs to be disallowed from Kconfig ! > >> clean_src_k_mappings = 1; >> } >> >> @@ -1105,7 +1106,7 @@ void copy_user_highpage(struct page *to, >> * sync the kernel mapping back to physical page >> */ >> if (clean_src_k_mappings) { >> - __flush_dcache_page((unsigned long)kfrom, (unsigned long)kfrom); >> + __flush_dcache_page((phys_addr_t)kfrom, (unsigned long)kfrom); >> set_bit(PG_dc_clean, &from->flags); >> } else { >> clear_bit(PG_dc_clean, &from->flags); >> > > Ditto ! > Thanks. -- ~Randy