Skip to content

Commit 407d03f

Browse files
committed
KVM: x86: Plumb the src/dst operand types through to .check_intercept()
When checking for intercept when emulating an instruction on behalf of L2, forward the source and destination operand types to vendor code so that VMX can synthesize the correct EXIT_QUALIFICATION for port I/O VM-Exits. Link: https://lore.kernel.org/r/20250201015518.689704-7-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 08e3d89 commit 407d03f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/x86/kvm/emulate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ static int emulator_check_intercept(struct x86_emulate_ctxt *ctxt,
477477
.dst_val = ctxt->dst.val64,
478478
.src_bytes = ctxt->src.bytes,
479479
.dst_bytes = ctxt->dst.bytes,
480+
.src_type = ctxt->src.type,
481+
.dst_type = ctxt->dst.type,
480482
.ad_bytes = ctxt->ad_bytes,
481483
.next_rip = ctxt->_eip,
482484
};

arch/x86/kvm/kvm_emulate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ struct x86_instruction_info {
4444
u64 dst_val; /* value of destination operand */
4545
u8 src_bytes; /* size of source operand */
4646
u8 dst_bytes; /* size of destination operand */
47+
u8 src_type; /* type of source operand */
48+
u8 dst_type; /* type of destination operand */
4749
u8 ad_bytes; /* size of src/dst address */
4850
u64 next_rip; /* rip following the instruction */
4951
};

0 commit comments

Comments
 (0)