This patch series adds Hyper-V extended hypercall support. All hypercalls will exit to userspace if CPUID.0x40000003.EBX BIT(20) is set. Patch 4 and 5 are prep patches, they move some code to hyperv.h later used by newly introduced test hyperv_extended_hcalls in Patch 6. RFC: https://lore.kernel.org/lkml/20221021185916.1494314-1-vipinsh@xxxxxxxxxx/ Vipin Sharma (6): KVM: x86: hyper-v: Use common code for hypercall userspace exit KVM: x86: hyper-v: Add extended hypercall support in Hyper-v KVM: selftests: Test Hyper-V extended hypercall enablement KVM: selftests: Make Hyper-V guest OS ID common KVM: selftests: Move hypercall() to hyper.h KVM: selftests: Test Hyper-V extended hypercall exit to userspace arch/x86/kvm/hyperv.c | 43 +++++---- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/include/x86_64/hyperv.h | 31 +++++++ .../selftests/kvm/x86_64/hyperv_clock.c | 2 +- .../kvm/x86_64/hyperv_extended_hcalls.c | 90 +++++++++++++++++++ .../selftests/kvm/x86_64/hyperv_features.c | 32 +++---- .../selftests/kvm/x86_64/hyperv_svm_test.c | 2 +- 8 files changed, 163 insertions(+), 39 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86_64/hyperv_extended_hcalls.c -- 2.38.1.273.g43a17bfeac-goog