amd_iommu: IO_PAGE_FAULTs on unity mapped regions during amd_iommu_init()
PATCH 1/1 amd_iommu: IO_PAGE_FAULTs on unity mapped regions during amd_iommu_init()
When dma_ops are initialized the unity mappings are created. The init_device_table_dma() function makes sure DMA from all devices is blocked by default. This opens a short window in time where DMA to unity mapped regions is blocked by the IOMMU. Make sure this does not happen by initializing the device table after dma_ops.
Reference: http://www.gossamer-threads.com/lists/linux/kernel/1670769
--- arch/x86/kernel/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
arch/x86/kernel/amd_iommu_init.c +7 -3
@@ -1363,6 +1363,7 @@ static struct syscore_ops amd_iommu_syscore_ops = {*/ static int __init amd_iommu_init (void ) { +struct amd_iommu *iommu;int i, ret =0 ;/*
@@ -1411,9 +1412,6 @@ static int __init amd_iommu_init(void)if (amd_iommu_pd_alloc_bitmap ==NULL ) goto free; -/* init the device table */ -init_device_table (); -/* * let all alias entries point to itself */
@@ -1463,6 +1461,12 @@ static int __init amd_iommu_init(void)if (ret) goto free_disable; +/* init the device table */ +init_device_table (); + +for_each_iommu (iommu) +iommu_flush_all_caches (iommu); +amd_iommu_init_api ();amd_iommu_init_notifier ();
Signature · 1 line
1.7.9.5
Quoted 6 lines · Shuah Khan
When
dma_opsare initialized the unity mappings are created. Theinit_device_table_dma()function makes sure DMA from all devices is blocked by default. This opens a short window in time where DMA to unity mapped regions is blocked by the IOMMU. Make sure this does not happen by initializing the device table afterdma_ops.
Quoted 7 lines
Reference: http://www.gossamer-threads.com/lists/linux/kernel/1670769
Signed-off-by Shuah Khan <[email protected]>CC [email protected] 3.0--- arch/x86/kernel/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
That file does not exist anymore, it died 2.5+ years ago:
403f81d8ee53 iommu/amd: Move missing parts to drivers/iommu
Thanks,
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 2 lines · Shuah Khan
arch/x86/kernel/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)That file does not exist anymore, it died 2.5+ years ago:
403f81d8ee53iommu/amd: Move missing parts todrivers/iommu
Right, the file was moved for Linux v3.1 AFAIR. But this patch is a stable-packport for v3.0 of a patch I sent yersterday :)
Joerg
PATCH 1/1 amd_iommu: IO_PAGE_FAULTs on unity mapped regions during amd_iommu_init()
Quoted 6 lines · Joerg Roedel
Quoted 5 lines · Ingo Molnar
Quoted 2 lines · Shuah Khan
arch/x86/kernel/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Quoted 6 lines
Quoted 3 lines
That file does not exist anymore, it died 2.5+ years ago:
403f81d8ee53iommu/amd: Move missing parts todrivers/iommuRight, the file was moved for Linux v3.1 AFAIR. But this patch is a stable-packport for v3.0 of a patch I sent yersterday :)
I changed the title accordingly.
Thanks,
Ingo
PATCH 1/1 iommu/amd: Initialize device table after dma_ops
When dma_ops are initialized the unity mappings are created. The init_device_table_dma() function makes sure DMA from all devices is blocked by default. This opens a short window in time where DMA to unity mapped regions is blocked by the IOMMU. Make sure this does not happen by initializing the device table after dma_ops.
Back-port upstream commit: f528d980c17b8714aedc918ba86e058af914d66b
--- arch/x86/kernel/amd_iommu_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
arch/x86/kernel/amd_iommu_init.c +7 -3
@@ -1363,6 +1363,7 @@ static struct syscore_ops amd_iommu_syscore_ops = {*/ static int __init amd_iommu_init (void ) { +struct amd_iommu *iommu;int i, ret =0 ;/*
@@ -1411,9 +1412,6 @@ static int __init amd_iommu_init(void)if (amd_iommu_pd_alloc_bitmap ==NULL ) goto free; -/* init the device table */ -init_device_table (); -/* * let all alias entries point to itself */
@@ -1463,6 +1461,12 @@ static int __init amd_iommu_init(void)if (ret) goto free_disable; +/* init the device table */ +init_device_table (); + +for_each_iommu (iommu) +iommu_flush_all_caches (iommu); +amd_iommu_init_api ();amd_iommu_init_notifier ();
Signature · 1 line
1.7.9.5