linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] KVM: cpuid: fix KVM_GET_EMULATED_CPUID implementation
@ 2021-04-06  8:26 Emanuele Giuseppe Esposito
  2021-04-06  8:26 ` [PATCH v3 1/4] KVM: x86: Fix a spurious -E2BIG in KVM_GET_EMULATED_CPUID Emanuele Giuseppe Esposito
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Emanuele Giuseppe Esposito @ 2021-04-06  8:26 UTC (permalink / raw)
  To: kvm
  Cc: Paolo Bonzini, Jonathan Corbet, Sean Christopherson,
	Vitaly Kuznetsov, Emanuele Giuseppe Esposito, Jim Mattson,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, Shuah Khan,
	Alexander Graf, Andrew Jones, linux-doc, linux-kernel,
	linux-kselftest

This series aims to clarify the behavior of the KVM_GET_EMULATED_CPUID
ioctl, and fix a corner case where -E2BIG is returned when
the nent field of struct kvm_cpuid2 is matching the amount of
emulated entries that kvm returns.

Patch 1 proposes the nent field fix to cpuid.c,
patch 2 updates the ioctl documentation accordingly and
patches 3 and 4 extend the x86_64/get_cpuid_test.c selftest to check
the intended behavior of KVM_GET_EMULATED_CPUID.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
v3:
- clearer commit message and problem explanation 
- pre-initialize the stack variable 'entry' in __do_cpuid_func_emulated
so that the various eax/ebx/ecx are initialized if not set by func.


Emanuele Giuseppe Esposito (4):
  KVM: x86: Fix a spurious -E2BIG in KVM_GET_EMULATED_CPUID
  Documentation: KVM: update KVM_GET_EMULATED_CPUID ioctl description
  selftests: add kvm_get_emulated_cpuid to processor.h
  selftests: KVM: extend get_cpuid_test to include
    KVM_GET_EMULATED_CPUID

 Documentation/virt/kvm/api.rst                | 10 +--
 arch/x86/kvm/cpuid.c                          | 33 ++++---
 .../selftests/kvm/include/x86_64/processor.h  |  1 +
 .../selftests/kvm/lib/x86_64/processor.c      | 33 +++++++
 .../selftests/kvm/x86_64/get_cpuid_test.c     | 90 ++++++++++++++++++-
 5 files changed, 142 insertions(+), 25 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-06 16:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06  8:26 [PATCH v3 0/4] KVM: cpuid: fix KVM_GET_EMULATED_CPUID implementation Emanuele Giuseppe Esposito
2021-04-06  8:26 ` [PATCH v3 1/4] KVM: x86: Fix a spurious -E2BIG in KVM_GET_EMULATED_CPUID Emanuele Giuseppe Esposito
2021-04-06 14:21   ` Vitaly Kuznetsov
2021-04-06 16:09     ` Sean Christopherson
2021-04-06 16:07   ` Sean Christopherson
2021-04-06  8:26 ` [PATCH v3 2/4] Documentation: KVM: update KVM_GET_EMULATED_CPUID ioctl description Emanuele Giuseppe Esposito
2021-04-06  8:26 ` [PATCH v3 3/4] selftests: add kvm_get_emulated_cpuid to processor.h Emanuele Giuseppe Esposito
2021-04-06  8:26 ` [PATCH v3 4/4] selftests: KVM: extend get_cpuid_test to include KVM_GET_EMULATED_CPUID Emanuele Giuseppe Esposito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).