[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tuykr99y.fsf@nanos.tec.linutronix.de>
Date: Mon, 06 Jul 2020 16:46:33 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Mihai Carabas <mihai.carabas@...cle.com>,
linux-kernel@...r.kernel.org
Cc: mingo@...hat.com, bp@...en8.de, x86@...nel.org,
boris.ostrovsky@...cle.com, konrad.wilk@...cle.com,
Mihai Carabas <mihai.carabas@...cle.com>
Subject: Re: [PATCH RFC 3/7] x86: kernel: cpu: bugs.c: modify static_cpu_has to boot_cpu_has
Mihai Carabas <mihai.carabas@...cle.com> writes:
> The usage of static_cpu_has in bugs.c file is counter-productive
> since the code is executed once but there is extra effort to patch
> it and keep alternatives in a special section --- so there is both
> space and time cost.
>
> Quote from _static_cpu_has definition:
> /*
> * Static testing of CPU features. Used the same as boot_cpu_has(). It
> * statically patches the target code for additional performance. Use
> * static_cpu_has() only in fast paths, where every cycle counts. Which
> * means that the boot_cpu_has() variant is already fast enough for the
> * majority of cases and you should stick to using it as it is generally
> * only two instructions: a RIP-relative MOV and a TEST.
> */
>
> There are two other places where static_cpu_has is used and might be
> considered critical paths: __speculation_ctrl_update() and vmx_l1d_flush().
>
> Given these facts, changing static_cpu_has to boot_cpu_has is done in
> order to bypass alternative instructions which cannot be updated at runtime
> for now.
Not going to happen. We are not adding 4 conditionals to context switch
just to support that late loading horrors. There are better ways to do
that.
Thanks,
tglx
Powered by blists - more mailing lists