]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2
authorOliver Upton <oupton@google.com>
Tue, 1 Mar 2022 06:03:47 +0000 (06:03 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Mar 2022 13:28:41 +0000 (09:28 -0400)
commit667d715e5fcd7bcdfe0a6c86c81daff27dfa6350
treeb5ff91162ae5eb371f8a4c94d9916ba2bf799684
parent69a193702d5bbe23e8fc81fae3fe07e3e240f00f
KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2

KVM_CAP_DISABLE_QUIRKS is irrevocably broken. The capability does not
advertise the set of quirks which may be disabled to userspace, so it is
impossible to predict the behavior of KVM. Worse yet,
KVM_CAP_DISABLE_QUIRKS will tolerate any value for cap->args[0], meaning
it fails to reject attempts to set invalid quirk bits.

The only valid workaround for the quirky quirks API is to add a new CAP.
Actually advertise the set of quirks that can be disabled to userspace
so it can predict KVM's behavior. Reject values for cap->args[0] that
contain invalid bits.

Finally, add documentation for the new capability and describe the
existing quirks.

Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20220301060351.442881-5-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/api.rst
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
include/uapi/linux/kvm.h