]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Share emulator's common register decoding code
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Nov 2025 00:36:28 +0000 (19:36 -0500)
committerSean Christopherson <seanjc@google.com>
Wed, 19 Nov 2025 22:28:53 +0000 (14:28 -0800)
commit7e11eec989c840ff8cd11cee5005c7ce68ef1ab3
tree5cb0463536b7550e8674cfdcb47f90b471e60b99
parent1a84b07acaa45bb2e4a1d09be26b0ba6270929c3
KVM: x86: Share emulator's common register decoding code

Remove all duplicate handling of register operands, including picking
the right register class and fetching it, by extracting a new function
that can be used for both REG and MODRM operands.

Centralize setting op->orig_val = op->val in fetch_register_operand()
as well.

No functional change intended.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Chang S. Bae <chang.seok.bae@intel.com>
Link: https://patch.msgid.link/20251114003633.60689-6-pbonzini@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/emulate.c