]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: ensure emulator fetches do not span multiple pages
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Jun 2014 09:37:06 +0000 (11:37 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jul 2014 07:14:04 +0000 (09:14 +0200)
commit339e05eb1dd625c11f979c3e111af306a3582ae9
tree677713d985ffab18b25867d48ddc52a6c9bf4164
parenteaf2b44229af5c8a6400929464a95a71e4c1ad3c
KVM: x86: ensure emulator fetches do not span multiple pages

When the CS base is not page-aligned, the linear address of the code could
get close to the page boundary (e.g. 0x...ffe) even if the EIP value is
not.  So we need to first linearize the address, and only then compute
the number of valid bytes that can be fetched.

This happens relatively often when executing real mode code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c