]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: power/mm: update pte_write and pte_wrprotect to handle savedwrite
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 9 Mar 2017 21:00:44 +0000 (14:00 -0700)
committerTim Gardner <tim.gardner@canonical.com>
Fri, 10 Mar 2017 13:22:05 +0000 (06:22 -0700)
commit60913e0ee0f2114d7110e9f5b023fc14c386b08d
tree39f853e9d01d91be9e57569f0c37894e8b44bd64
parent0fbe0e69593dfdfb3e3e26e325612fb22e15e76d
UBUNTU: SAUCE: power/mm: update pte_write and pte_wrprotect to handle savedwrite

BugLink: http://bugs.launchpad.net/bugs/1671613
http://ozlabs.org/~akpm/mmots/broken-out/power-mm-update-pte_write-and-pte_wrprotect-to-handle-savedwrite.patch

We use pte_write() to check whethwer the pte entry is writable.  This is
mostly used to later mark the pte read only if it is writable.  The other
use of pte_write() is to check whether the pte_entry is writable so that
hardware page table entry can be marked accordingly.  This is used in kvm
where we look at qemu page table entry and update hardware hash page table
for the guest with correct write enable bit.

With the above, for the first usage we should also check the savedwrite
bit so that we can correctly clear the savedwite bit.  For the later, we
add a new variant __pte_write().

With this we can revert write_protect_page part of 595cd8f256d2 ("mm/ksm:
handle protnone saved writes when making page write protect").  But I left
it as it is as an example code for savedwrite check.

Fixes: c137a2757b886 ("powerpc/mm/autonuma: switch ppc64 to its own implementation of saved write")
Link: http://lkml.kernel.org/r/1488203787-17849-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/kvm/book3s_64_mmu_hv.c
arch/powerpc/kvm/book3s_hv_rm_mmu.c