Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-24 Thread Juergen Gross
On 24/04/18 12:31, Tim Deegan wrote: > At 07:45 +0200 on 23 Apr (1524469545), Juergen Gross wrote: >> On 22/04/18 18:39, Tim Deegan wrote: >>> At 19:11 +0200 on 21 Apr (1524337893), Juergen Gross wrote: On 21/04/18 15:32, Tim Deegan wrote: > At 09:44 +0200 on 19 Apr (1524131080), Juergen

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-24 Thread Tim Deegan
At 07:45 +0200 on 23 Apr (1524469545), Juergen Gross wrote: > On 22/04/18 18:39, Tim Deegan wrote: > > At 19:11 +0200 on 21 Apr (1524337893), Juergen Gross wrote: > >> On 21/04/18 15:32, Tim Deegan wrote: > >>> At 09:44 +0200 on 19 Apr (1524131080), Juergen Gross wrote: > Another alternative

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-22 Thread Juergen Gross
On 22/04/18 18:39, Tim Deegan wrote: > At 19:11 +0200 on 21 Apr (1524337893), Juergen Gross wrote: >> On 21/04/18 15:32, Tim Deegan wrote: >>> At 09:44 +0200 on 19 Apr (1524131080), Juergen Gross wrote: Another alternative would be to pass another flag to the callers to signal the need

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-22 Thread Tim Deegan
At 19:11 +0200 on 21 Apr (1524337893), Juergen Gross wrote: > On 21/04/18 15:32, Tim Deegan wrote: > > At 09:44 +0200 on 19 Apr (1524131080), Juergen Gross wrote: > >> Another alternative would be to pass another flag to the callers to > >> signal the need for a flush. This would require quite

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-21 Thread Juergen Gross
On 21/04/18 15:32, Tim Deegan wrote: > Hi, > > At 09:44 +0200 on 19 Apr (1524131080), Juergen Gross wrote: So either I'm adding some kind of locking/rcu, or I'm switching to use IPIs and access root_pgt_changed only locally. Do you have any preference? >>> >>> Since issuing an

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-21 Thread Tim Deegan
Hi, At 09:44 +0200 on 19 Apr (1524131080), Juergen Gross wrote: > >> So either I'm adding some kind of locking/rcu, or I'm switching to use > >> IPIs and access root_pgt_changed only locally. > >> > >> Do you have any preference? > > > > Since issuing an IPI is just a single call, I'd prefer not

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-19 Thread Juergen Gross
On 19/04/18 09:39, Jan Beulich wrote: On 19.04.18 at 08:19, wrote: >> On 18/04/18 18:12, Jan Beulich wrote: >> On 18.04.18 at 10:30, wrote: @@ -160,5 +161,20 @@ unsigned int flush_area_local(const void *va, unsigned int flags)

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-19 Thread Jan Beulich
>>> On 19.04.18 at 08:19, wrote: > On 18/04/18 18:12, Jan Beulich wrote: > On 18.04.18 at 10:30, wrote: >>> @@ -160,5 +161,20 @@ unsigned int flush_area_local(const void *va, unsigned >>> int flags) >>> >>> local_irq_restore(irqfl); >>> >>> +if

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-19 Thread Juergen Gross
On 18/04/18 18:12, Jan Beulich wrote: On 18.04.18 at 10:30, wrote: >> @@ -160,5 +161,20 @@ unsigned int flush_area_local(const void *va, unsigned >> int flags) >> >> local_irq_restore(irqfl); >> >> +if ( flags & FLUSH_ROOT_PGTBL ) >> +

Re: [Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-18 Thread Jan Beulich
>>> On 18.04.18 at 10:30, wrote: > @@ -160,5 +161,20 @@ unsigned int flush_area_local(const void *va, unsigned > int flags) > > local_irq_restore(irqfl); > > +if ( flags & FLUSH_ROOT_PGTBL ) > +get_cpu_info()->root_pgt_changed = true; > + > return

[Xen-devel] [PATCH v8 1/9] x86/xpti: avoid copying L4 page table contents when possible

2018-04-18 Thread Juergen Gross
For mitigation of Meltdown the current L4 page table is copied to the cpu local root page table each time a 64 bit pv guest is entered. Copying can be avoided in cases where the guest L4 page table hasn't been modified while running the hypervisor, e.g. when handling interrupts or any hypercall