Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4623397pxj; Wed, 12 May 2021 09:27:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGVCHAwHcPs5i0Sv9dhmAWjQHHUaAISOPdZxAOaOlhOwv1KR9TtTU4KZULZtVJVTPTdNZD X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr27012297edu.165.1620836862656; Wed, 12 May 2021 09:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836862; cv=none; d=google.com; s=arc-20160816; b=tRQM0eJRabojSBMDumSC9t4clU0/FlLBAvyQzgvkpABogAzZhX7AI2l0nqJ0MBBQtC 1M4fM76PbrIv7r09oPZKbBtsMhVglj1Qen/tbaTQOrwiVAAUYwn9QjKhmVRnfavMtADm D1w12jkVzk/eFiki3rHUpm96L/tZIIQIeb3miGGBcN9+wQOeiASs6B5wdgVP77EzmT85 rhWOQUIUvvsDy0zNdasNwFZV+rTQ4AFfq3Kbu5qvTzqbzCHEJTzU5claq4HvXYTTCOpo YI1ftV39rZdNa+i9f9G07r6XTVA3Wk0Y4LQKCoPM+X+GKuPNwzZXVbi3K8hqUSof8tU7 MhTg== 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=y2/CCYzoUx7WJzDRb6G2odC9u3Ho5LQ/r1DODPjdWnc=; b=RSIV2mUIpc/oNjvXWoorxQbw7y198IhFT8Hv9dg230RBz9PDXDTD2/Jx3ZJtQ8WNQf jEn77lCkKFLYnlaavukS3WDAszKIiIYRVRRCBptVe/BMFai+RO9bzXyObCpW9kic5dEk kqJx60T+YpAerqQEd5CegvtN5T976SfW0RqS+pyIycRxqRbafWGMVgmzQ96Tc++tlCKS AOFIXwjFgLSwwv9j/ry7VlDhyEzSej0EACEKetESyHx/j9wC1d3JUFzSTHUQuKIbfcES Q/R5RSvvbRcq9HNwqG4T26+pXIjlBYmUyr3vfYbnFh+BO49QlosHuocNrdhaECkgtXeV 6wnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VA4Ayz4d; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb26si378996ejc.352.2021.05.12.09.27.10; Wed, 12 May 2021 09:27:42 -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=@linuxfoundation.org header.s=korg header.b=VA4Ayz4d; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236727AbhELQWz (ORCPT + 99 others); Wed, 12 May 2021 12:22:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:56688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236116AbhELPhE (ORCPT ); Wed, 12 May 2021 11:37:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0050D61C46; Wed, 12 May 2021 15:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832702; bh=RxZkfmJ5GaHK2idvKUvSLAK5WC7auKNs2oyDJFi/+lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VA4Ayz4dtaR62Y1T7n8LjjW3M4S2dFNIVG12/G3bwqCo1W3CvAbm2xBZ+S0lcuo/G lrlgKWh+ElfWHCvENHOuZ+EGKncoIa4TSs05jyKWgBQoqS4PVqceBiVNcUqURL60Qq n1kmA5ROG18AYjI69qZQ2iOlWkAnNg4xKYrhh6uw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacob Pan , Liu Yi L , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 5.10 388/530] iommu/vt-d: Dont set then clear private data in prq_event_thread() Date: Wed, 12 May 2021 16:48:18 +0200 Message-Id: <20210512144832.529053663@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lu Baolu [ Upstream commit 1d421058c815d54113d9afdf6db3f995c788cf0d ] The VT-d specification (section 7.6) requires that the value in the Private Data field of a Page Group Response Descriptor must match the value in the Private Data field of the respective Page Request Descriptor. The private data field of a page group response descriptor is set then immediately cleared in prq_event_thread(). This breaks the rule defined by the VT-d specification. Fix it by moving clearing code up. Fixes: 5b438f4ba315d ("iommu/vt-d: Support page request in scalable mode") Cc: Jacob Pan Reviewed-by: Liu Yi L Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210320024156.640798-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel/svm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 5c95e9693bf5..d79639b5b8a9 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -1071,12 +1071,12 @@ no_pasid: QI_PGRP_RESP_TYPE; resp.qw1 = QI_PGRP_IDX(req->prg_index) | QI_PGRP_LPIG(req->lpig); + resp.qw2 = 0; + resp.qw3 = 0; if (req->priv_data_present) memcpy(&resp.qw2, req->priv_data, sizeof(req->priv_data)); - resp.qw2 = 0; - resp.qw3 = 0; qi_submit_sync(iommu, &resp, 1, 0); } prq_advance: -- 2.30.2