]> xenbits.xensource.com Git - xen.git/commit
x86/shadow: fetch CPL just once in sh_page_fault()
authorJan Beulich <jbeulich@suse.com>
Thu, 12 Jul 2018 08:47:33 +0000 (10:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 12 Jul 2018 08:47:33 +0000 (10:47 +0200)
commit94c7b060c072794d9f21755db24db1ac502ceb4b
tree1679932fad07d19a3edf7d5b6c693864b463fbad
parent736eb39d1f2d0b042bc770149c33929aab8b5b71
x86/shadow: fetch CPL just once in sh_page_fault()

This isn't as much of an optimization than to avoid triggering a gcc bug
affecting 5.x ... 7.x, triggered by any asm() put inside the ad hoc
"rewalk" loop and taking as an (output?) operand a register variable
tied to %rdx (an "rdx" clobber is fine). The issue is due to an apparent
collision in register use with the modulo operation in vtlb_hash(),
which (with optimization enabled) involves a multiplication of two
64-bit values with the upper half (in %rdx) of the 128-bit result being
of interest.

Such an asm() was originally meant to be implicitly introduced into the
code when converting most indirect calls through the hvm_funcs table to
direct calls (via alternative instruction patching); that model was
switched to clobbers due to further compiler problems, but I think the
change here is worthwhile nevertheless.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/multi.c