Re: [Xen-devel] [PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-07 Thread Boris Ostrovsky
On 03/07/2017 01:26 PM, Andrew Cooper wrote: > On 07/03/17 18:18, Boris Ostrovsky wrote: Don't we need to pass vaddr down to all routines so that they select appropriate tables? You seem to always be choosing the first one. >>> IIUC, we clear whole page table subtree covered by one pgd en

Re: [Xen-devel] [PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-07 Thread Andrew Cooper
On 07/03/17 18:18, Boris Ostrovsky wrote: >>> Don't we need to pass vaddr down to all routines so that they select >>> appropriate tables? You seem to always be choosing the first one. >> IIUC, we clear whole page table subtree covered by one pgd entry. >> So, no, there's no need to pass vaddr down

Re: [PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-07 Thread Boris Ostrovsky
>> Don't we need to pass vaddr down to all routines so that they select >> appropriate tables? You seem to always be choosing the first one. > IIUC, we clear whole page table subtree covered by one pgd entry. > So, no, there's no need to pass vaddr down. Just pointer to page table > entry is enoug

Re: [PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-07 Thread Kirill A. Shutemov
On Mon, Mar 06, 2017 at 03:48:24PM -0500, Boris Ostrovsky wrote: > > > +static int xen_p4d_walk(struct mm_struct *mm, p4d_t *p4d, > > + int (*func)(struct mm_struct *mm, struct page *, enum pt_level), > > + bool last, unsigned long limit) > > +{ > > + int i, nr, flush = 0; >

Re: [PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-06 Thread Boris Ostrovsky
> +static int xen_p4d_walk(struct mm_struct *mm, p4d_t *p4d, > + int (*func)(struct mm_struct *mm, struct page *, enum pt_level), > + bool last, unsigned long limit) > +{ > + int i, nr, flush = 0; > + > + nr = last ? p4d_index(limit) + 1 : PTRS_PER_P4D; > + for

[PATCHv4 18/33] x86/xen: convert __xen_pgd_walk() and xen_cleanmfnmap() to support p4d

2017-03-06 Thread Kirill A. Shutemov
Split these helpers few per-level functions and add p4d support. Signed-off-by: Xiong Zhang [kirill.shute...@linux.intel.com: split off into separate patch] Signed-off-by: Kirill A. Shutemov --- arch/x86/xen/mmu.c | 243 - arch/x86/xen/mmu.h |