]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86: Plumb the src/dst operand types through to .check_intercept()
authorSean Christopherson <seanjc@google.com>
Sat, 1 Feb 2025 01:55:13 +0000 (17:55 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 24 Feb 2025 17:01:07 +0000 (09:01 -0800)
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>
arch/x86/kvm/emulate.c
arch/x86/kvm/kvm_emulate.h

index 0915b5e8aa71779dd70fe32316d4f90d4e6090fc..ca613796b5afe9eb30f484af41f687e52a1a2fed 100644 (file)
@@ -477,6 +477,8 @@ static int emulator_check_intercept(struct x86_emulate_ctxt *ctxt,
                .dst_val    = ctxt->dst.val64,
                .src_bytes  = ctxt->src.bytes,
                .dst_bytes  = ctxt->dst.bytes,
+               .src_type   = ctxt->src.type,
+               .dst_type   = ctxt->dst.type,
                .ad_bytes   = ctxt->ad_bytes,
                .next_rip   = ctxt->_eip,
        };
index 73072585e1642c344bc32952294efbfab46a78b1..49ab8b060137a715886f064c548ee353b67ca8d2 100644 (file)
@@ -44,6 +44,8 @@ struct x86_instruction_info {
        u64 dst_val;            /* value of destination operand         */
        u8  src_bytes;          /* size of source operand               */
        u8  dst_bytes;          /* size of destination operand          */
+       u8  src_type;           /* type of source operand               */
+       u8  dst_type;           /* type of destination operand          */
        u8  ad_bytes;           /* size of src/dst address              */
        u64 next_rip;           /* rip following the instruction        */
 };