From patchwork Tue Feb 27 02:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 207058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2495704dyb; Mon, 26 Feb 2024 21:01:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXa29VeryrKAhWtHk+SA+GlsxWfPpOQNziLljZHZBsg/SrHs/UqnVXO2IUEHmO6GFdcjEoBukXEhl5iBsYykPRlSdQDkQ== X-Google-Smtp-Source: AGHT+IHy1CbcEmVui7VRQefEmZ8OFiXIRHItgKhyy6B2dzTA57Hk5gJJ+ttRb4Uh2mvKMWfamr+E X-Received: by 2002:a05:620a:40c1:b0:787:a74e:b811 with SMTP id g1-20020a05620a40c100b00787a74eb811mr1359048qko.57.1709010097022; Mon, 26 Feb 2024 21:01:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709010097; cv=pass; d=google.com; s=arc-20160816; b=zz5oisKkJKAMGWKrmXl9JlrA7e/TBVRge1MM70/CXQxSilrpTWZ83PbzK32xZgfAoz hiih+P67n6vfn8Nqhn6Qf7NJNrkt1y0EqQN3sYExZRk0crmXSGpZFAeHpcx1G15xBnDO XihL7HEeMo6661gN0KMsgwkS32XS170KnYw9UFyNmiBp5cQxxRtpPtvahVexe8quTmhx Swx+5wncC0+DXAC3yH1psaaIs3WpmG3jLCRM/kxGnRMFNS5U/fjKBAxTiKdZWYFAd51y wd6dhePW4Bos736ldWGtzxukBdCKILUxtWnhRMRYH1d3zRVQ8UPk1JLuOSut8H5iS6T3 WCjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=E52Nh4GwzujhTzER2/1ZrRryxUZFqzN1bSzypXGrll4=; fh=+24AZIOwsB6rN2R5rZXfKkfQNZggrrSJ6wNtGopki7U=; b=v9BsK5bxKRr2MnaqohrBvYAnMU5DvRKZ5w6WViKWcC6/ethCFevcpIsSbeiqroRy79 ggqZRoiHbaHWlXibp4bmohQNzNq5NizaWWJ29Vvxj4evw9+zyxG1WXZkz4I65w84h4hU ECTqB6ptfGY7LINWX3YBnh//R62tV+1HsIqY3fzsEB+jhY45cLTCIyPQ+PiP467QejEL DS/pJ0Pbx84jkPCE/AfMiP0VXxNQ8E3yf7pJv8O17c1W9fzfkMEDNlFftSxpiEx+XrCJ +/7Atz3lmth5Ma/cyrkvRc/w+o0ipBMWDqZ/+odJHwfdnFF/VOHORkUzfkb1Iem3NzWl teow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R7OLLwig; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82592-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82592-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t14-20020a05620a0b0e00b00787b873b66dsi6494801qkg.235.2024.02.26.21.01.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 21:01:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82592-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R7OLLwig; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82592-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82592-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 662381C28A06 for ; Tue, 27 Feb 2024 02:21:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C2C44F1F2; Tue, 27 Feb 2024 02:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R7OLLwig" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3497C10A34 for ; Tue, 27 Feb 2024 02:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709000447; cv=none; b=qM5r20WHnGsl2543CkLp0lNd4Rz8saRx8aC5rWavKeIeqn3CxTSENGFAQSlZKu1SgOns2AsnsSqs30xd5uJVrihF6dsxTA7SBQnpLe8Jzn1HP62jrUgnUDzYVhdqGTbZ/lobhvxuDIxEw3AVD5f6RYP7m/ZCpKOcOGEwI93cThc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709000447; c=relaxed/simple; bh=qVQIcSHSJ4R57qtQzHqo/LOuOIYQCzdxlV3v9opOJ34=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BnbD3d/9d5pR+OhOAkrDIAmxAbVpGui/J1cQaDCHUy6g34OqMNyO7/3RsWMfS9Bu0FgQ6xFxfVjXp1wHWk4UEDODx0njl+04uurO457/y5KHyNBNfeGIoUUoRIBvwlHB/dhiQZWTyt1G8muhtsHAvoWLSNHvIQaHUa3nLp/Vcxs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R7OLLwig; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709000446; x=1740536446; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qVQIcSHSJ4R57qtQzHqo/LOuOIYQCzdxlV3v9opOJ34=; b=R7OLLwigWihZDCx/o2BM/QIbFAPmUyqaYO23EhEYoyOR4r1hxDSp4VKc wB2lyFJYJ5sAcvHQAT9KoyYnknczCktToMAPlhp9V37/ri2pPNM+K6OTj 2eWQDlMJS+Hyp9BgKbmsKBR3gQfQjGoZgKazns3HyeVO6H2B0Gpz12j0W LLUjOEBJNk77Du3eek7sRMni5xd54tTaNM+Gnoz2yuRrrr8GDhR8WJ/WQ KuszVNLA2h65QQBQsJ6GuNUCvEd4r0elJymnmErH+oPaRiGLK3L66FeJX Qmqy6xm5vBEbTMbKbnnKWq43aCJc0hoP9OH0HRkDdflCD2FjoORgSKSgD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="6273112" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="6273112" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 18:20:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="7418295" Received: from allen-box.sh.intel.com ([10.239.159.127]) by orviesa008.jf.intel.com with ESMTP; 26 Feb 2024 18:20:44 -0800 From: Lu Baolu To: Joerg Roedel Cc: Tina Zhang , Erick Archer , Jingqi Liu , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] iommu/vt-d: Remove treatment for revoking PASIDs with pending page faults Date: Tue, 27 Feb 2024 10:14:37 +0800 Message-Id: <20240227021441.50434-5-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227021441.50434-1-baolu.lu@linux.intel.com> References: <20240227021441.50434-1-baolu.lu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792026971244569439 X-GMAIL-MSGID: 1792026971244569439 From: Tina Zhang Commit 2f26e0a9c986 ("iommu/vt-d: Add basic SVM PASID support") added a special treatment to mandate that no page faults may be outstanding for the PASID after intel_svm_unbind_mm() is called, as the PASID will be released and reused after unbind. This is unnecessary anymore as no outstanding page faults have been ensured in the driver's remove_dev_pasid path: - Tear down the pasid entry, which guarantees that new page faults for the PASID will be rejected by the iommu hardware. - All outstanding page faults have been responded to. - All hardware pending faults are drained in intel_drain_pasid_prq(). Remove this unnecessary code. Signed-off-by: Tina Zhang Link: https://lore.kernel.org/r/20240219125723.1645703-2-tina.zhang@intel.com Signed-off-by: Lu Baolu --- 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 40edd282903f..a815362c8e60 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -408,13 +408,6 @@ void intel_svm_remove_dev_pasid(struct device *dev, u32 pasid) if (svm->notifier.ops) mmu_notifier_unregister(&svm->notifier, mm); pasid_private_remove(svm->pasid); - /* - * We mandate that no page faults may be outstanding - * for the PASID when intel_svm_unbind_mm() is called. - * If that is not obeyed, subtle errors will happen. - * Let's make them less subtle... - */ - memset(svm, 0x6b, sizeof(*svm)); kfree(svm); } }