IOMMU Fixes for Linux v6.12-rc3

Including:
 
 	- ARM-SMMU fixes from Will Deacon:
 	  - Clarify warning message when failing to disable the MMU-500
 	    prefetcher
 	  - Fix undefined behaviour in calculation of L1 stream-table index
 	    when 32-bit StreamIDs are implemented
 	  - Replace a rogue comma with a semicolon
 
 	- Intel VT-d fix from Lu Baolu:
 	  - Fix incorrect pci_for_each_dma_alias() for non-PCI devices
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmcSIjEACgkQK/BELZcB
 GuPeJg/5AT4AuqnEG9NMecJAN4zvVd+2OO144XrqWsIMELqIzpYgLwkjoo8+dDE9
 EerRRs+HLddF1oV1WiC0UOyvIOdq4sIlAsdjLFQVd39qjmNQI5KM+ELCAlKuUkMj
 GFrk64PvXuWG6AeP+iAiVLnOmbkl6JAQAQ7qg7p9JxmSRUlUhMZywLUBi7CjR/FN
 uhgPsVzFfS13iQ4FXw5z6R+mG728chvc3DImGjmRlv0gIHdKif1MCZBp4zLo75Y5
 vTdP6Cf1uzIkTpr+OwtbE2u/zsXzS3oi9WJieHBbGs5VPtys/Uvl5wEdsNyBsLVv
 fUbNNhHaFinFoRGrctWDtsQ1CqdqIfQz7o9ob93lAVfQYSvN87qqmibvHUZllWhE
 WyxUvjerpvKOcKtVGHmIEbDSydAlVCXhoRG3uJ9c4KUucluVFnwy3IGSV52xIvl9
 WpEP95o0VUu+szkrsL0ACRMXjs4PXJQCX+LNBt8+Qkwf9K9ILk4NdoJ0MTxGTTPa
 b/ZJ4/6jxizBK4FGW1keZ0JodPu2Do1knYZ7gEwsb3UoBklAgtfM2EPzgjqzAodG
 9146w0XPJKED9k7m8fQuX67ZhihXs41RgUD1XqkrAhV9VifWBPfaS0pIXSC1l0ev
 OnvdQ/+5pt5pzSG7ErT2zpUBTBS8Vyruis68gIrKJJECnhMh3gM=
 =YT8V
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fixes from Joerg Roedel:
 "ARM-SMMU fixes from Will Deacon:

   - Clarify warning message when failing to disable the MMU-500
     prefetcher

   - Fix undefined behaviour in calculation of L1 stream-table index
     when 32-bit StreamIDs are implemented

   - Replace a rogue comma with a semicolon

  Intel VT-d fix from Lu Baolu:

   - Fix incorrect pci_for_each_dma_alias() for non-PCI devices"

* tag 'iommu-fixes-v6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices
  iommu/arm-smmu-v3: Convert comma to semicolon
  iommu/arm-smmu-v3: Fix last_sid_idx calculation for sid_bits==32
  iommu/arm-smmu: Clarify MMU-500 CPRE workaround
This commit is contained in:
Linus Torvalds 2024-10-18 07:13:24 -07:00
commit 75aa74d52f
3 changed files with 7 additions and 5 deletions

View File

@ -1420,7 +1420,7 @@ static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master)
cd_table->s1fmt = STRTAB_STE_0_S1FMT_LINEAR;
cd_table->linear.num_ents = max_contexts;
l1size = max_contexts * sizeof(struct arm_smmu_cd),
l1size = max_contexts * sizeof(struct arm_smmu_cd);
cd_table->linear.table = dma_alloc_coherent(smmu->dev, l1size,
&cd_table->cdtab_dma,
GFP_KERNEL);
@ -3625,7 +3625,7 @@ static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu)
u32 l1size;
struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
unsigned int last_sid_idx =
arm_smmu_strtab_l1_idx((1 << smmu->sid_bits) - 1);
arm_smmu_strtab_l1_idx((1ULL << smmu->sid_bits) - 1);
/* Calculate the L1 size, capped to the SIDSIZE. */
cfg->l2.num_l1_ents = min(last_sid_idx + 1, STRTAB_MAX_L1_ENTRIES);

View File

@ -130,7 +130,7 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu)
/*
* Disable MMU-500's not-particularly-beneficial next-page
* prefetcher for the sake of errata #841119 and #826419.
* prefetcher for the sake of at least 5 known errata.
*/
for (i = 0; i < smmu->num_context_banks; ++i) {
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
@ -138,7 +138,7 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu)
arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg);
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
if (reg & ARM_MMU500_ACTLR_CPRE)
dev_warn_once(smmu->dev, "Failed to disable prefetcher [errata #841119 and #826419], check ACR.CACHE_LOCK\n");
dev_warn_once(smmu->dev, "Failed to disable prefetcher for errata workarounds, check SACR.CACHE_LOCK\n");
}
return 0;

View File

@ -3340,8 +3340,10 @@ static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *op
*/
static void domain_context_clear(struct device_domain_info *info)
{
if (!dev_is_pci(info->dev))
if (!dev_is_pci(info->dev)) {
domain_context_clear_one(info, info->bus, info->devfn);
return;
}
pci_for_each_dma_alias(to_pci_dev(info->dev),
&domain_context_clear_one_cb, info);