lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201008112342.9394-2-christian.koenig@amd.com>
Date:   Thu,  8 Oct 2020 13:23:40 +0200
From:   "Christian König" 
        <ckoenig.leichtzumerken@...il.com>
To:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        linaro-mm-sig@...ts.linaro.org, dri-devel@...ts.freedesktop.org,
        linux-media@...r.kernel.org, chris@...is-wilson.co.uk,
        airlied@...hat.com, akpm@...ux-foundation.org, daniel@...ll.ch,
        sumit.semwal@...aro.org
Subject: [PATCH 2/4] drm/prime: document that use the page array is deprecated

We have reoccurring requests on this so better document that
this approach doesn't work and dma_buf_mmap() needs to be used instead.

Signed-off-by: Christian König <christian.koenig@....com>
---
 drivers/gpu/drm/drm_prime.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 4910c446db83..16fa2bfc271e 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -956,7 +956,7 @@ EXPORT_SYMBOL(drm_gem_prime_import);
 /**
  * drm_prime_sg_to_page_addr_arrays - convert an sg table into a page array
  * @sgt: scatter-gather table to convert
- * @pages: optional array of page pointers to store the page array in
+ * @pages: deprecated array of page pointers to store the page array in
  * @addrs: optional array to store the dma bus address of each page
  * @max_entries: size of both the passed-in arrays
  *
@@ -965,6 +965,11 @@ EXPORT_SYMBOL(drm_gem_prime_import);
  *
  * Drivers can use this in their &drm_driver.gem_prime_import_sg_table
  * implementation.
+ *
+ * Specifying the pages array is deprecated and strongly discouraged for new
+ * drivers. The pages array is only useful for page faults and those can
+ * corrupt fields in the struct page if they are not handled by the exporting
+ * driver.
  */
 int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
 				     dma_addr_t *addrs, int max_entries)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ