From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: Re: [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y Date: Thu, 03 Dec 2015 18:05:22 +0100 Message-ID: <1449162322.31265.2.camel@sipsolutions.net> References: <1449157807-20298-1-git-send-email-aryabinin@virtuozzo.com> <1449157807-20298-3-git-send-email-aryabinin@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Andrew Morton , Peter Zijlstra , Sasha Levin , Randy Dunlap , Rasmus Villemoes , Jonathan Corbet , Michal Marek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Yury Gribov , Dmitry Vyukov , Konstantin Khlebnikov , Kostya Serebryany , x86@kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org To: Andrey Ryabinin , linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1449157807-20298-3-git-send-email-aryabinin@virtuozzo.com> Sender: linux-kbuild-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, 2015-12-03 at 18:50 +0300, Andrey Ryabinin wrote: > With upcoming CONFIG_UBSAN the following BUILD_BUG_ON in > net/mac80211/debugfs.c starts to trigger: > BUILD_BUG_ON(hw_flag_names[NUM_IEEE80211_HW_FLAGS] != (void > *)0x1); > > It seems, that compiler instrumentation causes some code > deoptimizations. > Because of that GCC is not being able to resolve condition in > BUILD_BUG_ON() > at compile time. > > We could make size of hw_flag_names array unspecified and replace the > condition in BUILD_BUG_ON() with following: > ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS > > That will have the same effect as before (adding new flag without > updating > array will trigger build failure) except it doesn't fail with > CONFIG_UBSAN. > As a bonus this patch slightly decreases size of hw_flag_names array. > Seems fine, would you want to take it through some other tree together with UBSAN, or do you expect that to still take long enough to allow this to trickle through our trees? johannes