From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 9 Oct 2020 12:58:03 +0200 From: Greg Kroah-Hartman Subject: Re: [PATCH v2 15/17] sysfs: Support zapping of binary attr mmaps Message-ID: <20201009105803.GA505688@kroah.com> References: <20201009075934.3509076-1-daniel.vetter@ffwll.ch> <20201009075934.3509076-16-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201009075934.3509076-16-daniel.vetter@ffwll.ch> List-ID: To: Daniel Vetter Cc: DRI Development , LKML , kvm@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Daniel Vetter , Jason Gunthorpe , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , =?iso-8859-1?B?Suly9G1l?= Glisse , Jan Kara , Bjorn Helgaas , linux-pci@vger.kernel.org, "Rafael J. Wysocki" , Christian Brauner , "David S. Miller" , Michael Ellerman , Sourabh Jain , Mauro Carvalho Chehab , Nayna Jain 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"). >=20 > 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. >=20 > 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. >=20 > Signed-off-by: Daniel Vetter > Cc: Jason Gunthorpe > Cc: Kees Cook > Cc: Dan Williams > Cc: Andrew Morton > Cc: John Hubbard > Cc: J=EF=BF=BDr=EF=BF=BDme Glisse > Cc: Jan Kara > Cc: Dan Williams > Cc: linux-mm@kvack.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-samsung-soc@vger.kernel.org > Cc: linux-media@vger.kernel.org > Cc: Bjorn Helgaas > Cc: linux-pci@vger.kernel.org > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Cc: Christian Brauner > Cc: "David S. Miller" > Cc: Michael Ellerman > Cc: Sourabh Jain > Cc: Daniel Vetter > Cc: Mauro Carvalho Chehab > Cc: Nayna Jain > --- > fs/sysfs/file.c | 11 +++++++++++ > include/linux/sysfs.h | 2 ++ > 2 files changed, 13 insertions(+) Reviewed-by: Greg Kroah-Hartman