KVM: x86: hyper-v: Add extended hypercall support in Hyper-v
authorVipin Sharma <vipinsh@google.com>
Mon, 12 Dec 2022 18:37:16 +0000 (10:37 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 1 Feb 2023 21:46:00 +0000 (13:46 -0800)
commitdb9cf24cea69773410f0049bdfa795d7c2bd0ea9
tree9d836878a287a087e234eed96ad3da047dc96212
parent1a9df3262a632020071327abf56e9243e4dd7bde
KVM: x86: hyper-v: Add extended hypercall support in Hyper-v

Add support for extended hypercall in Hyper-v. Hyper-v TLFS 6.0b
describes hypercalls above call code 0x8000 as extended hypercalls.

A Hyper-v hypervisor's guest VM finds availability of extended
hypercalls via CPUID.0x40000003.EBX BIT(20). If the bit is set then the
guest can call extended hypercalls.

All extended hypercalls will exit to userspace by default. This allows
for easy support of future hypercalls without being dependent on KVM
releases.

If there will be need to process the hypercall in KVM instead of
userspace then KVM can create a capability which userspace can query to
know which hypercalls can be handled by the KVM and enable handling
of those hypercalls.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20221212183720.4062037-10-vipinsh@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/hyperv.c