Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3329174pxk; Mon, 28 Sep 2020 14:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxazzWdTN4JdIuNeepX1AsxbJqR/3OaaVzyn6Ux6l4zgoRleH+wMGg4QDIvBpl8Ow+rq5GU X-Received: by 2002:aa7:d4d4:: with SMTP id t20mr4049019edr.229.1601329167378; Mon, 28 Sep 2020 14:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601329167; cv=none; d=google.com; s=arc-20160816; b=LJeKTMTpHp4dD+/NYx4S+nRFPMFN/KdfjoioSn2y8fxGGXjG9YrAF3VVeJRKTWYCrP 3rBxvkzKGIcd488yVlejYMXctirxVA0714ydM6xPEhfHZkt+eZ9mvJB024RRWQxXyxmQ NeB3hsZk37YeVOOqRl6/DaJuNHZ67UezfaBpReI4o5QUgCU4IPFgrrZswJ8a3e2rrAsf WoZLR6w1Xl7M4B+/NNd3CK8MDHMEA+dhQNN9hEdUsP0iDAUMgn7FCBGyEtP9WsjSAM6B /NPNZIONltwYMAdarGYuH4Cc0GFPOg/TspkvT/RGWSWIIPYNwWW4Akeph7/NqGC92+3t FcOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=d1FfSiT0/rNuXhBVREG/yc6QeqXaZmsaJ55ClmMPrSA=; b=OgL7NfDbjH3Q+iRQB3QduqDJ8KLnngLtOc9PzXVuwX/R1zNrVGvUOKuNlU5M+s8tvO hC73IzjidQ2jRmntyr/aEoD1AITwhJuzSqoMhQ58Tek7d59GY+YlHkPZWuUuAeH9i0na wnvcKNNF4USXxrWap2aMb0qKU14TpC/2LuNwVPliP/X2WIox2HkTDDzr0e4/jDOOvtiA GnnC9zdypaVNtgC2zJBRkOgrG3+TO9ZlNJZLHY0molfmbxgx3lkYtvJvzBWVnLJe4YTA MyJoGiDPs0aSsovV/XQ3ZxouuRFjpdNUaEiDOgievMBm+Xp5wCUluf8JVl7z3XTe6e9D PsOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r0TFUtTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si1499233edx.66.2020.09.28.14.39.04; Mon, 28 Sep 2020 14:39:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r0TFUtTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbgI1Vh2 (ORCPT + 99 others); Mon, 28 Sep 2020 17:37:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbgI1VhH (ORCPT ); Mon, 28 Sep 2020 17:37:07 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3DFC0613D6; Mon, 28 Sep 2020 14:36:57 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 7so2042999pgm.11; Mon, 28 Sep 2020 14:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d1FfSiT0/rNuXhBVREG/yc6QeqXaZmsaJ55ClmMPrSA=; b=r0TFUtTL36ac2nmkkmqUvShag9p4Nr90dTd1zKFHpK0u06RB7xzvc10y/8rI43dRe9 aL92VrM5u5jZPGZTrUTvzcCbWgiyP4IcC96N052t63wUVxyrF/jZ7TDILYSXdKRmmr/L GEX41iDNcl+PjkT7LI/2yZK1HVJ83WPCUcOeUtUuwd0GNCVro3zwgXgxmi1qwlKttoCR xNC42K+M5nDlIwHkyZA8/Hmp646Gumsdrwn+oVp4UOzedPc3hrLGGIUYuRmBnUsuzTZq hNy82OUKOWV1dcv//ylXy4FULe24ZdrYw95f9PDvCipj1BN+xc/Ip+xKPrBsIAtdMh0j I18A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d1FfSiT0/rNuXhBVREG/yc6QeqXaZmsaJ55ClmMPrSA=; b=cRzV0EkkCdEyvx5+2KazepHNz3NBeHwWGn9HjF6HQDf/6c+OTa3zyfxO81928lPKxv 1vGwdDqfueDU+OAFY/5Vynnaan49wHM/OKPL83EsCsyZHjznpptY3wLGSumhD5I1BT/u /JzcWbxchnGFHnVLfjyyACZZX0mqZu4iBGBv3AsDiPVd4hjvdBXyeyh10cJdaLDIIkEq cp6JZ6H09XUnUin2AgCWM8TfM1u5rJ1i1aYUtuRCTMbDBEpA4shtYK22vi7Wxe+MuE7R p9LuhaGcY8yEbQZsteLmUusXeSEvWKoqqZAPENtF9Dn7e9MAVa4ovid4HMrjEAIjjsPA 1SXA== X-Gm-Message-State: AOAM533BUzXPVvjsz94tKlxCgBGOB4v0rP7Na/B+A3vThYlg6LEre4M/ K1fzfaecxXWxqnbE+4HJJtI= X-Received: by 2002:a65:410c:: with SMTP id w12mr756685pgp.411.1601329017069; Mon, 28 Sep 2020 14:36:57 -0700 (PDT) Received: from jacob-builder.jf.intel.com (jfdmzpr04-ext.jf.intel.com. [134.134.137.73]) by smtp.gmail.com with ESMTPSA id l11sm2220864pjf.17.2020.09.28.14.36.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 14:36:56 -0700 (PDT) From: Jacob Pan X-Google-Original-From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , Alex Williamson , "Lu Baolu" , David Woodhouse , Jonathan Corbet Cc: linux-api@vger.kernel.org, Jean-Philippe Brucker , Eric Auger , Jacob Pan , Yi Liu , "Tian, Kevin" , Raj Ashok , Wu Hao , Yi Sun , Dave Jiang , Randy Dunlap Subject: [PATCH v3 12/14] iommu/vt-d: Remove mm reference for guest SVA Date: Mon, 28 Sep 2020 14:38:39 -0700 Message-Id: <1601329121-36979-13-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601329121-36979-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1601329121-36979-1-git-send-email-jacob.jun.pan@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that IOASID core keeps track of the IOASID to mm_struct ownership in the forms of ioasid_set with IOASID_SET_TYPE_MM token type, there is no need to keep the same mapping in VT-d driver specific data. Native SVM usage is not affected by the change. Signed-off-by: Jacob Pan --- drivers/iommu/intel/svm.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 2e764e283469..39a09a93300e 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -338,12 +338,6 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, ret = -ENOMEM; goto out; } - /* REVISIT: upper layer/VFIO can track host process that bind - * the PASID. ioasid_set = mm might be sufficient for vfio to - * check pasid VMM ownership. We can drop the following line - * once VFIO and IOASID set check is in place. - */ - svm->mm = get_task_mm(current); svm->pasid = data->hpasid; if (data->flags & IOMMU_SVA_GPASID_VAL) { svm->gpasid = data->gpasid; @@ -351,7 +345,6 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, } ioasid_attach_data(data->hpasid, svm); INIT_LIST_HEAD_RCU(&svm->devs); - mmput(svm->mm); } sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); if (!sdev) { -- 2.7.4