u8 intercept;
        u8 op_bytes;
        u8 ad_bytes;
-       struct operand src;
-       struct operand src2;
-       struct operand dst;
        union {
                int (*execute)(struct x86_emulate_ctxt *ctxt);
                fastop_t fop;
        u8 seg_override;
        u64 d;
        unsigned long _eip;
+
+       /* Here begins the usercopy section. */
+       struct operand src;
+       struct operand src2;
+       struct operand dst;
        struct operand memop;
        /* Fields above regs are cleared together. */
        unsigned long _regs[NR_VCPU_REGS];
 
 
 static struct kmem_cache *kvm_alloc_emulator_cache(void)
 {
-       return kmem_cache_create_usercopy("x86_emulator",
-                                         sizeof(struct x86_emulate_ctxt),
+       unsigned int useroffset = offsetof(struct x86_emulate_ctxt, src);
+       unsigned int size = sizeof(struct x86_emulate_ctxt);
+
+       return kmem_cache_create_usercopy("x86_emulator", size,
                                          __alignof__(struct x86_emulate_ctxt),
-                                         SLAB_ACCOUNT,
-                                         0,
-                                         sizeof(struct x86_emulate_ctxt),
-                                         NULL);
+                                         SLAB_ACCOUNT, useroffset,
+                                         size - useroffset, NULL);
 }
 
 static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt);