Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938643AbcKXJcT (ORCPT ); Thu, 24 Nov 2016 04:32:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:57633 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936485AbcKXJcQ (ORCPT ); Thu, 24 Nov 2016 04:32:16 -0500 Subject: Re: [PATCH] x86/kbuild: enable modversions for symbols exported from asm To: Nicholas Piggin References: <20161123205338.GA12050@angband.pl> <20161123210256.31501-1-kilobyte@angband.pl> <20161124044028.GA12704@gmail.com> <20161124162051.5e336127@roar.ozlabs.ibm.com> <20161124060050.GA788@gmail.com> <20161124182026.34e6570b@roar.ozlabs.ibm.com> <20161124073639.GA12728@kroah.com> <20161124185322.1e2a492c@roar.ozlabs.ibm.com> Cc: Greg Kroah-Hartman , Ingo Molnar , Al Viro , Adam Borowski , Philip Muller , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linus Torvalds , Andrew Morton , Peter Zijlstra , linux-arch , linux-kbuild From: Michal Marek Message-ID: <250b3310-6e4a-1352-be7a-a5a472829cec@suse.com> Date: Thu, 24 Nov 2016 10:32:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20161124185322.1e2a492c@roar.ozlabs.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 28 On 2016-11-24 08:53, Nicholas Piggin wrote: > On Thu, 24 Nov 2016 08:36:39 +0100 > Greg Kroah-Hartman wrote: > >> On Thu, Nov 24, 2016 at 06:20:26PM +1100, Nicholas Piggin wrote: >>> But still, modversions is pretty complicated for what it gives us. It sends >>> preprocessed C into a C parser that makes CRCs using type definitions of >>> exported symbols, then turns those CRCs into a linker script which which is >>> used to link the .o file with. What we get in return is a quite limited and >>> symbol "versioning" system. >>> >>> What if we ripped all that out and just attached an explicit version to >>> each export, and incompatible changes require an increment? >> >> How would that work for structures? Would that be required for every >> EXPORT_SYMBOL* somehow? > > Yeah just have EXPORT_SYMBOL take another parameter which attaches a version > number and use that as the value for the __crc_ symbol versions rather than > a calculated CRC. The problem is that with every kernel release, the structures change in a way that you would have to bump the version of virtually every export. At which point, there would be little difference between CONFIG_MODVERSION on and off (without CONFIG_MODVERSION, we compare the kernel version strings when loading modules). Michal