[PATCH 3/6] KVM: x86: NoBigReal was mistakenly considering la instead of ea

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <namit@xxxxxxxxxxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux