Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Joerg Roedel
On Fri, Aug 21, 2020 at 12:38:03PM +0100, Chris Wilson wrote: > In the version I tested, I also had > > @@ -2216,7 +2216,7 @@ static int apply_to_pte_range(struct mm_struct *mm, > pmd_t *pmd, > > if (create) { > pte = (mm == &init_mm) ? > - pte_alloc

Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Chris Wilson
Quoting Chris Wilson (2020-08-21 11:39:19) > Quoting Joerg Roedel (2020-08-21 11:23:43) > > On Fri, Aug 21, 2020 at 11:13:36AM +0100, Chris Wilson wrote: > > > We need to store the initial addr, as here addr == end [or earlier on > > > earlier], so range is (start, addr). > > > > Right, I missed t

Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Greg KH
On Fri, Aug 21, 2020 at 12:09:02PM +0200, Joerg Roedel wrote: > The __apply_to_page_range() function is also used to change and/or > allocate page-table pages in the vmalloc area of the address space. > Make sure these changes get synchronized to other page-tables in the > system by calling arch_sy

Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Chris Wilson
Quoting Joerg Roedel (2020-08-21 11:23:43) > On Fri, Aug 21, 2020 at 11:13:36AM +0100, Chris Wilson wrote: > > We need to store the initial addr, as here addr == end [or earlier on > > earlier], so range is (start, addr). > > Right, I missed that, thanks for pointing it out. And with that (start,

Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Joerg Roedel
On Fri, Aug 21, 2020 at 11:13:36AM +0100, Chris Wilson wrote: > We need to store the initial addr, as here addr == end [or earlier on > earlier], so range is (start, addr). Right, I missed that, thanks for pointing it out.

Re: [PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Chris Wilson
Quoting Joerg Roedel (2020-08-21 11:09:02) > @@ -2333,6 +2339,7 @@ static int __apply_to_page_range(struct mm_struct *mm, > unsigned long addr, > pgd_t *pgd; > unsigned long next; > unsigned long end = addr + size; > + pgtbl_mod_mask mask = 0; > int err = 0; >

[PATCH] mm: Track page table modifications in __apply_to_page_range() construction

2020-08-21 Thread Joerg Roedel
The __apply_to_page_range() function is also used to change and/or allocate page-table pages in the vmalloc area of the address space. Make sure these changes get synchronized to other page-tables in the system by calling arch_sync_kernel_mappings() when necessary. Signed-off-by: Joerg Roedel ---