On Fri, Oct 09, 2020 at 09:59:32AM +0200, Daniel Vetter wrote:
> We want to be able to revoke pci mmaps so that the same access rules
> applies as for /dev/kmem. Revoke support for devmem was added in
> 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the
> region").
> 
> The simplest way to achieve this is by having the same filp->f_mapping
> for all mappings, so that unmap_mapping_range can find them all, no
> matter through which file they've been created. Since this must be set
> at open time we need sysfs support for this.
> 
> Add an optional mapping parameter bin_attr, which is only consulted
> when there's also an mmap callback, since without mmap support
> allowing to adjust the ->f_mapping makes no sense.
> 
> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
> Cc: Jason Gunthorpe <j...@ziepe.ca>
> Cc: Kees Cook <keesc...@chromium.org>
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Cc: Andrew Morton <a...@linux-foundation.org>
> Cc: John Hubbard <jhubb...@nvidia.com>
> Cc: Jérôme Glisse <jgli...@redhat.com>
> Cc: Jan Kara <j...@suse.cz>
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Cc: linux...@kvack.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linux-me...@vger.kernel.org
> Cc: Bjorn Helgaas <bhelg...@google.com>
> Cc: linux-...@vger.kernel.org
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <raf...@kernel.org>
> Cc: Christian Brauner <christian.brau...@ubuntu.com>
> Cc: "David S. Miller" <da...@davemloft.net>
> Cc: Michael Ellerman <m...@ellerman.id.au>
> Cc: Sourabh Jain <sourabhj...@linux.ibm.com>
> Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
> Cc: Mauro Carvalho Chehab <mchehab+hua...@kernel.org>
> Cc: Nayna Jain <na...@linux.ibm.com>
> ---
>  fs/sysfs/file.c       | 11 +++++++++++
>  include/linux/sysfs.h |  2 ++
>  2 files changed, 13 insertions(+)

Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to