KVM: PPC: Book3S PR: Disallow AIL != 0
authorNicholas Piggin <npiggin@gmail.com>
Tue, 22 Feb 2022 06:47:26 +0000 (16:47 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 8 Mar 2022 02:14:00 +0000 (13:14 +1100)
commit839d893b4067da14b9c46fda2dfd88b80aeed551
tree123d89cb4a0f94cc0c348d242d33095a413611f8
parentb5149e229218118c9cd44a4d256f970ddcbf745b
KVM: PPC: Book3S PR: Disallow AIL != 0

KVM PR does not implement address translation modes on interrupt, so it
must not allow H_SET_MODE to succeed. The behaviour change caused by
this mode is architected and not advisory (interrupts *must* behave
differently).

QEMU does not deal with differences in AIL support in the host. The
solution to that is a spapr capability and corresponding KVM CAP, but
this patch does not break things more than before (the host behaviour
already differs, this change just disallows some modes that are not
implemented properly).

By happy coincidence, this allows PR Linux guests that are using the SCV
facility to boot and run, because Linux disables the use of SCV if AIL
can not be set to 3. This does not fix the underlying problem of missing
SCV support (an OS could implement real-mode SCV vectors and try to
enable the facility). The true fix for that is for KVM PR to emulate scv
interrupts from the facility unavailable interrupt.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Link: https://lore.kernel.org/r/20220222064727.2314380-3-npiggin@gmail.com
arch/powerpc/kvm/book3s_pr_papr.c