diff options
author | Dominique Martinet <[email protected]> | 2021-07-07 14:12:54 +0900 |
---|---|---|
committer | Konrad Rzeszutek Wilk <[email protected]> | 2021-07-13 20:04:56 -0400 |
commit | 868c9ddc182bc6728bb380cbfb3170734f72c599 (patch) | |
tree | d216d51e4fa2aa9e962bb4deb51774202584a2d4 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 09a4a79d42ced8ca7fc250b05e45ac1cb23a9c52 (diff) |
swiotlb: add overflow checks to swiotlb_bounce
This is a follow-up on 5f89468e2f06 ("swiotlb: manipulate orig_addr
when tlb_addr has offset") which fixed unaligned dma mappings,
making sure the following overflows are caught:
- offset of the start of the slot within the device bigger than
requested address' offset, in other words if the base address
given in swiotlb_tbl_map_single to create the mapping (orig_addr)
was after the requested address for the sync (tlb_offset) in the
same block:
|------------------------------------------| block
<----------------------------> mapped part of the block
^
orig_addr
^
invalid tlb_addr for sync
- if the resulting offset was bigger than the allocation size
this one could happen if the mapping was not until the end. e.g.
|------------------------------------------| block
<---------------------> mapped part of the block
^ ^
orig_addr invalid tlb_addr
Both should never happen so print a warning and bail out without trying
to adjust the sizes/offsets: the first one could try to sync from
orig_addr to whatever is left of the requested size, but the later
really has nothing to sync there...
Signed-off-by: Dominique Martinet <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Reviewed-by: Bumyong Lee <[email protected]
Cc: Chanho Park <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions