aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/kvm/kvm_emulate.h
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-02-18 15:29:50 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-16 17:57:53 +0100
commit06add254c7f3b7f6fdfe04eb028aaabe5b27a734 (patch)
treef5ef8f264e875f296c534f56ca7793f8a1abfbe3 /arch/x86/kvm/kvm_emulate.h
parentKVM: x86: Move kvm_emulate.h into KVM's private directory (diff)
downloadwireguard-linux-06add254c7f3b7f6fdfe04eb028aaabe5b27a734.tar.xz
wireguard-linux-06add254c7f3b7f6fdfe04eb028aaabe5b27a734.zip
KVM: x86: Shrink the usercopy region of the emulation context
Shuffle a few operand structs to the end of struct x86_emulate_ctxt and update the cache creation to whitelist only the region of the emulation context that is expected to be copied to/from user memory, e.g. the instruction operands, registers, and fetch/io/mem caches. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/kvm_emulate.h')
-rw-r--r--arch/x86/kvm/kvm_emulate.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
index 3a66f80d7d00..f86fe6bf170d 100644
--- a/arch/x86/kvm/kvm_emulate.h
+++ b/arch/x86/kvm/kvm_emulate.h
@@ -334,9 +334,6 @@ struct x86_emulate_ctxt {
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;
@@ -364,6 +361,11 @@ struct x86_emulate_ctxt {
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];