Re: DANGER WILL ROBINSON, DANGER

2019-10-04 Thread Paolo Bonzini
On 04/10/19 11:41, Mircea CIRJALIU - MELIU wrote: > I get it so far. I have a patch that does mirroring in a separate VMA. > We create an extra VMA with VM_PFNMAP/VM_MIXEDMAP that mirrors the > source VMA in the other QEMU and is refreshed by the device MMU notifier. So for example on the host

Re: DANGER WILL ROBINSON, DANGER

2019-10-03 Thread Paolo Bonzini
On 03/10/19 20:31, Jerome Glisse wrote: > So in summary, the source qemu process has anonymous vma (regular > libc malloc for instance). The introspector qemu process which > mirror the the source qemu use mmap on /dev/kvm (assuming you can > reuse the kvm device file for this otherwise you can

Re: DANGER WILL ROBINSON, DANGER

2019-10-03 Thread Jerome Glisse
On Thu, Oct 03, 2019 at 04:42:20PM +, Mircea CIRJALIU - MELIU wrote: > > On 03/10/19 17:42, Jerome Glisse wrote: > > > All that is needed is to make sure that vm_normal_page() will see > > > those pte (inside the process that is mirroring the other process) as > > > special which is the case

Re: DANGER WILL ROBINSON, DANGER

2019-10-03 Thread Paolo Bonzini
On 03/10/19 17:42, Jerome Glisse wrote: > All that is needed is to make sure that vm_normal_page() will see those > pte (inside the process that is mirroring the other process) as special > which is the case either because insert_pfn() mark the pte as special or > the kvm device driver which

Re: DANGER WILL ROBINSON, DANGER

2019-10-03 Thread Jerome Glisse
On Wed, Oct 02, 2019 at 10:10:18PM +0200, Paolo Bonzini wrote: > On 02/10/19 19:04, Jerome Glisse wrote: > > On Wed, Oct 02, 2019 at 06:18:06PM +0200, Paolo Bonzini wrote: > If the mapping of the source VMA changes, mirroring can update the > target VMA via insert_pfn. But what ensures

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Paolo Bonzini
On 02/10/19 19:04, Jerome Glisse wrote: > On Wed, Oct 02, 2019 at 06:18:06PM +0200, Paolo Bonzini wrote: If the mapping of the source VMA changes, mirroring can update the target VMA via insert_pfn. But what ensures that KVM's MMU notifier dismantles its own existing page tables

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Jerome Glisse
On Wed, Oct 02, 2019 at 06:18:06PM +0200, Paolo Bonzini wrote: > On 02/10/19 16:15, Jerome Glisse wrote: > >>> Why would you need to target mmu notifier on target vma ? > >> If the mapping of the source VMA changes, mirroring can update the > >> target VMA via insert_pfn. But what ensures that

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Paolo Bonzini
On 02/10/19 16:15, Jerome Glisse wrote: >>> Why would you need to target mmu notifier on target vma ? >> If the mapping of the source VMA changes, mirroring can update the >> target VMA via insert_pfn. But what ensures that KVM's MMU notifier >> dismantles its own existing page tables (so that

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Jerome Glisse
On Wed, Oct 02, 2019 at 03:46:30PM +0200, Paolo Bonzini wrote: > On 02/10/19 21:27, Jerome Glisse wrote: > > On Tue, Sep 10, 2019 at 07:49:51AM +, Mircea CIRJALIU - MELIU wrote: > >>> On 05/09/19 20:09, Jerome Glisse wrote: > Not sure i understand, you are saying that the solution i

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Paolo Bonzini
On 02/10/19 21:27, Jerome Glisse wrote: > On Tue, Sep 10, 2019 at 07:49:51AM +, Mircea CIRJALIU - MELIU wrote: >>> On 05/09/19 20:09, Jerome Glisse wrote: Not sure i understand, you are saying that the solution i outline above does not work ? If so then i think you are wrong, in the

Re: DANGER WILL ROBINSON, DANGER

2019-10-02 Thread Jerome Glisse
On Tue, Sep 10, 2019 at 07:49:51AM +, Mircea CIRJALIU - MELIU wrote: > > On 05/09/19 20:09, Jerome Glisse wrote: > > > Not sure i understand, you are saying that the solution i outline > > > above does not work ? If so then i think you are wrong, in the above > > > solution the importing

Re: DANGER WILL ROBINSON, DANGER

2019-09-09 Thread Paolo Bonzini
On 05/09/19 20:09, Jerome Glisse wrote: > Not sure i understand, you are saying that the solution i outline above > does not work ? If so then i think you are wrong, in the above solution > the importing process mmap a device file and the resulting vma is then > populated using insert_pfn() and

Re: DANGER WILL ROBINSON, DANGER

2019-09-05 Thread Jerome Glisse
On Fri, Aug 23, 2019 at 12:39:21PM +, Mircea CIRJALIU - MELIU wrote: > > On Thu, Aug 15, 2019 at 03:19:29PM -0400, Jerome Glisse wrote: > > > On Tue, Aug 13, 2019 at 02:01:35PM +0300, Adalbert Lazăr wrote: > > > > On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox > > wrote: > > > > > On Fri,

Re: DANGER WILL ROBINSON, DANGER

2019-08-16 Thread Jason Gunthorpe
On Thu, Aug 15, 2019 at 04:16:30PM -0400, Jerome Glisse wrote: > On Thu, Aug 15, 2019 at 03:19:29PM -0400, Jerome Glisse wrote: > > On Tue, Aug 13, 2019 at 02:01:35PM +0300, Adalbert Lazăr wrote: > > > On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox > > > wrote: > > > > On Fri, Aug 09, 2019 at

Re: DANGER WILL ROBINSON, DANGER

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 03:19:29PM -0400, Jerome Glisse wrote: > On Tue, Aug 13, 2019 at 02:01:35PM +0300, Adalbert Lazăr wrote: > > On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox > > wrote: > > > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > > > > +++

Re: DANGER WILL ROBINSON, DANGER

2019-08-15 Thread Jerome Glisse
On Tue, Aug 13, 2019 at 02:01:35PM +0300, Adalbert Lazăr wrote: > On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > > > +++ b/include/linux/page-flags.h > > > @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) > > > */

Re: DANGER WILL ROBINSON, DANGER

2019-08-13 Thread Paolo Bonzini
On 13/08/19 13:24, Matthew Wilcox wrote: >>> >>> This is an awfully big patch to the memory management code, buried in >>> the middle of a gigantic series which almost guarantees nobody would >>> look at it. I call shenanigans. >> Are you calling shenanigans on the patch submitter (which is

Re: DANGER WILL ROBINSON, DANGER

2019-08-13 Thread Matthew Wilcox
On Tue, Aug 13, 2019 at 11:29:07AM +0200, Paolo Bonzini wrote: > On 09/08/19 18:24, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > >> +++ b/include/linux/page-flags.h > >> @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) > >> */ > >> #define

Re: DANGER WILL ROBINSON, DANGER

2019-08-13 Thread Adalbert Lazăr
On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > > +++ b/include/linux/page-flags.h > > @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) > > */ > > #define PAGE_MAPPING_ANON 0x1 > > #define PAGE_MAPPING_MOVABLE

Re: DANGER WILL ROBINSON, DANGER

2019-08-13 Thread Paolo Bonzini
On 09/08/19 18:24, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: >> +++ b/include/linux/page-flags.h >> @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) >> */ >> #define PAGE_MAPPING_ANON 0x1 >> #define PAGE_MAPPING_MOVABLE0x2 >> +#define

DANGER WILL ROBINSON, DANGER

2019-08-09 Thread Matthew Wilcox
On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > +++ b/include/linux/page-flags.h > @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) > */ > #define PAGE_MAPPING_ANON0x1 > #define PAGE_MAPPING_MOVABLE 0x2 > +#define PAGE_MAPPING_REMOTE 0x4 Uh. How do you know