Skip to content

Commit 127770a

Browse files
suomilewisbonzini
authored andcommitted
KVM: x86: Add KVM_CAP_ENABLE_CAP to x86
Follow the precedent set by other architectures that support the VCPU ioctl, KVM_ENABLE_CAP, and advertise the VM extension, KVM_CAP_ENABLE_CAP. This way, userspace can ensure that KVM_ENABLE_CAP is available on a vcpu before using it. Fixes: 5c91941 ("kvm/x86: Hyper-V synthetic interrupt controller") Signed-off-by: Aaron Lewis <aaronlewis@google.com> Message-Id: <20220214212950.1776943-1-aaronlewis@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 710c476 commit 127770a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Documentation/virt/kvm/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ documentation when it pops into existence).
13941394
-------------------
13951395

13961396
:Capability: KVM_CAP_ENABLE_CAP
1397-
:Architectures: mips, ppc, s390
1397+
:Architectures: mips, ppc, s390, x86
13981398
:Type: vcpu ioctl
13991399
:Parameters: struct kvm_enable_cap (in)
14001400
:Returns: 0 on success; -1 on error

arch/x86/kvm/x86.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4233,6 +4233,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
42334233
case KVM_CAP_EXIT_ON_EMULATION_FAILURE:
42344234
case KVM_CAP_VCPU_ATTRIBUTES:
42354235
case KVM_CAP_SYS_ATTRIBUTES:
4236+
case KVM_CAP_ENABLE_CAP:
42364237
r = 1;
42374238
break;
42384239
case KVM_CAP_EXIT_HYPERCALL:

0 commit comments

Comments
 (0)