diff options
author | Avi Kivity <avi@redhat.com> | 2010-11-17 08:28:21 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:29:35 -0500 |
commit | 90de84f50b425805bf7ddc430143ed2e224ebd8e (patch) | |
tree | 259b70846fc9972c77e60c85e0afe172b4d87d7d /arch/x86/include/asm/kvm_emulate.h | |
parent | d53db5efc2f6026f7cb0871c91b887ed55e0f265 (diff) |
KVM: x86 emulator: preserve an operand's segment identity
Currently the x86 emulator converts the segment register associated with
an operand into a segment base which is added into the operand address.
This loss of information results in us not doing segment limit checks properly.
Replace struct operand's addr.mem field by a segmented_address structure
which holds both the effetive address and segment. This will allow us to
do the limit check at the point of access.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index b36c6b3fe144..b48c133c95ab 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -159,7 +159,10 @@ struct operand { | |||
159 | }; | 159 | }; |
160 | union { | 160 | union { |
161 | unsigned long *reg; | 161 | unsigned long *reg; |
162 | unsigned long mem; | 162 | struct segmented_address { |
163 | ulong ea; | ||
164 | unsigned seg; | ||
165 | } mem; | ||
163 | } addr; | 166 | } addr; |
164 | union { | 167 | union { |
165 | unsigned long val; | 168 | unsigned long val; |