]> xenbits.xensource.com Git - people/dwmw2/xen.git/commit
x86emul: fix {,i}mul and {,i}div
authorJan Beulich <jbeulich@suse.com>
Fri, 30 Sep 2016 07:52:52 +0000 (09:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 30 Sep 2016 07:52:52 +0000 (09:52 +0200)
commit75066cd4ea56e615976fb846f225bc76504f867b
tree7b5a8d9647350b2e5dda10d5638647b82929db8c
parenteabe1c39d1cd4fcef18ec50571db3c70c055c1fb
x86emul: fix {,i}mul and {,i}div

Commit a3db233ede ("x86emul: use DstEax also for {,I}{MUL,DIV}") went
a little too far: DstEax and SrcEax weren't really meant to be used
together with ModRM - they assume modrm_reg remains zero by the time
the destination / source register pointer gets calculated. Don't fully
undo that commit though, but instead just correct the register pointer,
and don't use dst.val as input for mul and imul (div and idiv did avoid
that already).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/x86/x86_emulate/x86_emulate.c