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)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Dec 2020 14:01:22 +0000 (01:01 +1100)
commita21d1becaa3f17a97b933ffa677b526afc514ec5
treede21858ceb451f68dfc3a3120f7ab8fa862d1585
parent16520a858a995742c2d2248e86a6026bd0316562
powerpc: Reintroduce is_kvm_guest() as a fast-path check

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
arch/powerpc/include/asm/kvm_guest.h
arch/powerpc/include/asm/kvm_para.h
arch/powerpc/kernel/firmware.c