Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANDROID: dma-buf: Add vendorhook to allow mmaping more memory than a …
…DMA-BUF holds Add vendorhook to allow mmaping more memory than a DMA-BUF holds. The implementor of the vmap callback for the DMA-BUF is responsible for ensuring that all pages are backed by memory. The hook takes as input a DMA-BUF to allow the VMA bounds check to be done on a case-by-case basis for DMA-BUFs. Note that if the override is allowed to go through for a given DMA-BUF, then it can be the case that the size of this mmaped DMA-BUF is reported incorrectly when looking at /proc/pid/maps for the owning process. Bug: 234753494 Change-Id: Iba8cc8adfd2290e4dc7ef04fce5d6a80ac92e0b3 Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com> Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
- Loading branch information
Chris Goldsworthy
authored and
Sukadev Bhattiprolu
committed
Jan 11, 2023
1 parent
41d708a
commit 9972a4f
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM dmabuf | ||
|
||
#define TRACE_INCLUDE_PATH trace/hooks | ||
|
||
#if !defined(_TRACE_HOOK_DMA_BUF_H) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _TRACE_HOOK_DMA_BUF_H | ||
|
||
struct dma_buf; | ||
|
||
#include <trace/hooks/vendor_hooks.h> | ||
|
||
DECLARE_HOOK(android_vh_ignore_dmabuf_vmap_bounds, | ||
TP_PROTO(struct dma_buf *dma_buf, bool *ignore_bounds), | ||
TP_ARGS(dma_buf, ignore_bounds)); | ||
|
||
#endif /* _TRACE_HOOK_DMA_BUF_H */ | ||
|
||
/* This part must be outside protection */ | ||
#include <trace/define_trace.h> |