iommu/vt-d: Use per-cpu IOVA caching, suspend-to-ram causes machine hang
Quoted 4 lines
Hi Omer the following commit introduced a regression when doing suspend-to-ram. The machine never wakes up. We have more than a few machines that hang: SNB-i7-2620m, IVB-3370, HSW-4470r, BDW-5600u, BDW-525u.
Jan Niehusmann posted a patch that fixes a similar problem:
http://www.mail-archive.com/[email protected]/msg1158159.html
Can you please try it and see if it does the trick for you?
Thanks,
Adam
Yes, that does it. Thanks.
Quoted 5 lines · Adam Morrison
Quoted 4 lines
Hi Omer the following commit introduced a regression when doing suspend-to-ram. The machine never wakes up. We have more than a few machines that hang: SNB-i7-2620m, IVB-3370, HSW-4470r, BDW-5600u, BDW-525u.
Quoted 8 lines
Jan Niehusmann posted a patch that fixes a similar problem:
http://www.mail-archive.com/[email protected]/msg1158159.htmlCan you please try it and see if it does the trick for you?
Thanks,
Adam
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 iommu/vt-d: fix overflow of iommu->domains array
The valid range of 'did' in get_iommu_domain(*iommu, did) is 0..cap_ndoms(iommu->cap), so don't exceed that range in free_all_cpu_cached_iovas().
The user-visible impact of the out-of-bounds access is the machine hanging on suspend-to-ram. It is, in fact, a kernel panic, but due to already suspended devices, that's often not visible to the user.
---
Added some details and Tested-By to the commit message. Patch is unchanged.
Posted to [email protected] and [email protected] where the issue was discussed.
drivers/iommu/intel-iommu.c +1 -1
@@ -4600,7 +4600,7 @@ static void free_all_cpu_cached_iovas(unsigned int cpu)if (!iommu)continue ; -for (did =0 ; did <0xffff ; did++) { +for (did =0 ; did <cap_ndoms (iommu->cap); did++) { domain =get_iommu_domain (iommu, did);if (!domain)
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] iommu/vt-d: fix overflow of iommu->domains array
Quoted 11 lines · Jan Niehusmann
The valid range of 'did' in
get_iommu_domain(*iommu, did)is 0..cap_ndoms(iommu->cap), so don't exceed that range infree_all_cpu_cached_iovas().The user-visible impact of the out-of-bounds access is the machine hanging on suspend-to-ram. It is, in fact, a kernel panic, but due to already suspended devices, that's often not visible to the user.
Fixes 22e2f9fa63b0 ("iommu/vt-d: Use per-cpu IOVA caching")Signed-off-by Jan Niehusmann <[email protected]>Tested-by Marius Vlad <[email protected]>
Queued to iommu/fixes branch, thanks Jan.
Joerg
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx