From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757441AbbDVP6u (ORCPT ); Wed, 22 Apr 2015 11:58:50 -0400 Received: from mail.skyhub.de ([78.46.96.112]:52185 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757132AbbDVP6t (ORCPT ); Wed, 22 Apr 2015 11:58:49 -0400 Date: Wed, 22 Apr 2015 17:58:40 +0200 From: Borislav Petkov To: Oleg Nesterov , Thomas Gleixner Cc: Dave Hansen , linux-kernel@vger.kernel.org, x86@kernel.org, dave.hansen@linux.intel.com, riel@redhat.com, sbsiddha@gmail.com, luto@amacapital.net, mingo@redhat.com, hpa@zytor.com, fenghua.yu@intel.com Subject: Re: [PATCH 01/16] x86, fpu: wrap get_xsave_addr() to make it safer Message-ID: <20150422155840.GJ6897@pd.tnic> References: <20150401004623.894DF37A@viggo.jf.intel.com> <20150401004624.49096AD0@viggo.jf.intel.com> <20150422104047.GA6897@pd.tnic> <20150422131618.GA16785@redhat.com> <20150422133146.GE6897@pd.tnic> <20150422153245.GA22825@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150422153245.GA22825@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2015 at 05:32:45PM +0200, Oleg Nesterov wrote: > How? I am certainly missing you point... OK, please forge about FPU. > Consider this code: > > tsk = current; > for (;;) > BUG_ON(tsk != current); > > it doesn't need to disable preemption. We do not care if CPU switches > to another thread, even if this thread executes the same code. Because > its tsk/current will differ, but "tsk == current" will be still true. > > Could you please spell? Bah, forget what I said. tglx schooled me on IRC. We always do get called with tsk == current. Sorry for the confusion... > See above... used_math() should be correct because we know that tsk==current, > but I agree that tsk_used_math(tsk) looks better. Right, and it is clear what's going on, even to lusers like me. Thanks for teaching me guys. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --