While the original use of the address size file in the instruction info
provided was wrong, it still wants using: The offset into the designated
segment still may need truncating accordingly.

Fixes: 09fce8016596 ("Nested VMX: Emulation of guest VMXON/OFF instruction")
Signed-off-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -453,6 +453,13 @@ static int decode_vmx_inst(struct cpu_us
             size = 4 << mode_64bit;
 
         offset = base + index * scale + disp;
+        switch ( info.fields.addr_size )
+        {
+        case 0: offset = (uint16_t)offset; break;
+        case 1: offset = (uint32_t)offset; break;
+        default:                           break;
+        }
+
         base = !mode_64bit || info.fields.segment >= x86_seg_fs ?
                seg_base + offset : offset;
         if ( offset + size - 1 < offset ||


Reply via email to