diff options
| author | Yosry Ahmed <yosry@kernel.org> | 2026-03-16 20:27:25 +0000 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-04-03 16:08:01 -0700 |
| commit | 27f70eaa8661c031f6c5efa4d72c7c4544cc41fc (patch) | |
| tree | d6aef390ca010986188d579a0cc630c99d81e13d /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | c85aaff26d55920d783adac431a59ec738a35aef (diff) | |
KVM: SVM: Refactor SVM instruction handling on #GP intercept
Instead of returning an opcode from svm_instr_opcode() and then passing
it to emulate_svm_instr(), which uses it to find the corresponding exit
code and intercept handler, return the exit code directly from
svm_instr_opcode(), and rename it to svm_get_decoded_instr_exit_code().
emulate_svm_instr() boils down to synthesizing a #VMEXIT or calling the
intercept handler, so open-code it in gp_interception(), and use
svm_invoke_exit_handler() to call the intercept handler based on
the exit code. This allows for dropping the SVM_INSTR_* enum, and the
const array mapping its values to exit codes and intercept handlers.
In gp_intercept(), handle SVM instructions and first with an early return,
and invert is_guest_mode() checks, un-indenting the rest of the code.
No functional change intended.
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260316202732.3164936-3-yosry@kernel.org
[sean: add BUILD_BUG_ON(), tweak formatting/naming]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
