x86/clear_page: Update clear_page_sse2() after dropping 32bit Xen
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Jun 2019 18:56:11 +0000 (19:56 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 18 Jun 2019 14:47:52 +0000 (15:47 +0100)
commit260acc521db4c29df4aa9b7a67f42cf967871fd3
treea83289e18aa8ae9aff1cb9f0880b505d8a3e5004
parent6ff560f7f1f214fb89baaf97812c4c943e44a642
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
   numbers/offsets appropriately.
 * 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 <edvin.torok@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/clear_page.S