]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Move INVPCID type check from vmx and svm to the common kvm_handle_invpcid()
authorVipin Sharma <vipinsh@google.com>
Tue, 9 Nov 2021 17:44:26 +0000 (17:44 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Nov 2021 15:56:24 +0000 (10:56 -0500)
commit27680e0013c2767c7d14f89c064ecaea04a10cd5
tree56a62e0d5e797ade310b3e1c211f2d494fba931d
parent7da45a1c92c83b4c19f50cb4a01047cc5271f761
KVM: Move INVPCID type check from vmx and svm to the common kvm_handle_invpcid()

Handle #GP on INVPCID due to an invalid type in the common switch
statement instead of relying on the callers (VMX and SVM) to manually
validate the type.

Unlike INVVPID and INVEPT, INVPCID is not explicitly documented to check
the type before reading the operand from memory, so deferring the
type validity check until after that point is architecturally allowed.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211109174426.2350547-3-vipinsh@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c