Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-15 Thread Daniel Vetter
On Thu, Oct 15, 2020 at 2:09 AM Jason Gunthorpe wrote: > > On Fri, Oct 09, 2020 at 11:28:54AM -0700, Dan Williams wrote: > > On Fri, Oct 9, 2020 at 7:32 AM Jason Gunthorpe wrote: > > > > > > On Fri, Oct 09, 2020 at 04:24:45PM +0200, Daniel Vetter wrote: > > > > On Fri, Oct 9, 2020 at 2:31 PM Jaso

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-15 Thread Daniel Vetter
On Thu, Oct 15, 2020 at 9:52 AM Daniel Vetter wrote: > > On Thu, Oct 15, 2020 at 2:09 AM Jason Gunthorpe wrote: > > > > On Fri, Oct 09, 2020 at 11:28:54AM -0700, Dan Williams wrote: > > > On Fri, Oct 9, 2020 at 7:32 AM Jason Gunthorpe wrote: > > > > > > > > On Fri, Oct 09, 2020 at 04:24:45PM +02

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-15 Thread Daniel Vetter
On Thu, Oct 15, 2020 at 2:09 AM Jason Gunthorpe wrote: > > On Fri, Oct 09, 2020 at 11:28:54AM -0700, Dan Williams wrote: > > On Fri, Oct 9, 2020 at 7:32 AM Jason Gunthorpe wrote: > > > > > > On Fri, Oct 09, 2020 at 04:24:45PM +0200, Daniel Vetter wrote: > > > > On Fri, Oct 9, 2020 at 2:31 PM Jaso

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-15 Thread Jason Gunthorpe
On Fri, Oct 09, 2020 at 11:28:54AM -0700, Dan Williams wrote: > On Fri, Oct 9, 2020 at 7:32 AM Jason Gunthorpe wrote: > > > > On Fri, Oct 09, 2020 at 04:24:45PM +0200, Daniel Vetter wrote: > > > On Fri, Oct 9, 2020 at 2:31 PM Jason Gunthorpe wrote: > > > > > > > > On Fri, Oct 09, 2020 at 09:59:31

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-10 Thread Jason Gunthorpe
On Fri, Oct 09, 2020 at 04:24:45PM +0200, Daniel Vetter wrote: > On Fri, Oct 9, 2020 at 2:31 PM Jason Gunthorpe wrote: > > > > On Fri, Oct 09, 2020 at 09:59:31AM +0200, Daniel Vetter wrote: > > > > > +struct address_space *iomem_get_mapping(void) > > > +{ > > > + return iomem_inode->i_mapping;

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-10 Thread Jason Gunthorpe
On Fri, Oct 09, 2020 at 09:59:31AM +0200, Daniel Vetter wrote: > +struct address_space *iomem_get_mapping(void) > +{ > + return iomem_inode->i_mapping; This should pair an acquire with the release below > + /* > + * Publish /dev/mem initialized. > + * Pairs with smp_load_acquir

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-09 Thread Dan Williams
On Fri, Oct 9, 2020 at 7:32 AM Jason Gunthorpe wrote: > > On Fri, Oct 09, 2020 at 04:24:45PM +0200, Daniel Vetter wrote: > > On Fri, Oct 9, 2020 at 2:31 PM Jason Gunthorpe wrote: > > > > > > On Fri, Oct 09, 2020 at 09:59:31AM +0200, Daniel Vetter wrote: > > > > > > > +struct address_space *iomem_

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-09 Thread Daniel Vetter
On Fri, Oct 9, 2020 at 2:31 PM Jason Gunthorpe wrote: > > On Fri, Oct 09, 2020 at 09:59:31AM +0200, Daniel Vetter wrote: > > > +struct address_space *iomem_get_mapping(void) > > +{ > > + return iomem_inode->i_mapping; > > This should pair an acquire with the release below > > > + /* > > +

Re: [PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-09 Thread Greg Kroah-Hartman
On Fri, Oct 09, 2020 at 09:59:31AM +0200, Daniel Vetter wrote: > We want all iomem mmaps to consistently revoke ptes when the kernel > takes over and CONFIG_IO_STRICT_DEVMEM is enabled. This includes the > pci bar mmaps available through procfs and sysfs, which currently do > not revoke mappings. >

[PATCH v2 14/17] resource: Move devmem revoke code to resource framework

2020-10-09 Thread Daniel Vetter
We want all iomem mmaps to consistently revoke ptes when the kernel takes over and CONFIG_IO_STRICT_DEVMEM is enabled. This includes the pci bar mmaps available through procfs and sysfs, which currently do not revoke mappings. To prepare for this, move the code from the /dev/kmem driver to kernel/