OSDN Git Service

iommu: Allow page responses without PASID
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Tue, 16 Jun 2020 14:47:14 +0000 (16:47 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 30 Jun 2020 09:49:21 +0000 (11:49 +0200)
commit970471914c67b70df24def6b2a30cc42acbebded
treee5a47d0fc2c463cc17aa7f2f55f25a10fc6a8948
parentd3e3d2be688b4b5864538de61e750721a311e4fc
iommu: Allow page responses without PASID

Some PCIe devices do not expect a PASID value in PRI Page Responses.
If the "PRG Response PASID Required" bit in the PRI capability is zero,
then the OS should not set the PASID field. Similarly on Arm SMMU,
responses to stall events do not have a PASID.

Currently iommu_page_response() systematically checks that the PASID in
the page response corresponds to the one in the page request. This can't
work with virtualization because a page response coming from a guest OS
won't have a PASID if the passed-through device does not require one.

Add a flag to page requests that declares whether the corresponding
response needs to have a PASID. When this flag isn't set, allow page
responses without PASID.

Reported-by: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20200616144712.748818-1-jean-philippe@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
include/uapi/linux/iommu.h