Re: [PATCH] x86/mm/pti: Handle unaligned addr to PMD-mapped page in pti_clone_pgtable

2019-09-23 Thread Linus Torvalds
On Mon, Sep 23, 2019 at 4:28 AM Peter Zijlstra wrote: > > I'm conflicted on this one... the only use of addr here is > pti_user_pagetable_walk_pmd() and that already masks things, so the > fixup is 'pointless'. No it's not. The *other* use of 'addr' is addr += PMD_SIZE; and then repeat

Re: [PATCH] x86/mm/pti: Handle unaligned addr to PMD-mapped page in pti_clone_pgtable

2019-09-23 Thread Peter Zijlstra
On Wed, Sep 18, 2019 at 10:53:12PM -0700, Song Liu wrote: > To clone page table of PMD-mapped pages, pti_clone_pgtable() requires PMD > aligned start address. [1] adds warning for unaligned addresses. However, > there is still no warning for unaligned address to valid huge pmd [2]. > > Add alignme

[PATCH] x86/mm/pti: Handle unaligned addr to PMD-mapped page in pti_clone_pgtable

2019-09-18 Thread Song Liu
To clone page table of PMD-mapped pages, pti_clone_pgtable() requires PMD aligned start address. [1] adds warning for unaligned addresses. However, there is still no warning for unaligned address to valid huge pmd [2]. Add alignment check in valid pmd_large() case. If the address is unaligned, rou