From d50eaa18039b8b848c2285478d0775335ad5e930 Mon Sep 17 00:00:00 2001 From: Nadav Amit Date: Wed, 19 Nov 2014 17:43:11 +0200 Subject: [PATCH] KVM: x86: Perform limit checks when assigning EIP If branch (e.g., jmp, ret) causes limit violations, since the target IP > limit, the #GP exception occurs before the branch. In other words, the RIP pushed on the stack should be that of the branch and not that of the target. To do so, we can call __linearize, with new EIP, which also saves us the code which performs the canonical address checks. On the case of assigning an EIP >= 2^32 (when switching cs.l), we also safe, as __linearize will check the new EIP does not exceed the limit and would trigger #GP(0) otherwise. Signed-off-by: Nadav Amit Signed-off-by: Paolo Bonzini --- Reading git-format-patch failed