Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp83183imm; Fri, 7 Sep 2018 16:57:59 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbv73mc3J+PFUnrPSfdN23FKAHNiJRwFXpRETQdFeXTztoaB3Aj1Y67sQeVT3c+U2eNrs6z X-Received: by 2002:a63:1c61:: with SMTP id c33-v6mr10789661pgm.109.1536364679473; Fri, 07 Sep 2018 16:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536364679; cv=none; d=google.com; s=arc-20160816; b=YwdLT9rbsIUONqC6usRwgEv3mZX1NzS2itQYzyygcUcSrdzZhhN9eKihwszorukTVS 0QBzKl5YpsTJ5bqZsv1u9F/bs5/GL8y+sazwdC+evICxQ1fhf9o28J5ceR5cV1nMOjhq vNa01ih8fh4ge+2QWyDoeUh8cTFbJJaXNEXbM712FxPxx3RTdx3Js8fYv3Z1fsD8sYTW /QwiFKw49d0V3mpeBNT2I03IhErnrBtz1eFATAb/zEspUDXVz/eEBkHBu6wouSotYQlw 0Y6yW5vKySu276QAT8liFDHQa/kG7TrBnK//vpcivZAquw/auY+YPQpM8I4vhzeLwf+B g2SA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=taRPVOrHrGvD2YSua6Hf3AZ7rwDh97WOfd1mGUdVhd8=; b=0ZX/uWbaNIqouKFB7KbkglHW3hmxCjBzzAJLSNJqWYbzs2V9K9joGldSCB4eJBVoQq VCEs0h6OACBJVwkHR8bEbFLfGWWMgIbXXqit19AGb9mPA/l1eNHw+c5UNUcI14Q2QN39 lL0JSS74VHiEJcOmmr1b+yemG/u3hfNE0eSxQrX3FhA3+ZdYgNOLQuWRg3nlZJFQYV3T 0of+UzeDPisnYbJu9CZNaR+ROAO3ogt3stbbU14fqLPa9gmlneJOkc7KmtHZMr4pihGt o7mu1BwtAWCpmKjwRhF7Lzju5UT/dDfd/jxHmnx12xuvGpha6tFMQAR1WJeBZ6/WmuBZ gvrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kzhw1ooj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z123-v6si10633166pfc.289.2018.09.07.16.57.43; Fri, 07 Sep 2018 16:57:59 -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=pass header.i=@gmail.com header.s=20161025 header.b=kzhw1ooj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbeIHEjW (ORCPT + 99 others); Sat, 8 Sep 2018 00:39:22 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:51019 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725731AbeIHEjW (ORCPT ); Sat, 8 Sep 2018 00:39:22 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so16172086wmc.0; Fri, 07 Sep 2018 16:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=taRPVOrHrGvD2YSua6Hf3AZ7rwDh97WOfd1mGUdVhd8=; b=kzhw1oojk/4IzpbpJACGYLV6lMz4ejnc5pUbHU9RWXlHbTeUqm+79B24wNrmJZ3tnJ SAl1JaVZv6KQ3CoQ6RWnsH9qrtmsgwzCU4nGX7pUgyeaH8DY8F91OBp3rPhrcT5st/sL +XjMNJmtU2CJJkiT98RrF3IqLcz3ycWdxk0oiAqN1oLbBbOJMUCdyV0+Bf3LELhlDgfF /CO4dsNetmeRv8sVD2kaLgQyDE790n6Mphlo1/XUqGIKsewRxu8a8HRDmFlAEAWFxAab xQ7RpA7VUCeemw8zgY7VXxaZ208BPleLeIy8VVdMgUWmglfcQI5TuVlPq+vj8uVxwZks 0zTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=taRPVOrHrGvD2YSua6Hf3AZ7rwDh97WOfd1mGUdVhd8=; b=QCYwJGl3XecS/0JUJXDvUli5OQPmtPmvWcQU5aAMBZBTJIU0zzhNnXl5pr267XqWHE rFaFl/RP/QqXRHbiGym+bjxXwqkNojRhdWjVM2jCtmN5sZu1AeM/qxvUGDZ3fZcywgTc cvNnk0jCQ1G3pObSCCamLOBEroHGkiBTYrzLQQaqJHrfOD7jUcN6JRrgcqXSiH0SwPdI n8AQW09OHaHmTPz4ycRLHbRyOepGiv5GE2Lxg8Uxj20TOSxI/0TSQ2X0JtRF7IV6HCH2 YESqA8IZnuu5v76qTl6CKPd8OH2c5EpujE9M7qusTBcIZ95vFrgeC1klvvPyRiFRmtPI ykkA== X-Gm-Message-State: APzg51DqYRky0gMt34dvwonxYSQgBhdR6LogEaoNeWOUFC6nSJqXYzVc R3jSgoJmmNDqRSsB4Nq4dqk= X-Received: by 2002:a1c:578a:: with SMTP id l132-v6mr6726877wmb.16.1536364557591; Fri, 07 Sep 2018 16:55:57 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4006:df00:c856:97f7:a8a9:88f6]) by smtp.gmail.com with ESMTPSA id d10-v6sm14672192wrv.70.2018.09.07.16.55.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 16:55:56 -0700 (PDT) Date: Sat, 8 Sep 2018 01:55:54 +0200 From: Luc Van Oostenryck To: Christophe LEROY Cc: Peter Zijlstra , 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 Subject: Re: [PATCH] perf: enum overflow in uapi/linux/perf_event.h Message-ID: <20180907235552.6a6oytkzzpn4pcgl@ltop.local> References: <20180907134246.GC24106@hirez.programming.kicks-ass.net> <20180907135817.GF24106@hirez.programming.kicks-ass.net> <7a086a56-a896-9513-7315-9d0d21b61a44@c-s.fr> <20180907184358.pg2ho4m4tc3dpwlw@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180907184358.pg2ho4m4tc3dpwlw@ltop.local> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 07, 2018 at 08:43:59PM +0200, Luc Van Oostenryck wrote: > On Fri, Sep 07, 2018 at 04:15:33PM +0200, Christophe LEROY wrote: > > 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. > > Sparse is a bit weird about the exact underlying type used for enums. > > > Ah yes, it seems that GCC is happy. So sparse should be fixed instead ? > > I'll investigate (I suppose the same is given on x86-32). It's definitively a bug in sparse. A relatively nasty one and which open a can of worms. Fortunately, I had already looked at these problems in May, I just didn't had the time to push the patches. -- Luc