linux-stable/arch/powerpc
Alexey Kardashevskiy 6c7d47c33e KVM: PPC: Book3S PR: Fix WIMG handling under pHyp
Commit 96df226 ("KVM: PPC: Book3S PR: Preserve storage control bits")
added code to preserve WIMG bits but it missed 2 special cases:
- a magic page in kvmppc_mmu_book3s_64_xlate() and
- guest real mode in kvmppc_handle_pagefault().

For these ptes, WIMG was 0 and pHyp failed on these causing a guest to
stop in the very beginning at NIP=0x100 (due to bd9166ffe "KVM: PPC:
Book3S PR: Exit KVM on failed mapping").

According to LoPAPR v1.1 14.5.4.1.2 H_ENTER:

 The hypervisor checks that the WIMG bits within the PTE are appropriate
 for the physical page number else H_Parameter return. (For System Memory
 pages WIMG=0010, or, 1110 if the SAO option is enabled, and for IO pages
 WIMG=01**.)

This hence initializes WIMG to non-zero value HPTE_R_M (0x10), as expected
by pHyp.

[paulus@ozlabs.org - fix compile for 32-bit]

Cc: stable@vger.kernel.org # v4.11+
Fixes: 96df226 "KVM: PPC: Book3S PR: Preserve storage control bits"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Ruediger Oertel <ro@suse.de>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2018-01-10 20:45:00 +11:00
..
boot powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
configs powerpc/configs: Enable I2C_CHARDEV for pseries and powernv 2017-10-22 12:08:31 +02:00
crypto License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include KVM: PPC: Book3S HV: Fix migration and HPT resizing of HPT guests on radix hosts 2017-11-23 14:17:54 +11:00
kernel First batch of KVM changes for 4.15 2017-11-16 13:00:24 -08:00
kvm KVM: PPC: Book3S PR: Fix WIMG handling under pHyp 2018-01-10 20:45:00 +11:00
lib powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
net powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
oprofile powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
perf powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
platforms powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
purgatory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysdev powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
tools License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xmon powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Kconfig powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Kconfig.debug powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Makefile Merge branch 'fixes' into next 2017-08-23 22:20:10 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00