Commit fb5f50a
iommu/vt-d: Fix to convert mm pfn to dma pfn
For the case that VT-d page is smaller than mm page, converting dma pfn
should be handled in two cases which are for start pfn and for end pfn.
Currently the calculation of end dma pfn is incorrect and the result is
less than real page frame number which is causing the mapping of iova
always misses some page frames.
Rename the mm_to_dma_pfn() to mm_to_dma_pfn_start() and add a new helper
for converting end dma pfn named mm_to_dma_pfn_end().
Signed-off-by: Yanfei Xu <yanfei.xu@intel.com>
Link: https://lore.kernel.org/r/20230625082046.979742-1-yanfei.xu@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent 8a3b8e6 commit fb5f50a
1 file changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | | - | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
2403 | 2407 | | |
2404 | 2408 | | |
2405 | 2409 | | |
2406 | | - | |
2407 | | - | |
| 2410 | + | |
| 2411 | + | |
2408 | 2412 | | |
2409 | 2413 | | |
2410 | 2414 | | |
| |||
2425 | 2429 | | |
2426 | 2430 | | |
2427 | 2431 | | |
2428 | | - | |
2429 | | - | |
| 2432 | + | |
| 2433 | + | |
2430 | 2434 | | |
2431 | 2435 | | |
2432 | 2436 | | |
| |||
3549 | 3553 | | |
3550 | 3554 | | |
3551 | 3555 | | |
3552 | | - | |
3553 | | - | |
| 3556 | + | |
| 3557 | + | |
3554 | 3558 | | |
3555 | 3559 | | |
3556 | 3560 | | |
| |||
4254 | 4258 | | |
4255 | 4259 | | |
4256 | 4260 | | |
4257 | | - | |
| 4261 | + | |
4258 | 4262 | | |
4259 | 4263 | | |
4260 | 4264 | | |
| |||
0 commit comments