KVM: x86: Use emulator callbacks instead of duplicating "host flags"
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 29 Nov 2022 19:37:11 +0000 (21:37 +0200)
committerSean Christopherson <seanjc@google.com>
Wed, 1 Feb 2023 01:29:09 +0000 (17:29 -0800)
commit32e69f232db4ca11f26e5961daeff93906ce232f
tree87242fe5c003a90cba2906207ff9d339365ec0e1
parent916b54a7688b0b9a1c48c708b848e4348c3ae2ab
KVM: x86: Use emulator callbacks instead of duplicating "host flags"

Instead of re-defining the "host flags" bits, just expose dedicated
helpers for each of the two remaining flags that are consumed by the
emulator.  The emulator never consumes both "is guest" and "is SMM" in
close proximity, so there is no motivation to avoid additional indirect
branches.

Also while at it, garbage collect the recently removed host flags.

No functional change is intended.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Tested-by: Santosh Shukla <Santosh.Shukla@amd.com>
Link: https://lore.kernel.org/r/20221129193717.513824-6-mlevitsk@redhat.com
[sean: fix CONFIG_KVM_SMM=n builds, tweak names of wrappers]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/kvm_emulate.h
arch/x86/kvm/smm.c
arch/x86/kvm/x86.c