NoBigReal emulation should consider the effective address is between 0 and
0xffff instead of checking the logical address.  Currently there are no
instructions which are marked with NoBigReal flag, so this bug currently has no
impact.

Signed-off-by: Nadav Amit <na...@cs.technion.ac.il>
---
 arch/x86/kvm/emulate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 13a1c76..4b687ff 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -645,8 +645,8 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
                lim = desc_limit_scaled(&desc);
                if ((ctxt->mode == X86EMUL_MODE_REAL) && !fetch &&
                    (ctxt->d & NoBigReal)) {
-                       /* la is between zero and 0xffff */
-                       if (la > 0xffff || (u32)(la + size - 1) > 0xffff)
+                       /* ea is between zero and 0xffff */
+                       if ((u32)addr.ea + size - 1 > 0xfffful)
                                goto bad;
                } else if ((desc.type & 8) || !(desc.type & 4)) {
                        /* expand-up segment */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to