projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03ebebe
)
KVM: x86 emulator: Check segment limits in real mode too
author
Avi Kivity
<
[email protected]
>
Tue, 21 Aug 2012 14:07:05 +0000
(17:07 +0300)
committer
Marcelo Tosatti
<
[email protected]
>
Mon, 27 Aug 2012 23:02:20 +0000
(20:02 -0300)
Segment limits are verified in real mode, not just protected mode.
Signed-off-by: Avi Kivity <
[email protected]
>
Signed-off-by: Marcelo Tosatti <
[email protected]
>
arch/x86/kvm/emulate.c
patch
|
blob
|
history
diff --git
a/arch/x86/kvm/emulate.c
b/arch/x86/kvm/emulate.c
index f8b27cd2a6cb499fbe4b2353bda47774e33d9576..5b1c701cd6d04f04160b274e7d204fa342e1dec3 100644
(file)
--- a/
arch/x86/kvm/emulate.c
+++ b/
arch/x86/kvm/emulate.c
@@
-668,8
+668,6
@@
static int __linearize(struct x86_emulate_ctxt *ctxt,
la = seg_base(ctxt, addr.seg) + addr.ea;
switch (ctxt->mode) {
- case X86EMUL_MODE_REAL:
- break;
case X86EMUL_MODE_PROT64:
if (((signed long)la << 16) >> 16 != la)
return emulate_gp(ctxt, 0);
@@
-699,7
+697,10
@@
static int __linearize(struct x86_emulate_ctxt *ctxt,
goto bad;
}
cpl = ctxt->ops->cpl(ctxt);
- rpl = sel & 3;
+ if (ctxt->mode == X86EMUL_MODE_REAL)
+ rpl = 0;
+ else
+ rpl = sel & 3;
cpl = max(cpl, rpl);
if (!(desc.type & 8)) {
/* data segment */