Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1966504imm; Fri, 7 Sep 2018 08:48:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaILxElhUxnqfPGLowQLUAm2c31b1WITesfMqNjXCPYRIi3BhJX8NsP4cw2Qz9gpvRcGws4 X-Received: by 2002:a63:6c05:: with SMTP id h5-v6mr8660673pgc.367.1536335325678; Fri, 07 Sep 2018 08:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536335325; cv=none; d=google.com; s=arc-20160816; b=AWWCcPRJKVo8jJ6iuphPqPnvG7k9O4tBJtNnQP3LHD7sRkyUmhwIGTBneiKHMamUMc K4RGlMCTHM11fCzRCN6aGSE5bP4Ad3vPxZs2mK+iZCI6UtTqovC0ObxpCfPDKR7Oryog v0KjNVZdHJgQYXo0Q42MpmhDShd6qfLEs1vuu1yfvYgUKP3b9bN1eXm4OEo3ppzZ0YHl EHKZx1OxL6mZjt8WaxfoS0eD+9Xb2NfXlXc1nAEbCRbIl9muI9vDAFTCUqxG3MYqeQEx I+/oP4dq7z1F6a2BwDK2s/3oODHRvEI/15A7nc3Qcv8kBNeBjW6/UTWKvCkurefDq9zD XdBA== 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; bh=JJbiyU1kiZWXkLEqSGkBNWIUBEMmFfhH1TQ5HIKF3GY=; b=Jja/cUxcdHatkFv1q3bMcKHiN6Nv38QP6hxiQ8YeWckSgRm6G4qjITdy7v29znRKH6 GCv/U3IhaQlCJ9EPvMNalkIsNDbVpux6qmbUKXkpYIYxA+oDO0WRplU7qmOSWjT6a9Vk ol2wGgBShGzdiUQjvdv/oYm5773cBQlEDn86QoxGdCBfjho4NT/TzlXGZ0pMU3H02Rej hsgGJLAooSDJW8QYKkEvENj6WG0YKRf6F+EyrJljvtZVsIg/SlX9nLPwaC6kqtP4O/Ed 7ALO80T1LvWu5C0H6eVE6GHXqWjRrYfmJZwupyYhEmfl9EEYhG793LksyGERarb+dZ+w xcNg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si8951647pga.77.2018.09.07.08.48.30; Fri, 07 Sep 2018 08:48:45 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729088AbeIGS4o (ORCPT + 99 others); Fri, 7 Sep 2018 14:56:44 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:63813 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbeIGS4o (ORCPT ); Fri, 7 Sep 2018 14:56:44 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 426KGV3Jtwz9ttFR; Fri, 7 Sep 2018 16:15:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 7cFdYDtLfgVw; Fri, 7 Sep 2018 16:15:30 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 426KGV2k9Hz9ttFK; Fri, 7 Sep 2018 16:15:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 095778B950; Fri, 7 Sep 2018 16:15:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id xPxlKEAtWsoq; Fri, 7 Sep 2018 16:15:33 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CC7758B94C; Fri, 7 Sep 2018 16:15:33 +0200 (CEST) Subject: Re: [PATCH] perf: enum overflow in uapi/linux/perf_event.h To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sparse@vger.kernel.org References: <20180907134246.GC24106@hirez.programming.kicks-ass.net> <20180907135817.GF24106@hirez.programming.kicks-ass.net> From: Christophe LEROY Message-ID: <7a086a56-a896-9513-7315-9d0d21b61a44@c-s.fr> Date: Fri, 7 Sep 2018 16:15:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180907135817.GF24106@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 07/09/2018 à 15:58, Peter Zijlstra a écrit : > On Fri, Sep 07, 2018 at 01:50:18PM +0000, Christophe Leroy wrote: >> >> >> On 09/07/2018 01:42 PM, Peter Zijlstra wrote: >>> On Fri, Sep 07, 2018 at 01:27:19PM +0000, Christophe Leroy wrote: >>>> On PPC32, enums are 32 bits, so __PERF_SAMPLE_CALLCHAIN_EARLY is >>>> out of scope. The following sparse warning is encountered: >>>> >>>> CHECK arch/powerpc/kernel/process.c >>>> ./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0) >>> >>> Urgh... what compiler is that? I've not seen anything like that from the >>> build bots. >>> >> >> [root@pc16082vm linux-powerpc]# sparse --version >> 0.5.2 >> >> [root@pc16082vm linux-powerpc]# ppc-linux-gcc --version >> ppc-linux-gcc (GCC) 5.4.0 > > Ah, that's a sparse warning. But does your GCC agree? The thing is, > sparse uses the C enum spec, but I suspect GCC uses the C++ enum spec > and it all works fine. > Ah yes, it seems that GCC is happy. So sparse should be fixed instead ? Anyway, is it really correct to put this constant inside that enum, after PERF_SAMPLE_MAX ? Christophe