[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86e0203d-d4f4-3502-da85-6626eecfac99@intel.com>
Date: Fri, 18 Aug 2023 16:35:23 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Rick Edgecombe <rick.p.edgecombe@...el.com>, <tglx@...utronix.de>,
<mingo@...hat.com>, <bp@...en8.de>, <x86@...nel.org>,
<hpa@...or.com>, <dave.hansen@...ux.intel.com>, <luto@...nel.org>,
<peterz@...radead.org>
CC: <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: Use __fpu_invalidate_fpregs_state() in exec
Hi Rick,
On 8/18/2023 10:03 AM, Rick Edgecombe wrote:
> So the root cause is that exec() is doing the wrong kind of invalidate. It
> should reset fpu->last_cpu via __fpu_invalidate_fpregs_state(). Further,
> fpu__drop() doesn't really seem appropriate as the task (and FPU) are not
> going away, they are just getting reset as part of an exec. So switch to
> __fpu_invalidate_fpregs_state().
>
I went through the scenario you described and it seems plausible. Since
the task is being reset (and the CPU is unaffected) it makes sense to
use __fpu_invalidate_fpregs_state() during exec().
> Also, delete the misleading comment that says that either kind of
> invalidate will be enough, because it’s not always the case.
>
I think it would be helpful to expand the comment specifying exactly
when __fpu_invalidate_fpregs_state() should be used vs
__cpu_invalidate_fpregs_state(). I'll try to audit the usages and come
up with something reasonable if possible.
Sohil
Powered by blists - more mailing lists