summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sgx
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-14 20:06:42 +0000
committerSean Christopherson <seanjc@google.com>2022-07-13 18:14:14 -0700
commitfc66963d7b01e00ef0482bd7adbc8918343f81d9 (patch)
tree0242574cf8b2c255638aab738b1d5d201bacd6b6 /tools/testing/selftests/sgx
parent71bcb951c68b422ca65f55dc7ae7be01735ae48e (diff)
KVM: selftests: Split out kvm_cpuid2_size() from allocate_kvm_cpuid2()
Split out the computation of the effective size of a kvm_cpuid2 struct from allocate_kvm_cpuid2(), and modify both to take an arbitrary number of entries. Future commits will add caching of a vCPU's CPUID model, and will (a) be able to precisely size the entries array, and (b) will need to know the effective size of the struct in order to copy to/from the cache. Expose the helpers so that the Hyper-V Features test can use them in the (somewhat distant) future. The Hyper-V test very, very subtly relies on propagating CPUID info across vCPU instances, and will need to make a copy of the previous vCPU's CPUID information when it switches to using the per-vCPU cache. Alternatively, KVM could provide helpers to duplicate and/or copy a kvm_cpuid2 instance, but each is literally a single line of code if the helpers are exposed, and it's not like the size of kvm_cpuid2 is secret knowledge. Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220614200707.3315957-18-seanjc@google.com
Diffstat (limited to 'tools/testing/selftests/sgx')
0 files changed, 0 insertions, 0 deletions