KVM: x86: Add checks for reserved-to-zero Hyper-V hypercall fields
authorSean Christopherson <seanjc@google.com>
Tue, 7 Dec 2021 22:09:26 +0000 (22:09 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Feb 2022 18:50:36 +0000 (13:50 -0500)
commit413af6601f7613c07d8c36b57e184d7841ace43a
treea27a6aa6ca34038283ef8532b3def152cb9c8f15
parent40421f38f63764cd41b01c17e2a1fbbe08a1515a
KVM: x86: Add checks for reserved-to-zero Hyper-V hypercall fields

Add checks for the three fields in Hyper-V's hypercall params that must
be zero.  Per the TLFS, HV_STATUS_INVALID_HYPERCALL_INPUT is returned if
"A reserved bit in the specified hypercall input value is non-zero."

Note, some versions of the TLFS have an off-by-one bug for the last
reserved field, and define it as being bits 64:60.  See
https://github.com/MicrosoftDocs/Virtualization-Documentation/pull/1682.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20211207220926.718794-9-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/hyperv.c
include/asm-generic/hyperv-tlfs.h