iommu/amd: Fix for pasid initialization
Subsystems (2)
PATCH 1/2 iommu/amd: Fix for pasid initialization
From: Alexey Skidanov <[email protected]>
The pasid wasn't properly initialized before caling to invalid PPR calback
Signed-off-by Alexey Skidanov <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/iommu/amd_iommu_v2.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/amd_iommu_v2.c +1 -0
@@ -612,6 +612,7 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data) fault->state = pasid_state; fault->tag = tag; fault->finish = finish; + fault->pasid = iommu_fault->pasid; fault->flags = iommu_fault->flags;INIT_WORK (&fault->work, do_fault);
Signature · 1 line
1.9.1
PATCH 2/2 iommu/amd: Moving PPR fault flags macros definitions
From: Alexey Skidanov <[email protected]>
Any kernel source registering the invalid PPR calback may include the header file with PPR fault flags macros definitions. Thus we move them to include/linux/amd-iommu.h
Signed-off-by Alexey Skidanov <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/iommu/amd_iommu_types.h | 6 ------ include/linux/amd-iommu.h | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/iommu/amd_iommu_types.h +0 -6
@@ -390,12 +390,6 @@ struct amd_iommu_fault { }; -#define PPR_FAULT_EXEC (1 << 1) -#define PPR_FAULT_READ (1 << 2) -#define PPR_FAULT_WRITE (1 << 5) -#define PPR_FAULT_USER (1 << 6) -#define PPR_FAULT_RSVD (1 << 7) -#define PPR_FAULT_GN (1 << 8)struct iommu_domain ;
include/linux/amd-iommu.h +7 -0
@@ -119,6 +119,13 @@ typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev,extern int amd_iommu_set_invalid_ppr_cb (struct pci_dev *pdev,amd_iommu_invalid_ppr_cb cb); +#define PPR_FAULT_EXEC (1 << 1) +#define PPR_FAULT_READ (1 << 2) +#define PPR_FAULT_WRITE (1 << 5) +#define PPR_FAULT_USER (1 << 6) +#define PPR_FAULT_RSVD (1 << 7) +#define PPR_FAULT_GN (1 << 8) +/** * amd_iommu_device_info() - Get information about IOMMUv2 support of a * PCI device
Signature · 1 line
1.9.1
Quoted 9 lines · Oded Gabbay
From: Alexey Skidanov <[email protected]>
The pasid wasn't properly initialized before caling to invalid PPR calback
Signed-off-by Alexey Skidanov <[email protected]>Signed-off-by Oded Gabbay <[email protected]>--- drivers/iommu/amd_iommu_v2.c | 1 + 1 file changed, 1 insertion(+)
Applied both, thanks Oded.