1
0
Fork 0
alistair23-linux/arch
Paul Mackerras ded13fc11b KVM: PPC: Book3S HV: Fix migration and HPT resizing of HPT guests on radix hosts
This fixes two errors that prevent a guest using the HPT MMU from
successfully migrating to a POWER9 host in radix MMU mode, or resizing
its HPT when running on a radix host.

The first bug was that commit 8dc6cca556 ("KVM: PPC: Book3S HV:
Don't rely on host's page size information", 2017-09-11) missed two
uses of hpte_base_page_size(), one in the HPT rehashing code and
one in kvm_htab_write() (which is used on the destination side in
migrating a HPT guest).  Instead we use kvmppc_hpte_base_page_shift().
Having the shift count means that we can use left and right shifts
instead of multiplication and division in a few places.

Along the way, this adds a check in kvm_htab_write() to ensure that the
page size encoding in the incoming HPTEs is recognized, and if not
return an EINVAL error to userspace.

The second bug was that kvm_htab_write was performing some but not all
of the functions of kvmhv_setup_mmu(), resulting in the destination VM
being left in radix mode as far as the hardware is concerned.  The
simplest fix for now is make kvm_htab_write() call
kvmppc_setup_partition_table() like kvmppc_hv_setup_htab_rma() does.
In future it would be better to refactor the code more extensively
to remove the duplication.

Fixes: 8dc6cca556 ("KVM: PPC: Book3S HV: Don't rely on host's page size information")
Fixes: 7a84084c60 ("KVM: PPC: Book3S HV: Set partition table rather than SDR1 on POWER9")
Reported-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Tested-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2017-11-23 14:17:54 +11:00
..
alpha pci-v4.15-changes 2017-11-15 15:01:28 -08:00
arc Merge branch 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-11-15 10:14:11 -08:00
arm ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
arm64 ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
blackfin This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08:00
c6x DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
cris pci-v4.15-changes 2017-11-15 15:01:28 -08:00
frv Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
h8300 mm, arch: remove empty_bad_page* 2017-11-15 18:21:03 -08:00
hexagon A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
ia64 pci-v4.15-changes 2017-11-15 15:01:28 -08:00
m32r m32r: fix endianness constraints 2017-11-15 18:21:00 -08:00
m68k A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
metag DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
microblaze DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
mips AFS development 2017-11-16 11:41:22 -08:00
mn10300 Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
nios2 DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
openrisc kmemcheck: remove annotations 2017-11-15 18:21:04 -08:00
parisc pci-v4.15-changes 2017-11-15 15:01:28 -08:00
powerpc KVM: PPC: Book3S HV: Fix migration and HPT resizing of HPT guests on radix hosts 2017-11-23 14:17:54 +11:00
riscv RISC-V Port for Linux 4.15 v9 2017-11-15 10:49:15 -08:00
s390 First batch of KVM changes for 4.15 2017-11-16 13:00:24 -08:00
score License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
sh Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
sparc Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
tile mm: remove cold parameter from free_hot_cold_page* 2017-11-15 18:21:06 -08:00
um Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
unicore32 kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2017-11-15 18:21:04 -08:00
x86 xen: features and fixes for v4.15-rc1 2017-11-16 13:06:27 -08:00
xtensa pci-v4.15-changes 2017-11-15 15:01:28 -08:00
.gitignore
Kconfig bpf: Revert bpf_overrid_function() helper changes. 2017-11-11 18:24:55 +09:00