On Fri, Feb 08, 2019 at 08:58:14AM +0100, Cédric Le Goater wrote: > On 2/8/19 6:15 AM, David Gibson wrote: > > On Thu, Feb 07, 2019 at 10:03:15AM +0100, Cédric Le Goater wrote: > >> That's the plan I have in mind as suggested by Paul if I understood it well. > >> The mechanics are more complex than the patch zapping the PTEs from the VMA > >> but it's also safer. > > > > Well, yes, where "safer" means "has the possibility to be correct". > > Well, the only problem with the kernel approach is keeping a pointer on > the VMA. If we could call find_vma(), it would be perfectly safe and much > more simpler. You seem to be assuming that the kernel can easily work out a single virtual address which will be the only place where a given set of interrupt pages are mapped. But that is really not possible in the general case, because userspace could have mapped the fd at many different offsets in many different places. QEMU doesn't do that; in QEMU, the mmaps are sufficiently limited that it can work out a single virtual address that needs to be changed. The way that QEMU should tell the kernel what that address is and what the mapping should be changed to, is via the existing munmap()/mmap() interface. Paul.