Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6225129iob; Tue, 10 May 2022 13:17:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl8g7EFXW5kPerINzziUhj7xIe/zrkrVWKj8SwhEaG6/L+ge82jen1xPhohsrAs2296XlZ X-Received: by 2002:a17:90b:f03:b0:1d9:a8e9:9e35 with SMTP id br3-20020a17090b0f0300b001d9a8e99e35mr1622840pjb.48.1652213856466; Tue, 10 May 2022 13:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652213856; cv=none; d=google.com; s=arc-20160816; b=xcALucqRoqIvm2lIHGEaESa/cyJUErYPHYqHHA0oG+2iDLdUaWTr+i6efQ3roPCCgx 0mbdZ5vHoQD+qzojbIVfCaEeoId9NMj1e93bH5U7PyrjUtQOLATnVMgKnksP2YamYH7o sfFnpiJCCwK6nPtKSJyp0BRzWCyAhwTox0ovvAatdmE9yS1xAV/dg25GdnYlgYDfGolm Xou/+v4TFIwG4YzW06hE3C+4KTcfi6oiPY0WJickC9K2nf0D5YfqUY7i5hURaOMKFveu su4hXfStaA50K905uwJb+osovucZI569ZrP0grQcViZOMXHdaVToozA8+bZkqBvGrUMT gkPg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BkacIkwotYTCDwJjsy5RZWM2zfbBV1mVd6v0ghsPxXE=; b=Zwd+aB2HK6MQIp9mYIzPVW7hhjApGDHdyFntQGQjyVlPP7KarMQmtCdu7WpluH/L4I FndPi2Q9KD/sXUyA3l4go6nntrXHjXq/8OBChhKuXrRaL4XEbi7gTYVmsowlYd38x7xG jraVvXLcHA/cbcVKDRWB7zG55jai3NxxfaJ9tFFaVLf6OYVazmts/nlBiJIOh21q9FLJ SpasmYRBEb0LFWQOn8axdOb5l5gzTl0JCDBM+tbR3v+eP3t1zarUTNA/ShJCkCbbaaKp O5/nu1NgojbkcAOJY5ICdZ75iReuhNFAo3jBs4gcj0XDkhjHkpKNH+/l+W5/Q3JJoHIk J3ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gCUPV+UN; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a056a00190c00b0050612d816e7si19808417pfi.104.2022.05.10.13.17.20; Tue, 10 May 2022 13:17:36 -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=@linuxfoundation.org header.s=korg header.b=gCUPV+UN; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245570AbiEJORV (ORCPT + 99 others); Tue, 10 May 2022 10:17:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244902AbiEJNrF (ORCPT ); Tue, 10 May 2022 09:47:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E4F1D8640; Tue, 10 May 2022 06:32:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1AB23617F5; Tue, 10 May 2022 13:32:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24C60C385C2; Tue, 10 May 2022 13:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189551; bh=AXVlMqWVh31M/5HakdprczmpNhoKSmd7rznleQMc9Hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCUPV+UNvT36wM0FfcxHtw5qrIXR4p+VNSOogc2JtvczbUgjcU8RIF9wlaxw9Cgp7 MpyxJUlZHSR5CtAxCIAr0A3QgoUhyGwrJh1w2vmkjKgD7JjhA5C6RCj6IqG6otgnlO a5ZhXXZ0V6k/wEo8GTmsZ25MERRX3tPhGe0Dnugk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lu Baolu , Jacob Pan , Kevin Tian , Joerg Roedel Subject: [PATCH 5.15 046/135] iommu/vt-d: Drop stop marker messages Date: Tue, 10 May 2022 15:07:08 +0200 Message-Id: <20220510130741.719786279@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130740.392653815@linuxfoundation.org> References: <20220510130740.392653815@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-kernel@vger.kernel.org From: Lu Baolu commit da8669ff41fa31573375c9a4180f5c080677204b upstream. The page fault handling framework in the IOMMU core explicitly states that it doesn't handle PCI PASID Stop Marker and the IOMMU drivers must discard them before reporting faults. This handles Stop Marker messages in prq_event_thread() before reporting events to the core. The VT-d driver explicitly drains the pending page requests when a CPU page table (represented by a mm struct) is unbound from a PASID according to the procedures defined in the VT-d spec. The Stop Marker messages do not need a response. Hence, it is safe to drop the Stop Marker messages silently if any of them is found in the page request queue. Fixes: d5b9e4bfe0d88 ("iommu/vt-d: Report prq to io-pgfault framework") Signed-off-by: Lu Baolu Reviewed-by: Jacob Pan Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220421113558.3504874-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220423082330.3897867-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/intel/svm.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -978,6 +978,10 @@ bad_req: goto bad_req; } + /* Drop Stop Marker message. No need for a response. */ + if (unlikely(req->lpig && !req->rd_req && !req->wr_req)) + goto prq_advance; + if (!svm || svm->pasid != req->pasid) { /* * It can't go away, because the driver is not permitted