From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.avm.de (mail.avm.de [212.42.244.94]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D598C36D4F7 for ; Mon, 19 Jan 2026 13:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.42.244.94 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768830881; cv=none; b=dmsx89c1oZepmh9MYMgL070EnFokcxa7XXVh50Yv5yZq9uNK0Bnu3+hrFPotKL/xZrepSFxVhsr3wRmfcv9Lp42GubpumwI9E9nbCx6HOUgwqrx6PBmRy5Vws81hpQyz3HbJUOuOMmigmrN1VR6+K4VX86Ndn++lG09IAhcP23Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768830881; c=relaxed/simple; bh=eMmlSIQDH1+JLm7liIfpzmLd8IC5WyMpvpqkI9BXSZc=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=covmszRESq2tOX4HTEKv7MQWhqy5dZQ2WFu9YVMKMxNZ2eG+kgtnG1CdEvHf42pQ0OzH/HuDOAMb8X+pMSl2ncB1uO4m36FsMZsZfUec3Rn2y9YttnWo9Uu5zFZ3fPMqEeVHjIMSQSkpDiaq8dtUuEFMs7j4LJpS0IrYEKf4YP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=avm.de; spf=pass smtp.mailfrom=avm.de; dkim=pass (1024-bit key) header.d=avm.de header.i=@avm.de header.b=oBc74LwY; arc=none smtp.client-ip=212.42.244.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=avm.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=avm.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=avm.de header.i=@avm.de header.b="oBc74LwY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avm.de; s=mail; t=1768830532; bh=eMmlSIQDH1+JLm7liIfpzmLd8IC5WyMpvpqkI9BXSZc=; h=Date:From:To:Subject:References:In-Reply-To:From; b=oBc74LwYgxfl3m0IX8SsXuz1dS/lublzcErkNU/6q2URyCHq/mTvfPe9bFYt7j+2+ vkxqG2p4ioSuFFJ31dXT7EVW8eqeWePORuJWQjMYWIPWfCrkHZvhQTx+r4Gh5n3FjG N5etMcLwIglB5+3Cf4NAxDM/tb4jIlshkik+NU8M= Received: from [2001:bf0:244:244::71] (helo=mail.avm.de) by mail.avm.de with ESMTP (eXpurgate 4.54.3) (envelope-from ) id 696e3644-72bb-7f0000032729-7f000001be24-1 for ; Mon, 19 Jan 2026 14:48:52 +0100 Received: from mail-auth.avm.de (dovecot-mx-01.avm.de [IPv6:2001:bf0:244:244::71]) by mail.avm.de (Postfix) with ESMTPS; Mon, 19 Jan 2026 14:48:52 +0100 (CET) Date: Mon, 19 Jan 2026 14:48:21 +0100 From: Philipp Hahn To: Masahiro Yamada , Nicolas Schier , linux-kernel@vger.kernel.org Subject: Re: genksyms vs. opaque struct * Message-ID: Mail-Followup-To: Masahiro Yamada , Nicolas Schier , linux-kernel@vger.kernel.org References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-purgate-ID: 149429::1768830532-4348BFA8-132CD7FE/0/0 X-purgate-type: clean X-purgate-size: 2253 X-purgate-Ad: Categorized by eleven eXpurgate (R) https://www.eleven.de X-purgate: This mail is considered clean (visit https://www.eleven.de for further information) X-purgate: clean Hello, to answer my own question from last year: Am Thu, Nov 13, 2025 at 09:40:15PM +0100 schrieb Philipp Hahn: > while building a Linux kernel module I stumbled over an issue with 'genksyms': Basically my modules uses an "opaque struct" and only gets a pointer to such an object. The header file declaring that struct did *not* #include all needed header files recursively, so some types remained unresolved. > For compiling the module this was not an issue as the compiler only needs to allocate space for an pointer to that nested struct and does not need more details. > Another module exists which uses that symbol and recorded the calculated CRC. > > Then I changed my module and added some more #includes, which resulted into `genksyms` getting *more* details on the next run while the implementation actually did not change. ... > I wonder, why that option is not enabled by default or if there is another solution to prevent such breaking changed by including more/less #includes? Are there any good/recommended practices? That problem is and can mostly be ignored: - The CRC only tries to capture the ABI, but it is not perfect. You could also use a number and ask the developer to increment that manually each time the relevant ABI changes; just like it is done with the version number of shared libraries. - You as the developer decide, how much of the ABI shoule be tracked: - if you include more header files, you get a deeper dependency tree and will detect more breaking changes - wanted or unwanted - if you include less header files, you will detect fewer changes. - The CRC is only calculated when the experting module is "modpost"ed: The CRC is simply recorded then and any other module using it will just use that CRC. Including more or less headers at those using modules will not change anything as the CRC only depends on what was back than. In summary you might change the CRC is you include more or less headers when you re-compile the exporting module, but that is expected as the detail level changes. Consider that part of the ABI. If you do that you then have to just re-compile/link/modpost all downstream modules so they can pick up the new CRC. Philipp Hahn