From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F4AC43460 for ; Thu, 15 Apr 2021 09:12:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0995E61073 for ; Thu, 15 Apr 2021 09:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbhDOJMY (ORCPT ); Thu, 15 Apr 2021 05:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbhDOJMX (ORCPT ); Thu, 15 Apr 2021 05:12:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3925C061574 for ; Thu, 15 Apr 2021 02:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=4D66rvNXayldPIaenxD3qS5PoTu3GvzifCOGXTuJfzs=; b=mdr/IwTeGEbp53xL+7G6uVNsUS 5PN4eyKAfE+sZvemytDLLqiV+i3HrGs5JPbQMhL/xIWCq/7ejo833yaWtDvfQvM5DPYSKp1s0yU/Y se80xd2qwaL/8cUIfzgOVKRrs/6FZVmseaA30AGtOzsKcs21geZc1RZ+pfrpZwBvnR6XJliNmonEc lFblWnWK9UtyOfmxfinr92ASCQKMXXQEtTThPm2x57viVKqbUMsFHF8Dvx4c/E8AfQ03c7ByGGCk8 d0wPgc18WVO5fs6F2oe0FSzwQp1dm5PNhSsqwYgnJmQNgr7ffq0xOW8CuLBlJyp4Q8AEtdSr6YBxQ TWImjKrw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lWy2L-008LLY-6b; Thu, 15 Apr 2021 09:11:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 37B93300209; Thu, 15 Apr 2021 11:11:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 19CC22022421A; Thu, 15 Apr 2021 11:11:44 +0200 (CEST) Date: Thu, 15 Apr 2021 11:11:44 +0200 From: Peter Zijlstra To: Marco Elver Cc: kbuild-all@lists.01.org, kernel test robot , linux-kernel@vger.kernel.org Subject: Re: [peterz-queue:perf/core 18/22] kernel/events/core.c:6418:22: sparse: sparse: incorrect type in assignment (different address spaces) Message-ID: References: <202104142209.hLOfOONR-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 11:03:09AM +0200, Marco Elver wrote: > On Thu, Apr 15, 2021 at 10:48AM +0200, Peter Zijlstra wrote: > > I've ended up with the below delta, does that work for you? > > Thanks, that works for me. Do note that I explicitly chose u64 for > sig_addr/pending_addr because data->addr is u64. There might be a new > warning about the u64 to unsigned long assignment on 32 bit arches. My local i386-defconfig build seemed happy now. Mostly I think you're allowed to silently truncate between base integer types. We'll see.. maybe some other compiler. > Perhaps it needs something ugly like this: > > info.si_addr = (void __user *)(unsigned long)event->pending_addr; > > if pending_addr wants to be u64. Or just > > event->pending_addr = (unsigned long)data->addr; > > if data->addr being u64 on 32 bit arches is simply overkill. Yeah it is. It's u64 for data layout purposes, the perf buffer works in u64 chunks.