[xen staging] x86/clear_page: Update clear_page_sse2() after dropping 32bit Xen
Author: Andrew Cooper <[hidden email]>
AuthorDate: Mon Jun 17 19:56:11 2019 +0100
Commit: Andrew Cooper <[hidden email]>
CommitDate: Tue Jun 18 15:47:52 2019 +0100
x86/clear_page: Update clear_page_sse2() after dropping 32bit Xen
This code was never updated when the 32bit build of Xen was dropped.
* Expand the now-redundant ptr_reg macro.
* The number of iterations in the loop can be halfed by using 64bit writes,
without consuming any extra execution resource in the pipeline. Adjust all
* Replace dec with sub to avoid a eflags stall, and position it to be
macro-fused with the related jmp.
* With no need to preserve eflags across the body of the loop, replace lea
with add which has 1/3'rd the latency on basically all 64bit hardware.
A quick userspace perf test on my Haswell dev box indicates that the old
version takes ~1385 cycles on average (ignoring outliers), and the new version
takes ~1060 cyles, or about 77% of the time.
Reported-by: Edwin TÃ¶rÃ¶k <[hidden email]>
Signed-off-by: Andrew Cooper <[hidden email]>
Reviewed-by: Jan Beulich <[hidden email]>
xen/arch/x86/clear_page.S | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)