|
@@ -650,10 +650,10 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt,
|
|
|
u16 sel;
|
|
|
|
|
|
la = seg_base(ctxt, addr.seg) + addr.ea;
|
|
|
- *linear = la;
|
|
|
*max_size = 0;
|
|
|
switch (mode) {
|
|
|
case X86EMUL_MODE_PROT64:
|
|
|
+ *linear = la;
|
|
|
if (is_noncanonical_address(la))
|
|
|
goto bad;
|
|
|
|
|
@@ -662,6 +662,7 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt,
|
|
|
goto bad;
|
|
|
break;
|
|
|
default:
|
|
|
+ *linear = la = (u32)la;
|
|
|
usable = ctxt->ops->get_segment(ctxt, &sel, &desc, NULL,
|
|
|
addr.seg);
|
|
|
if (!usable)
|
|
@@ -689,7 +690,6 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt,
|
|
|
if (size > *max_size)
|
|
|
goto bad;
|
|
|
}
|
|
|
- la &= (u32)-1;
|
|
|
break;
|
|
|
}
|
|
|
if (insn_aligned(ctxt, size) && ((la & (size - 1)) != 0))
|