Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4917273imm; Sun, 26 Aug 2018 06:38:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdboSWE3TQeEDiY+OTNkIxHTKD1alx8gdCtTJKg2HT73Uq9HWY4dkKvmEI1pflOKyAZfgzrb X-Received: by 2002:a63:1b1f:: with SMTP id b31-v6mr8679834pgb.444.1535290704928; Sun, 26 Aug 2018 06:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535290704; cv=none; d=google.com; s=arc-20160816; b=EUrA0vRJHE1/jbOmHllH13YeAcz0hZHhADNPczfD2E+h1BPh2f1TareaI3HYRZ4SJv raZbos4nPI3r/wwkk2h8xB+9DmBDBE0BqoSaDrOpeowlZ64fgzf4IBBLJOqrSGClvgsl WU8JawNgVtfhdFnoMlgBnwqCUPTLWSxGCHT1FUz32F1ksf5nGxlUMa/yqLl4XFiq8lr2 gHaN8UcgslgHP3gSV6v69ghc3vSavGApDfn9luRwFfYBs00ZKENlWZ+bbvGrsjtrIQPl YoTYgZzerDhaVB9g1tFjaGKz8HIxhVKaSJz7a1lNisQgGI5acEpQ7PLkoecJ+8Svg2gr o5PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature:arc-authentication-results; bh=POLFm+waYGzqZQtkNMoNDcon9mY6AbTVNA8Ef/g/658=; b=T4PpY16g8Jp5Fg4TSz+t7cvGHbRNgmplhks7e2MTbQu6Ijow2ITlrLk5nYZRCDDuyI S3nihFcUFrrjFIxzXSp0OvSCIX9CEjFfoF3kN56n3cOMqpvpjjgxWvan6tZIdb+DqzZP hYmw1BeZQY594R+CxbZpukFnJSmqctvM+ulFz4kNdHg8P/Y8JXX2G83lWvd/4PMnetbT MS2z98vNRSM0zPJYnS4/UDx9uq2foMBW/4lANeVm9uMgbgU5JgTYFrNeD41f1bdIVewr zUQQYZlQWLUYt29YmmzB6hRwDasneDibROpSkDGosG/LUxrfsFiD4tuULFUD5kMNIpU+ PywQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nIyra9Au; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4-v6si8357886plo.377.2018.08.26.06.37.56; Sun, 26 Aug 2018 06:38:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nIyra9Au; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbeHZRNt (ORCPT + 99 others); Sun, 26 Aug 2018 13:13:49 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:58234 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbeHZRNs (ORCPT ); Sun, 26 Aug 2018 13:13:48 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7QDU4e3018051; Sun, 26 Aug 2018 13:30:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=POLFm+waYGzqZQtkNMoNDcon9mY6AbTVNA8Ef/g/658=; b=nIyra9AutfeoktfEFyz5JX41LERgVwGfzLeS3Ic/0xPWhyXG12G6JmySn9jFc82fPvXn leHvkFFgWHoWsU6u9/Q+4Sn5Uyf5h9ih9KcSvOTnTfD7p0cL1ZTejqiKZjatx+45PeQF WxPP+AHBmOrycAYAaVFf56r4V/mSjoWIC8q4nOfv3caT7Kpno6W9PeHUaR3GNcut4+62 KA4vN2oYibNMSawRmY+HH+jyhIIC56qyKsFlDDJLR1A1gWNVaRsW3l6PWeXbuVRwcwyQ RENypk440xSSjh1/6N3xZCMCDhjUoq86dmWt4fPBSn7y/M6G+xYED0JbSZg10ix+M5T8 6Q== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2m2xhtagcf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 26 Aug 2018 13:30:46 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7QDUiN6032005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 26 Aug 2018 13:30:45 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7QDUh5b014018; Sun, 26 Aug 2018 13:30:43 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 26 Aug 2018 06:30:43 -0700 To: Ard Biesheuvel Cc: "Martin K. Petersen" , Herbert Xu , Jeffrey Lien , David Darrington , Christoph Hellwig , Jeff Furlong , linux-block@vger.kernel.org, "open list\:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Kernel Mailing List , linux-scsi@vger.kernel.org, Tim Chen Subject: Re: [PATCH 4/4] block: Integrity profile init function to trigger module loads From: "Martin K. Petersen" Organization: Oracle Corporation References: <20180825061205.ygrjjazkooqghrqy@gondor.apana.org.au> <20180826024006.13800-1-martin.petersen@oracle.com> <20180826024006.13800-4-martin.petersen@oracle.com> Date: Sun, 26 Aug 2018 09:30:39 -0400 In-Reply-To: (Ard Biesheuvel's message of "Sun, 26 Aug 2018 09:22:43 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8996 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808260153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. # 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 -- Martin K. Petersen Oracle Linux Engineering