KVM: x86: Factor out x86 instruction emulation with decoding
authorWei Huang <wei.huang2@amd.com>
Tue, 26 Jan 2021 08:18:28 +0000 (03:18 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:34 +0000 (08:35 -0400)
commit47d4c799979996e512730de23a08c1d17dc373db
tree305e7f3963846430a3341b9b3926acd14c1cbcd1
parentff2fc9e4aaa6551f5b4a4ba0a3a7ea89771694ac
KVM: x86: Factor out x86 instruction emulation with decoding

[ Upstream commit 4aa2691dcbd38ce1c461188799d863398dd2865d ]

Move the instruction decode part out of x86_emulate_instruction() for it
to be used in other places. Also kvm_clear_exception_queue() is moved
inside the if-statement as it doesn't apply when KVM are coming back from
userspace.

Co-developed-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Message-Id: <20210126081831.570253-2-wei.huang2@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h