On Wed, 3 Mar 2021, Suravee Suthikulpanit wrote: > > Additionally, alternative proposed solutions [1] were not considered or > > discussed. > > > > [1]:https://lore.kernel.org/linux-iommu/alpine.lnx.2.20.13.2006030935570.3...@monopod.intra.ispras.ru/ > > This check has been introduced early on to detect a HW issue for > certain platforms in the past, where the performance counters are not > accessible and would result in silent failure when try to use the > counters. This is considered legacy code, and can be removed if we > decide to no longer provide sanity check for such case.
Which platforms? There is no such information in the code or the commit messages that introduced this. According to AMD's documentation, presence of performance counters is indicated by "PCSup" bit in the "EFR" register. I don't think the driver should second-guess that. If there were platforms where the CPU or the firmware lied to the OS (EFR[PCSup] was 1, but counters were not present), I think that should have been handled in a more explicit manner, e.g. via matching broken CPUs by cpuid. Alexander _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu