From: Avi Kivity Date: Sun, 19 Aug 2012 11:34:31 +0000 (+0300) Subject: KVM: x86 emulator: use stack size attribute to mask rsp in stack ops X-Git-Tag: v3.6-rc4~14^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ad105e569c45dcfad50d724c61d5061248be755;p=pandora-kernel.git KVM: x86 emulator: use stack size attribute to mask rsp in stack ops The sub-register used to access the stack (sp, esp, or rsp) is not determined by the address size attribute like other memory references, but by the stack segment's B bit (if not in x86_64 mode). Fix by using the existing stack_mask() to figure out the correct mask. This long-existing bug was exposed by a combination of a27685c33acccce (emulate invalid guest state by default), which causes many more instructions to be emulated, and a seabios change (possibly a bug) which causes the high 16 bits of esp to become polluted across calls to real mode software interrupts. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed