[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu88A8OmVGV3-9YGkgNKOtCRmN70Ys2WL+F7au=NB4vydQ@mail.gmail.com>
Date: Sun, 26 Aug 2018 15:44:31 +0200
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
Jeffrey Lien <Jeff.Lien@....com>,
David Darrington <david.darrington@....com>,
Christoph Hellwig <hch@...radead.org>,
Jeff Furlong <jeff.furlong@....com>,
linux-block@...r.kernel.org,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-scsi@...r.kernel.org, Tim Chen <tim.c.chen@...ux.intel.com>
Subject: Re: [PATCH 4/4] block: Integrity profile init function to trigger
module loads
On 26 August 2018 at 15:30, Martin K. Petersen
<martin.petersen@...cle.com> wrote:
>
> Hi Ard,
>
>>> However, since the dependency for "crc10dif" is already satisfied,
>>> nothing is going to cause the hardware-accelerated kernel modules to
>>> get loaded.
>>
>> This is not true. All accelerated implementations based on SIMD
>> polynomial multiplication are tried to the respective CPU features
>> bits. This applies to x86, power, ARM and arm64.
>>
>> E.g., for x86 you have
>>
>> alias: cpu:type:x86,ven*fam*mod*:feature:*0081*
>>
>> which will be matched by udev if /sys/devices/system/cpu/modalias
>> contains feature 0081, and so the modules will be loaded automatically
>> at boot.
>
> If I can avoid carrying that init callback in the block integrity code
> that will definitely make me happy. However, loading crct10dif-pclmul
> does not happen automatically for me. crc-t10dif is linked statically
> and every user of the CRC goes through that library. So nothing ever
> requests the "crct10dif" modalias and no accelerator modules are loaded.
>
> <fresh boot>
>
> # lsmod | grep crc
> crc32c_intel 24576 0
> crc_ccitt 16384 1 ipv6
>
> # modinfo crc32c_intel | grep cpu:type
> alias: cpu:type:x86,ven*fam*mod*:feature:*0094*
>
> # modinfo crct10dif-pclmul | grep cpu:type
> alias: cpu:type:x86,ven*fam*mod*:feature:*0081*
>
> # egrep -o "0081|0094" /sys/devices/system/cpu/modalias
> 0081
> 0094
>
> # modprobe crct10dif
> # lsmod | grep crc
> crct10dif_pclmul 16384 1
> crc32c_intel 24576 0
> crc_ccitt 16384 1 ipv6
>
> It's interesting that crc32c_intel is loaded but libcrc32c is not. That
> matches your description of how things should work. But crct10dif-pclmul
> isn't loaded and neither is crc32_pclmul:
>
> # modprobe crc32
> # lsmod | grep crc
> crc32_generic 16384 0
> crc32_pclmul 16384 0
> crc32c_intel 24576 0
> crc_ccitt 16384 1 ipv6
>
That is odd. On my Ubuntu system, both crct10dif_pclmul and
crc32_pclmul get loaded automatically.
Powered by blists - more mailing lists