Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6632740rwl; Wed, 22 Mar 2023 13:16:56 -0700 (PDT) X-Google-Smtp-Source: AK7set9DQbN0A+n6kM2WK/hl/F70laax7zihSOu7xFPLw5J1JwB/GQFalaqr8aKFX72pdcu0hwit X-Received: by 2002:a17:906:8401:b0:92f:e643:e822 with SMTP id n1-20020a170906840100b0092fe643e822mr7939968ejx.37.1679516216243; Wed, 22 Mar 2023 13:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679516216; cv=none; d=google.com; s=arc-20160816; b=FvpUdDqbogGXCmLz9senb48rkqJAIPu2Guc5uzE5xX27HPawRx5FVcBR2F7Cx2BVL6 01/85XDSO5xAm7PYcdUWKqAX06zB22n3NGA9IoOO7K9QZBmq8FnNfAwbdjGN7bqF4Alg xIjdFt34U3t4mED3lRqWcNnAIwdgl/2ZhVjkuDwScaBUvX3fvYxlabfnREC3pcVaFn/v pKRV2gHTB3AmGkrGj32gF4Zk5P8NZEPRIslCC69glMuHvrAgNGn09wCITi2lD9ZdTTws NM3nFmE728Msop8CQHy+HYAYlffUyHPh+LREq6X6yoi+mQmTfhLPxA1qayu2VYkEAbe1 h+mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qaTyOggHsnfZ6cWo8N7nHy7r9PChH018qe02fTYWzc8=; b=mwMP0Q8xWM+XtRUe0kdCI/81WRxOu6aUd2zMivwOfvzqJUmOgggRw06WRBYMiETJt9 4hi0wR3gtvOEfbeb6dwH88Cx4CEUnmDHDFJqVruD8+byfxoZ+W7qs3ODrBItuo5RSmlB Vpu3VTzjKibakAZ0ZkQS+QDbz9hVwv5r1aRQJcb1tz+u22RCAOKVN76FbgRgjQ6NjY+r 2ma1eT3F71+ww8KnCzQ47Jp0d3+zP1uLq/luPwl/mIFKsjupn6uP8/ZmGhSI6Bjiq0+D teGKxW3nY4AtRMd1uY2Dt7zSABZ2Swi0UH8eeRxEIjkZqKN0IQ3K0L7dK3budXpjwZWK 1+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jhSv4s0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 um7-20020a170906cf8700b0092bc3318c92si14924269ejb.682.2023.03.22.13.16.31; Wed, 22 Mar 2023 13:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=jhSv4s0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232257AbjCVUPx (ORCPT + 99 others); Wed, 22 Mar 2023 16:15:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232486AbjCVUPb (ORCPT ); Wed, 22 Mar 2023 16:15:31 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 758388C941; Wed, 22 Mar 2023 13:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679515573; x=1711051573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5U1pqEnYI3Q80e7Obrp6GUJ1jNRTk8Hz1ySQDnWY03M=; b=jhSv4s0CjIWSTPd2QCmrRUvbm2CkGgP29h6BYy3D1vhk7UHo/2lWx0jb Ei6zkoKwz1XCK4jF4mAAcOnoit1xJlk0jmklR1EHyINB3r132ef2mEPt4 vo+QjHoj/59Tko0028hT8hzOFwlB63E+Sg0V8aMryTLK5v41aNahOPPbe kQfJy8qA7hrXGy11A4eFKbPKuBJrSy27Y+kECIGQgxJDAbSOPVfwYg/IW hbhAnFnJxeTc+5HuOQcK7TmIJmhm3QXvArom2EYJBOkUW4CW3d+ihcFEC hk+NAqmw1JaSAgn4tdnOp5Gdse3jTveUbZMHEFvbKnV/pMNiW5Dsn6frt A==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="339356849" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="339356849" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 13:04:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="682039344" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="682039344" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.106]) by orsmga002.jf.intel.com with ESMTP; 22 Mar 2023 13:04:05 -0700 From: Jacob Pan To: LKML , iommu@lists.linux.dev, Jason Gunthorpe , "Lu Baolu" , Joerg Roedel , Jean-Philippe Brucker , "Robin Murphy" , Dave Hansen , Thomas Gleixner , X86 Kernel , bp@alien8.de, "H. Peter Anvin" , Peter Zijlstra , corbet@lwn.net, vkoul@kernel.org, dmaengine@vger.kernel.org, linux-doc@vger.kernel.org Cc: "Will Deacon" , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Kirill Shutemov , Tony Luck , Jacob Pan Subject: [PATCH v8 5/7] iommu/sva: Use GFP_KERNEL for pasid allocation Date: Wed, 22 Mar 2023 13:08:01 -0700 Message-Id: <20230322200803.869130-6-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> References: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=unavailable 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-kernel@vger.kernel.org We’re not using spinlock-protected IOASID allocation anymore, there’s no need for GFP_ATOMIC. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Reviewed-by: Jason Gunthorpe Signed-off-by: Jacob Pan --- drivers/iommu/iommu-sva.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 48e8a15ddc9b..c434b95dc8eb 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -28,8 +28,8 @@ static int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t ma goto out; } - ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_ATOMIC); - if (ret < 0) + ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_KERNEL); + if (ret < min) goto out; mm->pasid = ret; ret = 0; -- 2.25.1