iommu/vt-d: Don't set then clear private data in prq_event_thread()
authorLu Baolu <baolu.lu@linux.intel.com>
Sat, 20 Mar 2021 02:41:56 +0000 (10:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:32 +0000 (09:50 +0200)
commitc96f7eb59b7e9f0ba7aace13169fe67e39e3adfa
tree38d2ad9a531b2b755fc30735c04fef1d5eb3b73d
parente0c7b956162b09a2c46623a99ef4f9b3332f4725
iommu/vt-d: Don't set then clear private data in prq_event_thread()

[ 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 <jacob.jun.pan@linux.intel.com>
Reviewed-by: Liu Yi L <yi.l.liu@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210320024156.640798-1-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel/svm.c