[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAS16MpmqLQuuibW842a0Je7UHbveWQAKzbgC_BLs_xyDg@mail.gmail.com>
Date: Sun, 29 Dec 2024 01:12:46 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>,
Petr Pavlu <petr.pavlu@...e.com>, Sami Tolvanen <samitolvanen@...gle.com>,
Daniel Gomez <da.gomez@...sung.com>, linux-modules@...r.kernel.org,
Ard Biesheuvel <ardb@...nel.org>, Matthew Maurer <mmaurer@...gle.com>
Subject: Re: [PATCH 1/2] module: get symbol crc back to unsigned
On Sun, Dec 29, 2024 at 12:46 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Commit 71810db27c1c ("modversions: treat symbol CRCs as 32 bit
> quantities") changed the CRC fields to s32 because the __kcrctab and
> __kcrctab_gpl sections contained relative references to the actual
> CRC values stored in the .rodata section when CONFIG_MODULE_REL_CRCS=y.
>
> Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing
> CONFIG_MODULE_REL_CRCS") removed this complexity. Now, the __kcrctab
> and __kcrctab_gpl sections directly contain the CRC values in all cases.
>
> The genksyms tool outputs unsigned 32-bit CRC values, so u32 is preferred
> over s32.
>
> No functional changes are intended.
>
> Regardless of this change, the CRC value is assigned to the u32 variable,
> 'crcval' before the comparison, as seen in kernel/module/version.c:
>
> crcval = *crc;
[Just in case for confused reviewers]
It was previously mandatory (but now optional) in order to avoid sign
extension because the following line previously compared 'unsigned long'
and 's32':
if (versions[i].crc == crcval)
return 1;
versions[i].crc is still 'unsigned long' for backward compatibility.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists