Subject: Re: [PATCHv2] cobalt/x86: fix condition in eager fpu code for kernels < 4.14 References: <20181221134452.15743-1-henning.schild@siemens.com> <20190107130416.25271-1-henning.schild@siemens.com> From: Jan Kiszka Message-ID: Date: Wed, 9 Jan 2019 22:22:06 +0800 MIME-Version: 1.0 In-Reply-To: <20190107130416.25271-1-henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Henning Schild , xenomai On 07.01.19 21:04, Henning Schild via Xenomai wrote: > From: Henning Schild > > We should mark the current task as not owning the fpu anymore if it does > actually own the fpu, not if the fpu itself is active. > > Fixes cb52e6c7438fa > > Reported-by: Mauro Salvini > Signed-off-by: Henning Schild > --- > kernel/cobalt/arch/x86/thread.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c > index a09560075..ba807ac1e 100644 > --- a/kernel/cobalt/arch/x86/thread.c > +++ b/kernel/cobalt/arch/x86/thread.c > @@ -475,7 +475,7 @@ void xnarch_leave_root(struct xnthread *root) > switch_fpu_finish(¤t->thread.fpu, smp_processor_id()); > #else > /* mark current thread as not owning the FPU anymore */ > - if (¤t->thread.fpu.fpstate_active) > + if (fpregs_active()) > fpregs_deactivate(¤t->thread.fpu); > #endif > } > Thanks, applied it next. Jan