Skip to content

Commit d55b0d2

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Remove PPR support
Remove PPR handler and notifier related functions as its not used anymore. Note that we are retaining PPR interrupt handler support as it will be re-used when we introduce IOPF support. Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Tested-by: Alex Deucher <alexander.deucher@amd.com> Link: https://lore.kernel.org/r/20231006095706.5694-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 5a0b11a commit d55b0d2

File tree

3 files changed

+1
-59
lines changed

3 files changed

+1
-59
lines changed

drivers/iommu/amd/amd_iommu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
5252
int amd_iommu_pdev_enable_cap_pri(struct pci_dev *pdev);
5353
void amd_iommu_pdev_disable_cap_pri(struct pci_dev *pdev);
5454

55-
int amd_iommu_register_ppr_notifier(struct notifier_block *nb);
56-
int amd_iommu_unregister_ppr_notifier(struct notifier_block *nb);
5755
int amd_iommu_flush_page(struct iommu_domain *dom, u32 pasid, u64 address);
5856
void amd_iommu_update_and_flush_device_table(struct protection_domain *domain);
5957
void amd_iommu_domain_update(struct protection_domain *domain);

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -509,19 +509,6 @@ extern struct kmem_cache *amd_iommu_irq_cache;
509509
#define APERTURE_RANGE_INDEX(a) ((a) >> APERTURE_RANGE_SHIFT)
510510
#define APERTURE_PAGE_INDEX(a) (((a) >> 21) & 0x3fULL)
511511

512-
/*
513-
* This struct is used to pass information about
514-
* incoming PPR faults around.
515-
*/
516-
struct amd_iommu_fault {
517-
u64 address; /* IO virtual address of the fault*/
518-
u32 pasid; /* Address space identifier */
519-
u32 sbdf; /* Originating PCI device id */
520-
u16 tag; /* PPR tag */
521-
u16 flags; /* Fault flags */
522-
523-
};
524-
525512

526513
struct amd_iommu;
527514
struct iommu_domain;

drivers/iommu/amd/iommu.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ LIST_HEAD(acpihid_map);
6464

6565
const struct iommu_ops amd_iommu_ops;
6666

67-
static ATOMIC_NOTIFIER_HEAD(ppr_notifier);
6867
int amd_iommu_max_glx_val = -1;
6968

7069
/*
@@ -815,24 +814,6 @@ static void iommu_poll_events(struct amd_iommu *iommu)
815814
writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
816815
}
817816

818-
static void iommu_handle_ppr_entry(struct amd_iommu *iommu, u64 *raw)
819-
{
820-
struct amd_iommu_fault fault;
821-
822-
if (PPR_REQ_TYPE(raw[0]) != PPR_REQ_FAULT) {
823-
pr_err_ratelimited("Unknown PPR request received\n");
824-
return;
825-
}
826-
827-
fault.address = raw[1];
828-
fault.pasid = PPR_PASID(raw[0]);
829-
fault.sbdf = PCI_SEG_DEVID_TO_SBDF(iommu->pci_seg->id, PPR_DEVID(raw[0]));
830-
fault.tag = PPR_TAG(raw[0]);
831-
fault.flags = PPR_FLAGS(raw[0]);
832-
833-
atomic_notifier_call_chain(&ppr_notifier, 0, &fault);
834-
}
835-
836817
static void iommu_poll_ppr_log(struct amd_iommu *iommu)
837818
{
838819
u32 head, tail;
@@ -878,8 +859,7 @@ static void iommu_poll_ppr_log(struct amd_iommu *iommu)
878859
head = (head + PPR_ENTRY_SIZE) % PPR_LOG_SIZE;
879860
writel(head, iommu->mmio_base + MMIO_PPR_HEAD_OFFSET);
880861

881-
/* Handle PPR entry */
882-
iommu_handle_ppr_entry(iommu, entry);
862+
/* TODO: PPR Handler will be added when we add IOPF support */
883863

884864
/* Refresh ring-buffer information */
885865
head = readl(iommu->mmio_base + MMIO_PPR_HEAD_OFFSET);
@@ -2545,29 +2525,6 @@ const struct iommu_ops amd_iommu_ops = {
25452525
}
25462526
};
25472527

2548-
/*****************************************************************************
2549-
*
2550-
* The next functions do a basic initialization of IOMMU for pass through
2551-
* mode
2552-
*
2553-
* In passthrough mode the IOMMU is initialized and enabled but not used for
2554-
* DMA-API translation.
2555-
*
2556-
*****************************************************************************/
2557-
2558-
/* IOMMUv2 specific functions */
2559-
int amd_iommu_register_ppr_notifier(struct notifier_block *nb)
2560-
{
2561-
return atomic_notifier_chain_register(&ppr_notifier, nb);
2562-
}
2563-
EXPORT_SYMBOL(amd_iommu_register_ppr_notifier);
2564-
2565-
int amd_iommu_unregister_ppr_notifier(struct notifier_block *nb)
2566-
{
2567-
return atomic_notifier_chain_unregister(&ppr_notifier, nb);
2568-
}
2569-
EXPORT_SYMBOL(amd_iommu_unregister_ppr_notifier);
2570-
25712528
static int __flush_pasid(struct protection_domain *domain, u32 pasid,
25722529
u64 address, bool size)
25732530
{

0 commit comments

Comments
 (0)