]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Get the number of Hyper-V sparse banks from the VARHEAD field
authorSean Christopherson <seanjc@google.com>
Tue, 7 Dec 2021 22:09:20 +0000 (22:09 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Feb 2022 18:50:33 +0000 (13:50 -0500)
commit60441209bbbbaa29c994a66e30f9a3f16bcea2f8
tree8a6d4f7347bd18c6ec387ed03830577fade53484
parent97bab6a3e55e3a22d46510b563bce283e3d8fc6c
KVM: x86: Get the number of Hyper-V sparse banks from the VARHEAD field

Get the number of sparse banks from the VARHEAD field, which the guest is
required to provide as "The size of a variable header, in QWORDS.", where
the variable header is:

  Variable Header Bytes = {Total Header Bytes - sizeof(Fixed Header)}
                          rounded up to nearest multiple of 8
  Variable HeaderSize = Variable Header Bytes / 8

In other words, the VARHEAD should match the number of sparse banks.
Keep the manual count as a sanity check, but otherwise rely on the field
so as to more closely align with the logic defined in the TLFS and to
allow for future cleanups.

Tweak the tracepoint output to use "rep_cnt" instead of simply "cnt" now
that there is also "var_cnt".

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