aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-11-22 10:53:22 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:29:54 -0500
commitbcc55cba9f1fcda68412c8c3d8579c56d90b16f2 (patch)
tree1f4c45ad993e66effaaf2aa0bc7d2ebade6c41d0 /arch/x86/include/asm
parentda9cb575b1127f84984b8ad6d973dcc05ac036dd (diff)
KVM: x86 emulator: make emulator memory callbacks return full exception
This way, they can return #GP, not just #PF. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index b7c11270ae8..87d017e276f 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -70,7 +70,8 @@ struct x86_emulate_ops {
70 * @bytes: [IN ] Number of bytes to read from memory. 70 * @bytes: [IN ] Number of bytes to read from memory.
71 */ 71 */
72 int (*read_std)(unsigned long addr, void *val, 72 int (*read_std)(unsigned long addr, void *val,
73 unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); 73 unsigned int bytes, struct kvm_vcpu *vcpu,
74 struct x86_exception *fault);
74 75
75 /* 76 /*
76 * write_std: Write bytes of standard (non-emulated/special) memory. 77 * write_std: Write bytes of standard (non-emulated/special) memory.
@@ -80,7 +81,8 @@ struct x86_emulate_ops {
80 * @bytes: [IN ] Number of bytes to write to memory. 81 * @bytes: [IN ] Number of bytes to write to memory.
81 */ 82 */
82 int (*write_std)(unsigned long addr, void *val, 83 int (*write_std)(unsigned long addr, void *val,
83 unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); 84 unsigned int bytes, struct kvm_vcpu *vcpu,
85 struct x86_exception *fault);
84 /* 86 /*
85 * fetch: Read bytes of standard (non-emulated/special) memory. 87 * fetch: Read bytes of standard (non-emulated/special) memory.
86 * Used for instruction fetch. 88 * Used for instruction fetch.
@@ -89,7 +91,8 @@ struct x86_emulate_ops {
89 * @bytes: [IN ] Number of bytes to read from memory. 91 * @bytes: [IN ] Number of bytes to read from memory.
90 */ 92 */
91 int (*fetch)(unsigned long addr, void *val, 93 int (*fetch)(unsigned long addr, void *val,
92 unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); 94 unsigned int bytes, struct kvm_vcpu *vcpu,
95 struct x86_exception *fault);
93 96
94 /* 97 /*
95 * read_emulated: Read bytes from emulated/special memory area. 98 * read_emulated: Read bytes from emulated/special memory area.
@@ -100,7 +103,7 @@ struct x86_emulate_ops {
100 int (*read_emulated)(unsigned long addr, 103 int (*read_emulated)(unsigned long addr,
101 void *val, 104 void *val,
102 unsigned int bytes, 105 unsigned int bytes,
103 unsigned int *error, 106 struct x86_exception *fault,
104 struct kvm_vcpu *vcpu); 107 struct kvm_vcpu *vcpu);
105 108
106 /* 109 /*
@@ -113,7 +116,7 @@ struct x86_emulate_ops {
113 int (*write_emulated)(unsigned long addr, 116 int (*write_emulated)(unsigned long addr,
114 const void *val, 117 const void *val,
115 unsigned int bytes, 118 unsigned int bytes,
116 unsigned int *error, 119 struct x86_exception *fault,
117 struct kvm_vcpu *vcpu); 120 struct kvm_vcpu *vcpu);
118 121
119 /* 122 /*
@@ -128,7 +131,7 @@ struct x86_emulate_ops {
128 const void *old, 131 const void *old,
129 const void *new, 132 const void *new,
130 unsigned int bytes, 133 unsigned int bytes,
131 unsigned int *error, 134 struct x86_exception *fault,
132 struct kvm_vcpu *vcpu); 135 struct kvm_vcpu *vcpu);
133 136
134 int (*pio_in_emulated)(int size, unsigned short port, void *val, 137 int (*pio_in_emulated)(int size, unsigned short port, void *val,