Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp680978imm; Fri, 3 Aug 2018 09:44:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdi6ty418pHh6k1NG+sJlqhnQJthj0YZKUfsQwf4wWbXuD69/BimRLGFms3M9gMzFXiKlPV X-Received: by 2002:a17:902:8ecb:: with SMTP id x11-v6mr4406035plo.308.1533314698838; Fri, 03 Aug 2018 09:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533314698; cv=none; d=google.com; s=arc-20160816; b=jcjLhmq/NZ8YI2e/qG+W2a2ltDTl3HJhE8Q9fc2VVZvObHuAQH1E+z+hrUOuhanlQI EmT6P8S0lkwb7A4K9VNEzpiyOr6QdT3u1yyDuC+O2YYoetGmckC+5lqZEje/ig6Km/3L k0Oc5BhPSwIARRAT/TbfXnwp+7agRb5c28uU2Kxi8cj26arnXOnxiP1KSbNydEXt2B18 JODHfRryY9Oir+gYAM4rUodmM6ykeS4iRrEO2E295veU08Ht9fzs2Zj+WVHwzxD7qb5k 6mX3b3/Pi72INC/6rXch5CoV6PyVhggpreXVQbe0LqvEjn/kfLqBLjmsZrdi11wMer5S jkXQ== 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:dkim-signature:arc-authentication-results; bh=XrvV42lFNlGN8lq0/RfxfEcmqtnhtUSJ36ZgL6u7MDM=; b=DUDx9rAC87IK+6r36zhaeIwocDVhfA5woj37rvxwF0zYMLY0T5BhsfyDxa6s7VMNLP phLr4W/jOdvaYHb5waKSKsL5DSXNgxVq5XypvoWawjATqaauYfPgcWyISuw/PAmGmomR kDuO2N/k4EqTS0b23VtF+nPml4/Gce7qcbGN6kbbqstR1wyGscgW8mosDfALg0G78QSy OQ5BTgsa2kxH3EIRtrWgk4Mpa6QPLVwcXqSb+8ljJNpOOGQ47dtJF6LI82VxTyQmlWC/ Upif9WZPhu6mp+ir/4fkew9+emKd02CQAEJK73zvSSvNIRU2Gr8rXNuWlykn2vDm3Msk AhIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=SN3Ftiza; 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 z4-v6si4321094pgp.580.2018.08.03.09.44.44; Fri, 03 Aug 2018 09:44:58 -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=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=SN3Ftiza; 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 S1729825AbeHCSkq (ORCPT + 99 others); Fri, 3 Aug 2018 14:40:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41214 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbeHCSkq (ORCPT ); Fri, 3 Aug 2018 14:40:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding: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=vqJvmSLvi7nAYcR/wjKk0KgIP5D4tOk69+zSwfsoGeM=; b=SN3FtizaEwn9018rJBofPEFsV pGAO1YvOa7vNb2XUsURkIB/Hi6wZM2eG9V2m1wXXEDdkh5iOO8Rq8eP0kHE2Q714lIJIl8VgGUh6H HQ5Rcj4JAa5abuXTDZ3vMWm/7j1YydJSnJDGjGMu2oFAWM9XCKtUT7t9CE+d68bugBmsuD/f5FfQW 6zJUM9/pin/a8Whiu6rdzn4VK2J00WMM95S8N+sgH/xOQfEa5KuTqqR8vJlLJke8LKdS32A33ra+B +L6wJxC1PFRisoA/5z8cHtc2jLzPAyJgesGJaAVzd+KbTb9hc+rS/iEXumN+V82PR7Rf6VpXALhRl VZhHP0tjg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fldAv-0001qP-Ut; Fri, 03 Aug 2018 16:43:37 +0000 Date: Fri, 3 Aug 2018 09:43:37 -0700 From: Matthew Wilcox To: Greg Kroah-Hartman Cc: Andrey Konovalov , Catalin Marinas , Mark Rutland , Kate Stewart , linux-doc@vger.kernel.org, Will Deacon , Kostya Serebryany , linux-kselftest@vger.kernel.org, Chintan Pandya , Shuah Khan , Ingo Molnar , linux-arch@vger.kernel.org, Jacob Bramley , Dmitry Vyukov , Evgeniy Stepanov , Kees Cook , Ruben Ayrapetyan , Ramana Radhakrishnan , Al Viro , Linux ARM , Linux Memory Management List , LKML , Lee Smith , Andrew Morton , Robin Murphy , "Kirill A . Shutemov" Subject: Re: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel Message-ID: <20180803164337.GB4718@bombadil.infradead.org> References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> <20180801174256.5mbyf33eszml4nmu@armageddon.cambridge.arm.com> <20180803150945.GC9297@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180803150945.GC9297@kroah.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 03, 2018 at 05:09:45PM +0200, Greg Kroah-Hartman wrote: > On Fri, Aug 03, 2018 at 04:59:18PM +0200, Andrey Konovalov wrote: > > Started looking at this. When I run sparse with default checks enabled > > (make C=1) I get countless warnings. Does anybody actually use it? > > Try using a more up-to-date version of sparse. Odds are you are using > an old one, there is a newer version in a different branch on kernel.org > somewhere... That's not true. Building the current version of sparse from git://git.kernel.org/pub/scm/devel/sparse/sparse.git leaves me with a thousand errors just building the mm/ directory. A sample: ../mm/filemap.c:2353:21: warning: expression using sizeof(void) ../mm/filemap.c:2618:35: warning: symbol 'generic_file_vm_ops' was not declared. Should it be static? ../include/linux/slab.h:666:13: error: undefined identifier '__builtin_mul_overflow' ../include/linux/slab.h:666:13: warning: call with no type! ../include/linux/rcupdate.h:683:9: warning: context imbalance in 'find_lock_task_mm' - wrong count at exit ../include/linux/sched/mm.h:141:37: warning: dereference of noderef expression ../mm/page_alloc.c:886:1: error: directive in argument list ../include/trace/events/vmscan.h:79:1: warning: cast from restricted gfp_t ../include/trace/events/vmscan.h:196:1: warning: too many warnings (ahem!) ../mm/mmap.c:137:9: warning: cast to non-scalar ../mm/mmap.c:137:9: warning: cast from non-scalar ../mm/page_vma_mapped.c:134:29: warning: Using plain integer as NULL pointer ../include/linux/slab.h:631:13: warning: call with no type! Basically, nobody is fixing their shit. The only way that sparse output is useful is to log the warnings before your changes, log them afterwards and run diff. The worst offender (as in: fixing it would remove most of the warnings) is the new min()/max() macro: ra->start = max_t(long, 0, offset - ra->ra_pages / 2); produces that first warning at line 2353 of filemap.c. I have no idea if this is a sparse mistake or something it's genuinely warning us about, but the sparse warnings are pretty ineffectual because nobody's paying attention to them.