Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-17 Thread Jonathan Adams
On Tue, May 14, 2019 at 3:38 PM Sean Christopherson wrote: > On Tue, May 14, 2019 at 02:55:18PM -0700, Andy Lutomirski wrote: > > > On May 14, 2019, at 2:06 PM, Sean Christopherson > > > wrote: > > >> On Tue, May 14, 2019 at 01:33:21PM -0700, Andy Lutomirski wrote: > > >> I suspect that the

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Sean Christopherson
On Tue, May 14, 2019 at 02:55:18PM -0700, Andy Lutomirski wrote: > > > On May 14, 2019, at 2:06 PM, Sean Christopherson > > wrote: > > > >> On Tue, May 14, 2019 at 01:33:21PM -0700, Andy Lutomirski wrote: > >> I suspect that the context switch is a bit of a red herring. A > >>

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Andy Lutomirski
> On May 14, 2019, at 2:06 PM, Sean Christopherson > wrote: > >> On Tue, May 14, 2019 at 01:33:21PM -0700, Andy Lutomirski wrote: >> On Tue, May 14, 2019 at 11:09 AM Sean Christopherson >> wrote: >>> For IRQs it's somewhat feasible, but not for NMIs since NMIs are unblocked >>> on VMX

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Sean Christopherson
On Tue, May 14, 2019 at 01:33:21PM -0700, Andy Lutomirski wrote: > On Tue, May 14, 2019 at 11:09 AM Sean Christopherson > wrote: > > For IRQs it's somewhat feasible, but not for NMIs since NMIs are unblocked > > on VMX immediately after VM-Exit, i.e. there's no way to prevent an NMI > > from

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Andy Lutomirski
On Tue, May 14, 2019 at 11:09 AM Sean Christopherson wrote: > > On Tue, May 14, 2019 at 07:05:22PM +0200, Peter Zijlstra wrote: > > On Tue, May 14, 2019 at 06:24:48PM +0200, Alexandre Chartre wrote: > > > On 5/14/19 5:23 PM, Andy Lutomirski wrote: > > > > > > How important is the ability to

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Andy Lutomirski
On Tue, May 14, 2019 at 10:05 AM Peter Zijlstra wrote: > > On Tue, May 14, 2019 at 06:24:48PM +0200, Alexandre Chartre wrote: > > On 5/14/19 5:23 PM, Andy Lutomirski wrote: > > > > How important is the ability to enable IRQs while running with the KVM > > > page tables? > > > > > > > I can't say,

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Sean Christopherson
On Tue, May 14, 2019 at 07:05:22PM +0200, Peter Zijlstra wrote: > On Tue, May 14, 2019 at 06:24:48PM +0200, Alexandre Chartre wrote: > > On 5/14/19 5:23 PM, Andy Lutomirski wrote: > > > > How important is the ability to enable IRQs while running with the KVM > > > page tables? > > > > > > > I

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Peter Zijlstra
On Tue, May 14, 2019 at 06:24:48PM +0200, Alexandre Chartre wrote: > On 5/14/19 5:23 PM, Andy Lutomirski wrote: > > How important is the ability to enable IRQs while running with the KVM > > page tables? > > > > I can't say, I would need to check but we probably need IRQs at least for > some

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Alexandre Chartre
On 5/14/19 5:23 PM, Andy Lutomirski wrote: On Tue, May 14, 2019 at 2:42 AM Alexandre Chartre wrote: On 5/14/19 10:34 AM, Andy Lutomirski wrote: On May 14, 2019, at 1:25 AM, Alexandre Chartre wrote: On 5/14/19 9:09 AM, Peter Zijlstra wrote: On Mon, May 13, 2019 at 11:18:41AM

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Andy Lutomirski
On Tue, May 14, 2019 at 2:42 AM Alexandre Chartre wrote: > > > On 5/14/19 10:34 AM, Andy Lutomirski wrote: > > > > > >> On May 14, 2019, at 1:25 AM, Alexandre Chartre > >> wrote: > >> > >> > >>> On 5/14/19 9:09 AM, Peter Zijlstra wrote: > On Mon, May 13, 2019 at 11:18:41AM -0700, Andy

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Alexandre Chartre
On 5/14/19 10:34 AM, Andy Lutomirski wrote: On May 14, 2019, at 1:25 AM, Alexandre Chartre wrote: On 5/14/19 9:09 AM, Peter Zijlstra wrote: On Mon, May 13, 2019 at 11:18:41AM -0700, Andy Lutomirski wrote: On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre wrote: pcpu_base_addr is

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Andy Lutomirski
> On May 14, 2019, at 1:25 AM, Alexandre Chartre > wrote: > > >> On 5/14/19 9:09 AM, Peter Zijlstra wrote: >>> On Mon, May 13, 2019 at 11:18:41AM -0700, Andy Lutomirski wrote: >>> On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre >>> wrote: pcpu_base_addr is already mapped to

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Alexandre Chartre
On 5/14/19 9:09 AM, Peter Zijlstra wrote: On Mon, May 13, 2019 at 11:18:41AM -0700, Andy Lutomirski wrote: On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre wrote: pcpu_base_addr is already mapped to the KVM address space, but this represents the first percpu chunk. To access a per-cpu

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-14 Thread Peter Zijlstra
On Mon, May 13, 2019 at 11:18:41AM -0700, Andy Lutomirski wrote: > On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre > wrote: > > > > pcpu_base_addr is already mapped to the KVM address space, but this > > represents the first percpu chunk. To access a per-cpu buffer not > > allocated in the

Re: [RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-13 Thread Andy Lutomirski
On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre wrote: > > pcpu_base_addr is already mapped to the KVM address space, but this > represents the first percpu chunk. To access a per-cpu buffer not > allocated in the first chunk, add a function which maps all cpu > buffers corresponding to that

[RFC KVM 18/27] kvm/isolation: function to copy page table entries for percpu buffer

2019-05-13 Thread Alexandre Chartre
pcpu_base_addr is already mapped to the KVM address space, but this represents the first percpu chunk. To access a per-cpu buffer not allocated in the first chunk, add a function which maps all cpu buffers corresponding to that per-cpu buffer. Also add function to clear page table entries for a