Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp364649pxr; Sun, 10 Apr 2022 17:38:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi26Y1cLuc+7AYVd/hZcpXXwF50oLP9vBGbSmDvcYdnKfKetMPZ7nkwYe8uXq5GZ/WPFpA X-Received: by 2002:a05:6a00:15ca:b0:505:bf6f:2b48 with SMTP id o10-20020a056a0015ca00b00505bf6f2b48mr2907685pfu.64.1649637489937; Sun, 10 Apr 2022 17:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649637489; cv=none; d=google.com; s=arc-20160816; b=u1wNU9uW0sKRcv16k8AJxFWldiQSIstw284PZN0RMp/Ishs/v/Dh5biri63ReAoThr bvH870e3Z2NFRIov/9G4ao3MyCD8XqfQ1/tmLsz+pu6f6EeuVbOITrNTnWclKH228Go3 QKv16AuyT3goNjE1NL5dzsw1BEcojfI4LDIgsJPhHVyUsF5i83/c+weCwYOMfINMVkgJ rffrllvoxsSeaZmB6FNbLxthiMbRiC2X6A6PC1C1IBwLm/f4zwI+voqCet0WIoOGV2/8 3uM6yDci4PLhjTY7arpfVgs+0EvKHy9ESB4uWv0CidjzZFv2ZD7N0m5gjlGpnddp7VrH XM0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fkG/egEGOhBPwGeQiwIJVnqIv5nhGH7Hu+IZEvaNKpo=; b=NLDiWOjix69RA6TRVtG3neejAYgPEq64rUxcdQM+/7gP7f57Gg/vBmGgQlAWUw7vyo NIn+Aa/ESQZ0rRHyunIq/fPttQWOC4eL3wnwxDYuxQCApudVHGsSfmrgmtYV1ILovX/O LR9teBoUfx79UjVd9webGDwkISsDMguPXXvoOQhhpP+udoEEyyoju51Q+H+AzeLCWrs8 ayfe6vpe1oWWQBD0E4bH0epahx7acvX5IiW413U9dwPSwROt7BZ9ARrL8z/XWbnIAubs 5+jZNwOPYb6gNtQRimOnBilSFWgcxDExW1MQnYC82yLeYCihcnbAmil/2m1V7Ghjj2cD Ut8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bhO3jBMo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a63f60b000000b003982527600dsi8297161pgh.185.2022.04.10.17.37.45; Sun, 10 Apr 2022 17:38:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bhO3jBMo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbiDJTyg (ORCPT + 99 others); Sun, 10 Apr 2022 15:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241787AbiDJTyf (ORCPT ); Sun, 10 Apr 2022 15:54:35 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECDA649F2F; Sun, 10 Apr 2022 12:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649620344; x=1681156344; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=EF5s5J7GPdqeiz1pEHQ/PowHu/TjKguTo2H6OD1EN7Q=; b=bhO3jBMoQBJj79oZoo3KxdtcY/2c2NeEmQeGhvDmg7ODQ23i15dVKVIY jAZopaVTOo8joH5bLaBCDl5IO2p4H5DGz7JpZVNWmBQ+Zw3y/P5CRztDy oocY+rjaHz7WNjW67PAomN5AbaovM4U2cfAZyVKJPuNJRjDCKCvZrYIPv sB4Cm1miAUQAdjGCVr5WgA82vhAhq9FiSXtSwkNN+2hU5A2yOP7mvi1nB ybqoTEzLsE9hrsz3yKleuhmGbiG5yMvIOtYrJQs/t1rj6rxbirVeM2q0h TCyXDhc//rkx/FjkilPJdV4o0naS4SsLxRl5A7VrHMEKUknxXqnGIxw4t Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10313"; a="261430993" X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="261430993" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2022 12:52:23 -0700 X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="571814308" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314) ([10.237.222.76]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2022 12:52:21 -0700 Date: Sun, 10 Apr 2022 20:52:14 +0100 From: Giovanni Cabiddu To: Robin Murphy Cc: herbert@gondor.apana.org.au, davem@davemloft.net, qat-linux@intel.com, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: qat - stop using iommu_present() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Apr 05, 2022 at 01:25:11PM +0100, Robin Murphy wrote: > Even if an IOMMU might be present for some PCI segment in the system, > that doesn't necessarily mean it provides translation for the device > we care about. Replace iommu_present() with a more appropriate check. > > Signed-off-by: Robin Murphy > --- > drivers/crypto/qat/qat_common/adf_sriov.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/crypto/qat/qat_common/adf_sriov.c b/drivers/crypto/qat/qat_common/adf_sriov.c > index b960bca1f9d2..7f9c18dc4540 100644 > --- a/drivers/crypto/qat/qat_common/adf_sriov.c > +++ b/drivers/crypto/qat/qat_common/adf_sriov.c > @@ -3,7 +3,6 @@ > #include > #include > #include > -#include > #include "adf_common_drv.h" > #include "adf_cfg.h" > #include "adf_pfvf_pf_msg.h" > @@ -176,7 +175,7 @@ int adf_sriov_configure(struct pci_dev *pdev, int numvfs) > return -EFAULT; > } > > - if (!iommu_present(&pci_bus_type)) > + if (!device_iommu_mapped(&pdev->dev)) > dev_warn(&pdev->dev, "IOMMU should be enabled for SR-IOV to work correctly\n"); > > if (accel_dev->pf.vf_info) { > -- > 2.28.0.dirty > I tried this patch and it appears to work as expected. Acked-by: Giovanni Cabiddu Regards, -- Giovanni