powerpc/pseries: Add KVM guest doorbell restrictions
authorNicholas Piggin <npiggin@gmail.com>
Sun, 26 Jul 2020 03:51:55 +0000 (13:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 11:02:10 +0000 (21:02 +1000)
commit107c55005fbd5243ee31fb13b6f166cde9e3ade1
tree568f339e22efacf3f857e8ed04e926e9a97f2bf5
parent5b06d1679f2fe874ef49ea11324cd893ec9e2da8
powerpc/pseries: Add KVM guest doorbell restrictions

KVM guests have certain restrictions and performance quirks when using
doorbells. This patch moves the EPAPR KVM guest test so it can be shared
with PSERIES, and uses that in doorbell setup code to apply the KVM
guest quirks and  improves IPI performance for two cases:

 - PowerVM guests may now use doorbells even if they are secure.

 - KVM guests no longer use doorbells if XIVE is available.

There is a valid complaint that "KVM guest" is not a very reasonable
thing to test for, it's preferable for the hypervisor to advertise
particular behaviours to the guest so they could change if the
hypervisor implementation or configuration changes. However in this case
we were already assuming a KVM guest worst case, so this patch is about
containing those quirks. If KVM later advertises fast doorbells, we
should test for that and override the quirks.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200726035155.1424103-4-npiggin@gmail.com
arch/powerpc/include/asm/firmware.h
arch/powerpc/include/asm/kvm_para.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/firmware.c
arch/powerpc/platforms/pseries/smp.c