powerpc: Reintroduce is_kvm_guest() as a fast-path check
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Wed, 2 Dec 2020 05:04:55 +0000 (10:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:17 +0000 (14:04 +0100)
commite01a4d7560b64791c350cd531b84a6a53ba6325b
treee2991c0e17be08cce9875192b67276980810fc01
parent113207234aac0da666ef857c96de6f91d25d443c
powerpc: Reintroduce is_kvm_guest() as a fast-path check

[ Upstream commit a21d1becaa3f17a97b933ffa677b526afc514ec5 ]

Introduce a static branch that would be set during boot if the OS
happens to be a KVM guest. Subsequent checks to see if we are on KVM
will rely on this static branch. This static branch would be used in
vcpu_is_preempted() in a subsequent patch.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201202050456.164005-4-srikar@linux.vnet.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/include/asm/kvm_guest.h
arch/powerpc/include/asm/kvm_para.h
arch/powerpc/kernel/firmware.c