Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-30 Thread Paul Mackerras
On Wed, Jan 30, 2019 at 04:54:23PM +0100, Cédric Le Goater wrote: > On 1/30/19 7:20 AM, Paul Mackerras wrote: > > On Tue, Jan 29, 2019 at 02:47:55PM +0100, Cédric Le Goater wrote: > >> On 1/29/19 3:45 AM, Paul Mackerras wrote: > >>> On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote:

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-30 Thread Cédric Le Goater
On 1/30/19 7:20 AM, Paul Mackerras wrote: > On Tue, Jan 29, 2019 at 02:47:55PM +0100, Cédric Le Goater wrote: >> On 1/29/19 3:45 AM, Paul Mackerras wrote: >>> On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: On 1/28/19 7:13 AM, Paul Mackerras wrote: > Would we end up with

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-30 Thread Cédric Le Goater
On 1/30/19 6:55 AM, Paul Mackerras wrote: > On Tue, Jan 29, 2019 at 06:44:50PM +0100, Cédric Le Goater wrote: >> On 1/29/19 5:12 AM, Paul Mackerras wrote: >>> On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: Is clearing the PTEs and repopulating the VMA unsafe ? >>> >>>

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-29 Thread Paul Mackerras
On Tue, Jan 29, 2019 at 02:47:55PM +0100, Cédric Le Goater wrote: > On 1/29/19 3:45 AM, Paul Mackerras wrote: > > On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: > >> On 1/28/19 7:13 AM, Paul Mackerras wrote: > >>> Would we end up with too many VMAs if we just used mmap() to >

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-29 Thread Paul Mackerras
On Tue, Jan 29, 2019 at 06:44:50PM +0100, Cédric Le Goater wrote: > On 1/29/19 5:12 AM, Paul Mackerras wrote: > > On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: > >> > >> Is clearing the PTEs and repopulating the VMA unsafe ? > > > > Actually, now that I come to think of it,

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-29 Thread Cédric Le Goater
On 1/29/19 5:12 AM, Paul Mackerras wrote: > On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: >> >> Is clearing the PTEs and repopulating the VMA unsafe ? > > Actually, now that I come to think of it, there could be any number of > VMAs (well, up to almost 64k of them), since

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-29 Thread Cédric Le Goater
On 1/29/19 3:45 AM, Paul Mackerras wrote: > On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: >> On 1/28/19 7:13 AM, Paul Mackerras wrote: >>> Would we end up with too many VMAs if we just used mmap() to >>> change the mappings from the software-generated pages to the >>>

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-29 Thread Cédric Le Goater
On 1/28/19 5:43 AM, Paul Mackerras wrote: > On Thu, Jan 24, 2019 at 08:25:15AM +1100, Benjamin Herrenschmidt wrote: >> On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: Afaik bcs we change the mapping to point to the real HW irq ESB page instead of the "IPI" that was there at VM

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-28 Thread Paul Mackerras
On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: > > Is clearing the PTEs and repopulating the VMA unsafe ? Actually, now that I come to think of it, there could be any number of VMAs (well, up to almost 64k of them), since once you have a file descriptor you can call mmap on

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-28 Thread Paul Mackerras
On Mon, Jan 28, 2019 at 07:26:00PM +0100, Cédric Le Goater wrote: > On 1/28/19 7:13 AM, Paul Mackerras wrote: > > Would we end up with too many VMAs if we just used mmap() to > > change the mappings from the software-generated pages to the > > hardware-generated interrupt pages? > The sPAPR IRQ

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-28 Thread Cédric Le Goater
On 1/28/19 7:13 AM, Paul Mackerras wrote: > On Wed, Jan 23, 2019 at 12:07:19PM +0100, Cédric Le Goater wrote: >> On 1/23/19 11:30 AM, Paul Mackerras wrote: >>> On Wed, Jan 23, 2019 at 05:45:24PM +1100, Benjamin Herrenschmidt wrote: On Tue, 2019-01-22 at 16:26 +1100, Paul Mackerras wrote:

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-27 Thread Paul Mackerras
On Wed, Jan 23, 2019 at 12:07:19PM +0100, Cédric Le Goater wrote: > On 1/23/19 11:30 AM, Paul Mackerras wrote: > > On Wed, Jan 23, 2019 at 05:45:24PM +1100, Benjamin Herrenschmidt wrote: > >> On Tue, 2019-01-22 at 16:26 +1100, Paul Mackerras wrote: > >>> On Mon, Jan 07, 2019 at 08:10:05PM +0100,

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-27 Thread Paul Mackerras
On Thu, Jan 24, 2019 at 08:25:15AM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: > > > Afaik bcs we change the mapping to point to the real HW irq ESB page > > > instead of the "IPI" that was there at VM init time. > > > > So that makes it sound

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-24 Thread Cédric Le Goater
On 1/23/19 10:25 PM, Benjamin Herrenschmidt wrote: > On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: >>> Afaik bcs we change the mapping to point to the real HW irq ESB page >>> instead of the "IPI" that was there at VM init time. >> >> So that makes it sound like there is a whole lot

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-23 Thread Benjamin Herrenschmidt
On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: > > Afaik bcs we change the mapping to point to the real HW irq ESB page > > instead of the "IPI" that was there at VM init time. > > So that makes it sound like there is a whole lot going on that hasn't > even been hinted at in the patch

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-23 Thread Cédric Le Goater
On 1/23/19 11:30 AM, Paul Mackerras wrote: > On Wed, Jan 23, 2019 at 05:45:24PM +1100, Benjamin Herrenschmidt wrote: >> On Tue, 2019-01-22 at 16:26 +1100, Paul Mackerras wrote: >>> On Mon, Jan 07, 2019 at 08:10:05PM +0100, Cédric Le Goater wrote: Clear the ESB pages from the VMA of the IRQ

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-23 Thread Paul Mackerras
On Wed, Jan 23, 2019 at 05:45:24PM +1100, Benjamin Herrenschmidt wrote: > On Tue, 2019-01-22 at 16:26 +1100, Paul Mackerras wrote: > > On Mon, Jan 07, 2019 at 08:10:05PM +0100, Cédric Le Goater wrote: > > > Clear the ESB pages from the VMA of the IRQ being pass through to the > > > guest and let

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-22 Thread Benjamin Herrenschmidt
On Tue, 2019-01-22 at 16:26 +1100, Paul Mackerras wrote: > On Mon, Jan 07, 2019 at 08:10:05PM +0100, Cédric Le Goater wrote: > > Clear the ESB pages from the VMA of the IRQ being pass through to the > > guest and let the fault handler repopulate the VMA when the ESB pages > > are accessed for an

Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-21 Thread Paul Mackerras
On Mon, Jan 07, 2019 at 08:10:05PM +0100, Cédric Le Goater wrote: > Clear the ESB pages from the VMA of the IRQ being pass through to the > guest and let the fault handler repopulate the VMA when the ESB pages > are accessed for an EOI or for a trigger. Why do we want to do this? I don't see any

[PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support

2019-01-07 Thread Cédric Le Goater
Clear the ESB pages from the VMA of the IRQ being pass through to the guest and let the fault handler repopulate the VMA when the ESB pages are accessed for an EOI or for a trigger. Storing the VMA under the KVM XIVE device is a little ugly. Signed-off-by: Cédric Le Goater ---