[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH for-4.21 2/3] xen/console: Optimise 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> --- CC: Jan Beulich <JBeulich@xxxxxxxx> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx> CC: Julien Grall <julien@xxxxxxx> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx> CC: Michal Orzel <michal.orzel@xxxxxxx> CC: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx> CC: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx> This taken from a security series, hence partially reviewed already. --- 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 2926c97df9a4..f98142d9b9b9 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -910,7 +910,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; @@ -964,7 +964,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, ...) @@ -984,7 +984,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); } -- 2.39.5
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |