From patchwork Tue Oct 17 03:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 153881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3872351vqb; Mon, 16 Oct 2023 20:22:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELffWyHJUzmzYJFlTtOS0J44ktBdfUAUvEIs9pixT6PiIZr/F7wglTrNfcA/MZZWzW5J+X X-Received: by 2002:a05:6808:3185:b0:3ad:af12:2fe0 with SMTP id cd5-20020a056808318500b003adaf122fe0mr1150228oib.3.1697512921998; Mon, 16 Oct 2023 20:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697512921; cv=none; d=google.com; s=arc-20160816; b=FdYty9Wrth0lmfPHCo3Yyq45ZRuA9Ni9vitjt/z5M6rvz0jQOgBFI+Vr2k+Xk26+DT LXR+NlgDqPCNsAOZVn7PJPHO6EjhtgTElFNcbToYcBsSd7WuQMOz+udjVHXfZNoah4NF D2KbOMIzYZ8r1GcbP+DbuiZccAuLYXeCM09Y/DboLdxa6Kgne4p67WPSxXfhxzlFjBQG Xih3erBanVAXPfiOj4KqDnSriA7hxi6WGAjD9fpuhTmIjECkpqQtUgmpsBPNsy3GZlwc wEr2yjAip1/G453Z3mrPHrmZ6lgSgBdMFwamU7oE07NMkr9xKg/xa/Vj9DOgxly4QjU6 JNDw== 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=GRgw4ob3EZUdTETO3EMmp2ojYOdreG3zDqAchctAhvc=; fh=R49q8kPD/ziIvsyYshS2LccDCxkbN9TSdzSyy3EleF0=; b=zyPrvvJ7mS7/P95sARhvtDX4Di9b59bv0TQeoJzl+wIC3gZE3YYYopYVIYO8xBgSRQ J7XBXYcaYuLHFROfvQAiVldJKmQoGv5pKgvDQaRr727ORZWAmo7kT/NHrAtN3x9MVsqh Q1gLF4mQccnXKioANpN9PK+NTSftXDG2J0o1VszTjkkR4AnDRpsVrnkdEJtlusiv+bMs O8f0IQbYmROrLtP46+ecAtztEwcWqHLyKt/hYUXIQ4UPz7eGZTJNe/ur9nqK5yLwx8V7 hJD8TTglnHNAL5bXCTYWBvXCY7CMbjDCiHAGQXk390uzVtpG5IOrArkWWz6iCiHZg+8O 9bJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=artdBOv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id m130-20020a633f88000000b00578a44df6c1si777967pga.640.2023.10.16.20.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 20:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=artdBOv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 05FE2801FA36; Mon, 16 Oct 2023 20:21:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234324AbjJQDVS (ORCPT + 19 others); Mon, 16 Oct 2023 23:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233862AbjJQDVM (ORCPT ); Mon, 16 Oct 2023 23:21:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E0FAB; Mon, 16 Oct 2023 20:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697512871; x=1729048871; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dsdAUA8p1gbd434H5E9bJERERFBzsxCgS1ZKXsNQj30=; b=artdBOv5V1vsnvytgpJOdYu1b//88t1Du6e2GHqbNAjo0a2eE87uBkhu m0gaj+1TZRX5pUhCXxkr5CokalCPAyumJkGIJ1g+yUUTKqzqSaqBluMBm tbrmNzJV+WQra0dbyJ7CbWB9bAtjyAXHtNA3cVQWPtfxVf/yiwWg4E5AY ioRO2D8APwJLdmXawT4Kz9sL3BPdVCqRVEbr9c3KOvm2DKHS+7M+4/46L ftbX1GGwFVZmUzH+54TmU9EUAukhYwfvQn/4IDGVt93EnEeg2nBSicwnO hB3KU0NnhA5QGF50fiq/nlc8Rl3xpKKVaKg/YWyoBdJGqhB2kwY0i9xGC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="389560777" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="389560777" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 20:21:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="826269905" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="826269905" Received: from sqa-gate.sh.intel.com (HELO spr-2s5.tsp.org) ([10.239.48.212]) by fmsmga004.fm.intel.com with ESMTP; 16 Oct 2023 20:21:08 -0700 From: Tina Zhang To: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: David Woodhouse , Lu Baolu , Joerg Roedel , Jason Gunthorpe , Kevin Tian , Tina Zhang Subject: [RFC PATCH 01/12] iommu/vt-d: Retire the treatment for revoking PASIDs with pending pgfaults Date: Tue, 17 Oct 2023 11:20:33 +0800 Message-Id: <20231017032045.114868-2-tina.zhang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231017032045.114868-1-tina.zhang@intel.com> References: <20231017032045.114868-1-tina.zhang@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 20:21:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779971309751401193 X-GMAIL-MSGID: 1779971309751401193 Revoking PASIDs with pending page faults has been achieved by clearing the pasid entry and draining the pending page faults in both hardware and software. The temporary treatment can be retired now. Signed-off-by: Tina Zhang --- 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 3c531af58658..9bf79cf88aec 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -387,13 +387,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); } }