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]
Date:	Mon, 2 Feb 2015 19:55:01 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	riel@...hat.com
Cc:	dave.hansen@...ux.intel.com, sbsiddha@...il.com,
	luto@...capital.net, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com, fenghua.yu@...el.com, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] x86,fpu: also check fpu_lazy_restore when
	use_eager_fpu

On 02/02, riel@...hat.com wrote:
>
> From: Rik van Riel <riel@...hat.com>
>
> With Oleg's patch "x86, fpu: don't abuse FPU in kernel threads if
> use_eager_fpu()", kernel threads no longer have an FPU state even
> on systems with use_eager_fpu()
>
> That in turn means that a task may still have its FPU state
> loaded in the FPU registers, if the task only got interrupted by
> kernel threads from when it went to sleep, to when it woke up
> again.
>
> In that case, there is no need to restore the FPU state for
> this task, since it is still in the registers.
>
> The kernel can simply use the same logic to determine this as
> is used for !use_eager_fpu() systems.

Yes, agreed, I was going to do this too.

And in fact this change make sense even without "don't abuse FPU in kernel
threads", I think.

But in theory it depends on another change, "__kernel_fpu_begin() should
clear fpu_owner_task even if use_eager_fpu()".

And that series was ignored ;)

I think this patch is fine.

> --- a/arch/x86/include/asm/fpu-internal.h
> +++ b/arch/x86/include/asm/fpu-internal.h
> @@ -457,7 +457,7 @@ static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct ta
>  		task_disable_lazy_fpu_restore(old);
>  		if (fpu.preload) {
>  			new->thread.fpu_counter++;
> -			if (!use_eager_fpu() && fpu_lazy_restore(new, cpu))
> +			if (fpu_lazy_restore(new, cpu))
>  				fpu.preload = 0;
>  			else
>  				prefetch(new->thread.fpu.state);
> --
> 1.9.3
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ