powerpc/pseries/svm: Unshare all pages before kexecing a new kernel
authorRam Pai <linuxram@us.ibm.com>
Tue, 20 Aug 2019 02:13:20 +0000 (23:13 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 29 Aug 2019 23:55:40 +0000 (09:55 +1000)
commit256ba2c1689efd4f5383cf7ebe2f9970c198b79d
tree94a258b3beaf19687b753886117c659ed5cd333f
parentd5394c059da9786043934bed474562cde124e7d3
powerpc/pseries/svm: Unshare all pages before kexecing a new kernel

A new kernel deserves a clean slate. Any pages shared with the hypervisor
is unshared before invoking the new kernel. However there are exceptions.
If the new kernel is invoked to dump the current kernel, or if there is a
explicit request to preserve the state of the current kernel, unsharing
of pages is skipped.

NOTE: While testing crashkernel, make sure at least 256M is reserved for
crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will
fail to boot.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820021326.6884-11-bauerman@linux.ibm.com
arch/powerpc/include/asm/ultravisor-api.h
arch/powerpc/include/asm/ultravisor.h
arch/powerpc/kernel/machine_kexec_64.c