Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbcJDGf6 (ORCPT ); Tue, 4 Oct 2016 02:35:58 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35179 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbcJDGf5 (ORCPT ); Tue, 4 Oct 2016 02:35:57 -0400 Date: Tue, 4 Oct 2016 08:35:52 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Rik van Riel , Dave Hansen , "linux-kernel@vger.kernel.org" , X86 ML , Thomas Gleixner , Paolo Bonzini , Ingo Molnar , Andrew Lutomirski , "H. Peter Anvin" , Borislav Petkov , Linus Torvalds Subject: Re: [PATCH RFC 2/5] x86,fpu: delay FPU register loading until switch to userspace Message-ID: <20161004063552.GA1035@gmail.com> References: <1475353895-22175-1-git-send-email-riel@redhat.com> <1475353895-22175-3-git-send-email-riel@redhat.com> <1475366900.21644.8.camel@redhat.com> <1475529679.4622.27.camel@redhat.com> <1475544579.21644.37.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 45 * Andy Lutomirski wrote: > > Running the task in user space, would have to ensure > > "registers valid" is true, and make "memory valid" > > false, because userspace could write to the registers. > > > > Doing a ptrace fpstate_read would make "memory valid" > > true, but does not need to invalidate "registers valid". > > > > Doing a ptrace fpstate_write would make "memory valid" > > true, but would invalidate "registers valid". > > > > Context switching away from a task would make "memory > > valid" true, by virtue of copying the fpstate to > > memory. > > > > Ingo, would you have any objection to patches tracking > > the validity of both register and memory states > > independently? I'd like to reserve judgement - but tentatively I see no red flags at the moment, but in any case I'd like to start with: > > > > We can get rid of fpu.counter, since nobody uses it > > any more. > > We should definitely do this. > > Maybe getting in some cleanups first (my lazy fpu deletion, > fpu.counter removal, etc) first is the way to go. Could you guys please submit all pending FPU bits that aren't new functionality to -tip? I'll remove lazy FPU handling if you don't beat me to it. Plus after lazy FPU removal we should take another good look and make the FPU state machine even more obvious and self-documenting. Upstream merge commit 597f03f9d133 would be a good base. Thanks, Ingo