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: <Yu4t0jkpIY4grgxL@gmail.com>
Date:   Sat, 6 Aug 2022 11:01:06 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Dave Hansen <dave.hansen@...el.com>
Cc:     ira.weiny@...el.com, Rik van Riel <riel@...riel.com>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org,
        linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [RFC PATCH 5/5] x86/entry: Store CPU info on exception entry


* Dave Hansen <dave.hansen@...el.com> wrote:

> On 8/5/22 10:30, ira.weiny@...el.com wrote:
> > +static inline void arch_save_aux_pt_regs(struct pt_regs *regs)
> > +{
> > +	struct pt_regs_auxiliary *aux_pt_regs = &to_extended_pt_regs(regs)->aux;
> > +
> > +	aux_pt_regs->cpu = raw_smp_processor_id();
> > +}
> 
> This is in a fast path that all interrupt and exception entry uses.  So,
> I was curious what the overhead is.
> 
> Code generation in irqentry_enter() gets a _bit_ more complicated
> because arch_save_aux_pt_regs() has to be done on the way out of the
> function and the compiler can't (for instance) do a
> 
> 	mov    $0x1,%eax
> 	ret
> 
> to return.  But, the gist of the change is still only two instructions
> that read a pretty hot, read-only per-cpu cacheline:
> 
> 	mov    %gs:0x7e21fa4a(%rip),%eax        # 15a38 <cpu_number>
> 	mov    %eax,-0x8(%rbx)
> 
> That doesn't seem too bad.

It's still 2 instructions more than what we had before, while the 
fault-time CPU number is only needed infrequently AFAICS.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ