Message ID | 20201026105818.2585306-1-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
Headers | show |
Series | follow_pfn and other iomap races | expand |
Maybe I'm missing something, but shouldn't follow_pfn be unexported at the end of the series?
On Thu, Oct 29, 2020 at 9:57 AM Christoph Hellwig <hch@infradead.org> wrote: > > Maybe I'm missing something, but shouldn't follow_pfn be unexported > at the end of the series? kvm is a legit user and modular afaict. But since you can't use this without an mmu_notifier anyway (or digging around in pagetable locking), maybe it should be EXPORT_SYMBOL_GPL now at least? -Daniel
On Thu, Oct 29, 2020 at 10:25:16AM +0100, Daniel Vetter wrote: > On Thu, Oct 29, 2020 at 9:57 AM Christoph Hellwig <hch@infradead.org> wrote: > > > > Maybe I'm missing something, but shouldn't follow_pfn be unexported > > at the end of the series? > > kvm is a legit user and modular afaict. But since you can't use this > without an mmu_notifier anyway (or digging around in pagetable > locking), maybe it should be EXPORT_SYMBOL_GPL now at least? I think it should then take the notifier as an argument even if it isn't diretly used as a safety check, and get a new name describing it. EXPORT_SYMBOL_GPL is probably ok for now, but I'm drafting a new EXPORT_SYMBOL_FOR_MODULE() which will export symbols that can only be used by one specific module, with kvm being a prime user due to all the odd exports it requires that aren't really the kernel interface by any normal means.
On Thu, Oct 29, 2020 at 10:28 AM Christoph Hellwig <hch@infradead.org> wrote: > > On Thu, Oct 29, 2020 at 10:25:16AM +0100, Daniel Vetter wrote: > > On Thu, Oct 29, 2020 at 9:57 AM Christoph Hellwig <hch@infradead.org> wrote: > > > > > > Maybe I'm missing something, but shouldn't follow_pfn be unexported > > > at the end of the series? > > > > kvm is a legit user and modular afaict. But since you can't use this > > without an mmu_notifier anyway (or digging around in pagetable > > locking), maybe it should be EXPORT_SYMBOL_GPL now at least? > > I think it should then take the notifier as an argument even if it isn't > diretly used as a safety check, and get a new name describing it. Hm so Jason and me discussed this, but e.g. the s390 is safe with with just the pagetable locks. So we'd need two versions. The more practical problem is that I haven't found a reasonable way to check that a passed in mmu_notifier is registered against the mm we're working on, and without that check it feels a bit silly. But if you see how to do that I think we can do an EXPORT_SYMBOL_GPL follow_pfn which takes the notifier, and an __follow_pfn for s390 and similar internal code which isn't exported. > EXPORT_SYMBOL_GPL is probably ok for now, but I'm drafting a new > EXPORT_SYMBOL_FOR_MODULE() which will export symbols that can only be > used by one specific module, with kvm being a prime user due to all > the odd exports it requires that aren't really the kernel interface by > any normal means. Hm yeah that's another one. There's also some virt stuff that's currently on unsafe_follow_pfn and needs to be switched over, and I think that would also need an mmu notifier of some sorts to close the gaps. -Daniel
On Thu, Oct 29, 2020 at 10:38:16AM +0100, Daniel Vetter wrote: > Hm so Jason and me discussed this, but e.g. the s390 is safe with with > just the pagetable locks. So we'd need two versions. > > The more practical problem is that I haven't found a reasonable way to > check that a passed in mmu_notifier is registered against the mm we're > working on, and without that check it feels a bit silly. But if you > see how to do that I think we can do an EXPORT_SYMBOL_GPL follow_pfn > which takes the notifier, and an __follow_pfn for s390 and similar > internal code which isn't exported. True, this is a bit of a mess. So maybe just rename it to __follow_pfn, proper documentation of the requirements and a switch to EXPORT_SYMBOL_GPL.