]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/mm/radix: Split linear mapping on hot-unplug
authorBalbir Singh <bsingharora@gmail.com>
Wed, 7 Feb 2018 06:35:51 +0000 (17:35 +1100)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 23 Feb 2018 14:26:48 +0000 (08:26 -0600)
commit68eafd1316a901b1a6d5a9f6d3e249b63e7649ba
tree383bf2bf727dc42857889b012ad6b227ed3a26ae
parent66f9c9aa3508479a38df25cbf697ee561909b846
powerpc/mm/radix: Split linear mapping on hot-unplug

BugLink: http://bugs.launchpad.net/bugs/1751131
commit 4dd5f8a99e791a8c6500e3592f3ce81ae7edcde1 upstream.

This patch splits the linear mapping if the hot-unplug range is
smaller than the mapping size. The code detects if the mapping needs
to be split into a smaller size and if so, uses the stop machine
infrastructure to clear the existing mapping and then remap the
remaining range using a smaller page size.

The code will skip any region of the mapping that overlaps with kernel
text and warn about it once. We don't want to remove a mapping where
the kernel text and the LMB we intend to remove overlap in the same
TLB mapping as it may affect the currently executing code.

I've tested these changes under a kvm guest with 2 vcpus, from a split
mapping point of view, some of the caveats mentioned above applied to
the testing I did.

Fixes: 4b5d62ca17a1 ("powerpc/mm: add radix__remove_section_mapping()")
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Tweak change log to match updated behaviour]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/mm/pgtable-radix.c