mbox series

[v5,0/4] KVM: cpuid: fix KVM_GET_EMULATED_CPUID implementation

Message ID 20210409125423.26288-1-eesposit@redhat.com
Headers show
Series KVM: cpuid: fix KVM_GET_EMULATED_CPUID implementation | expand

Message

Emanuele Giuseppe Esposito April 9, 2021, 12:54 p.m. UTC
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>
---
v5:
- Better comment in cpuid.c (patch 1)

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(-)

Comments

Borislav Petkov April 9, 2021, 1:03 p.m. UTC | #1
On Fri, Apr 09, 2021 at 02:54:19PM +0200, Emanuele Giuseppe Esposito wrote:
> 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>
> ---
> v5:
> - Better comment in cpuid.c (patch 1)

How about you wait a couple of days so people have a chance to look at
your patches instead of sending a new revision every day?

Thx.