From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Fri, 08 Feb 2019 21:53:29 +0000 Subject: Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device Message-Id: <20190208215329.GA9529@blackberry> List-Id: References: <20190204044531.GB1927@umbus.fritz.box> <69791b73-f93e-6957-92e8-5b8620b87731@kaod.org> <20190205052822.GE22661@umbus.fritz.box> <4d565738-a99b-0333-8533-037677358faa@kaod.org> <20190206012308.GP22661@umbus.fritz.box> <1745dd9f-2927-cae6-e8da-c350b0bd0a66@kaod.org> <20190207024950.GA22661@umbus.fritz.box> <20190208051523.GD2688@umbus.fritz.box> <9b556f53-fcfb-2ca3-019e-6ced0ec74c2a@kaod.org> In-Reply-To: <9b556f53-fcfb-2ca3-019e-6ced0ec74c2a@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, David Gibson On Fri, Feb 08, 2019 at 08:58:14AM +0100, C=E9dric Le Goater wrote: > On 2/8/19 6:15 AM, David Gibson wrote: > > On Thu, Feb 07, 2019 at 10:03:15AM +0100, C=E9dric 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 th= e VMA > >> but it's also safer. > >=20 > > Well, yes, where "safer" means "has the possibility to be correct". >=20 > Well, the only problem with the kernel approach is keeping a pointer on=20 > the VMA. If we could call find_vma(), it would be perfectly safe and much= =20 > 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.