lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <746211f0-74b7-4935-a036-48a00bb5701b@arm.com>
Date: Tue, 9 Dec 2025 14:48:09 +0100
From: Kevin Brodsky <kevin.brodsky@....com>
To: Jinjie Ruan <ruanjinjie@...wei.com>, catalin.marinas@....com,
 will@...nel.org, oleg@...hat.com, tglx@...utronix.de, peterz@...radead.org,
 luto@...nel.org, shuah@...nel.org, kees@...nel.org, wad@...omium.org,
 deller@....de, macro@...am.me.uk, charlie@...osinc.com, ldv@...ace.io,
 mark.rutland@....com, song@...nel.org, ryan.roberts@....com,
 ada.coupriediaz@....com, anshuman.khandual@....com, broonie@...nel.org,
 pengcan@...inos.cn, dvyukov@...gle.com,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v9 14/16] arm64: Inline el0_svc_common()

On 04/12/2025 09:21, Jinjie Ruan wrote:
> After switch arm64 to Generic Entry, the compiler no longer inlines

Did it inline it before this series?

> el0_svc_common() into do_el0_svc(). So inline el0_svc_common() and it
> has 1% performance uplift on perf bench basic syscall on kunpeng920
> as below.
>
> | Metric     | W/O this patch | With this patch | Change    |
> | ---------- | -------------- | --------------- | --------- |
> | Total time | 2.195 [sec]    | 2.171 [sec]     |  ↓1.1%   |
> | usecs/op   | 0.219575       | 0.217192        |  ↓1.1%   |
> | ops/sec    | 4,554,260      | 4,604,225       |  ↑1.1%    |
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>

I think this is sensible - do_el0_svc() is clearly hot and the small
increase in code size is completely justified. It also removes a
performance regression when enabling CONFIG_COMPAT (without it
el0_svc_common() has only one caller so it should be inlined regardless).

Reviewed-by: Kevin Brodsky <kevin.brodsky@....com>

> ---
>  arch/arm64/kernel/syscall.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> index 47e193a1cfff..5aa51da9ec25 100644
> --- a/arch/arm64/kernel/syscall.c
> +++ b/arch/arm64/kernel/syscall.c
> @@ -66,8 +66,8 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno,
>  	choose_random_kstack_offset(get_random_u16());
>  }
>  
> -static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> -			   const syscall_fn_t syscall_table[])
> +static __always_inline void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> +					   const syscall_fn_t syscall_table[])
>  {
>  	unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
>  	unsigned long flags = read_thread_flags();

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ