linux-stable/drivers/iommu
Denys Vlasenko a5bbbf37c6 iommu/amd: Do not re-fetch iommu->cmd_buf_tail
The compiler is not smart enough to realize that iommu->cmd_buf_tail
can't be modified across memcpy:

41 8b 45 74          mov    0x74(%r13),%eax   # iommu->cmd_buf_tail
44 8d 78 10          lea    0x10(%rax),%r15d  # += sizeof(*cmd)
41 81 e7 ff 1f 00 00 and    $0x1fff,%r15d     # %= CMD_BUFFER_SIZE
49 03 45 68          add    0x68(%r13),%rax   # target = iommu->cmd_buf + iommu->cmd_buf_tail
45 89 7d 74          mov    %r15d,0x74(%r13)  # store to iommu->cmd_buf_tail
49 8b 34 24          mov    (%r12),%rsi       # memcpy
49 8b 7c 24 08       mov    0x8(%r12),%rdi    # memcpy
48 89 30             mov    %rsi,(%rax)       # memcpy
48 89 78 08          mov    %rdi,0x8(%rax)    # memcpy
49 8b 55 38          mov    0x38(%r13),%rdx   # iommu->mmio_base
41 8b 45 74          mov    0x74(%r13),%eax   # redundant load of iommu->cmd_buf_tail
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89 82 08 20 00 00    mov    %eax,0x2008(%rdx) # writel

CC: Tom Lendacky <thomas.lendacky@amd.com>
CC: Joerg Roedel <jroedel@suse.de>
CC: linux-kernel@vger.kernel.org
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2019-10-30 10:19:49 +01:00
..
amd_iommu.c iommu/amd: Do not re-fetch iommu->cmd_buf_tail 2019-10-30 10:19:49 +01:00
amd_iommu.h iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems 2019-08-23 10:26:48 +02:00
amd_iommu_debugfs.c
amd_iommu_init.c iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems 2019-08-23 10:26:48 +02:00
amd_iommu_proto.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
amd_iommu_quirks.c iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems 2019-08-23 10:26:48 +02:00
amd_iommu_types.h iommu/amd: Remove unnecessary locking from AMD iommu driver 2019-10-15 11:31:03 +02:00
amd_iommu_v2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
arm-smmu-impl.c iommu/arm-smmu: Make private implementation details static 2019-08-20 10:58:03 +01:00
arm-smmu-v3.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
arm-smmu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
arm-smmu.h Merge branches 'for-joerg/arm-smmu/smmu-v2' and 'for-joerg/arm-smmu/smmu-v3' into for-joerg/arm-smmu/updates 2019-08-23 15:05:45 +01:00
dma-iommu.c iommu/dma-iommu: Use the dev->coherent_dma_mask 2019-10-15 11:31:04 +02:00
dmar.c iommu/vt-d: Add Scalable Mode fault information 2019-09-11 12:36:53 +02:00
exynos-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
fsl_pamu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
fsl_pamu.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
fsl_pamu_domain.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
fsl_pamu_domain.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
hyperv-iommu.c iommu/hyper-v: Add Hyper-V stub IOMMU driver 2019-02-28 11:12:16 +01:00
intel-iommu-debugfs.c iommu/vt-d: Correctly check format of page table in debugfs 2019-08-09 17:29:25 +02:00
intel-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
intel-pasid.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/smmu', 'arm/omap', 'generic-dma-ops' and 'core' into next 2019-07-04 17:26:48 +02:00
intel-pasid.h iommu/vt-d: Introduce macros useful for dumping DMAR table 2019-05-27 16:16:09 +02:00
intel-svm.c iommu/vt-d: Remove global page flush support 2019-09-03 15:01:27 +02:00
intel-trace.c iommu/vt-d: Add trace events for device dma map/unmap 2019-09-11 12:34:30 +02:00
intel_irq_remapping.c iommu/vt-d: Fix wrong analysis whether devices share the same bus 2019-08-30 15:47:37 +02:00
io-pgtable-arm-v7s.c Merge branch 'arm/smmu' into arm/mediatek 2019-08-30 16:12:10 +02:00
io-pgtable-arm.c iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page() 2019-07-29 17:22:59 +01:00
io-pgtable.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
iommu-debugfs.c iommu: Fix IOMMU debugfs fallout 2019-02-26 11:15:58 +01:00
iommu-sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
iommu-traces.c
iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
iova.c iommu/iova: Avoid false sharing on fq_timer_on 2019-08-30 15:21:53 +02:00
ipmmu-vmsa.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
irq_remapping.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
irq_remapping.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
Kconfig iommu/amd: Convert AMD iommu driver to the dma-iommu api 2019-10-15 11:31:04 +02:00
Makefile Merge branches 'arm/omap', 'arm/exynos', 'arm/smmu', 'arm/mediatek', 'arm/qcom', 'arm/renesas', 'x86/amd', 'x86/vt-d' and 'core' into next 2019-09-11 12:39:19 +02:00
msm_iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
msm_iommu.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 267 2019-06-05 17:30:29 +02:00
msm_iommu_hw-8xxx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 267 2019-06-05 17:30:29 +02:00
mtk_iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
mtk_iommu.h iommu/mediatek: Clean up struct mtk_smi_iommu 2019-08-30 15:57:27 +02:00
mtk_iommu_v1.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
of_iommu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
omap-iommu-debug.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/smmu', 'arm/omap', 'generic-dma-ops' and 'core' into next 2019-07-04 17:26:48 +02:00
omap-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
omap-iommu.h iommu/omap: add support for late attachment of iommu devices 2019-08-09 17:37:10 +02:00
omap-iopgtable.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
qcom_iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
rockchip-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
s390-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
tegra-gart.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
tegra-smmu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00
virtio-iommu.c iommu: Add gfp parameter to iommu_ops::map 2019-10-15 11:31:04 +02:00