[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/console: Optimise the parameter order of vprintk_common()



commit 654bfa421f72efa9f9600063cb26ca9326cd264d
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Jan 23 03:27:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Feb 25 13:30:55 2025 +0000

    xen/console: Optimise the parameter order of vprintk_common()
    
    For ABIs which pass parameters by register (all cases that we compile Xen
    for), inserting new arguments on the left hand side involves shuffling all
    other parameters along by one register whereas appending a new argument
    doesn't involve shuffling of existing registers.
    
    Reorder vprintk_common()'s prefix parameter to being last.  This is a 
marginal
    improvement on all architectures:
    
      Function                              old     new   delta
      vprintk                                18      12      -6  x86
      vprintk                                32      24      -8  arm32
      vprintk                                52      48      -4  arm64
      vprintk                                52      48      -4  riscv64
      vprintk                                80      72      -8  ppc64
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/char/console.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 7adf4e11fc..b6a8c71928 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -909,7 +909,7 @@ static void printk_start_of_line(const char *prefix)
     __putstr(tstr);
 }
 
-static void vprintk_common(const char *prefix, const char *fmt, va_list args)
+static void vprintk_common(const char *fmt, va_list args, const char *prefix)
 {
     struct vps {
         bool continued, do_print;
@@ -963,7 +963,7 @@ static void vprintk_common(const char *prefix, const char 
*fmt, va_list args)
 
 void vprintk(const char *fmt, va_list args)
 {
-    vprintk_common("(XEN) ", fmt, args);
+    vprintk_common(fmt, args, "(XEN) ");
 }
 
 void printk(const char *fmt, ...)
@@ -983,7 +983,7 @@ void guest_printk(const struct domain *d, const char *fmt, 
...)
     snprintf(prefix, sizeof(prefix), "(d%d) ", d->domain_id);
 
     va_start(args, fmt);
-    vprintk_common(prefix, fmt, args);
+    vprintk_common(fmt, args, prefix);
     va_end(args);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.