From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754921AbbA2X0L (ORCPT ); Thu, 29 Jan 2015 18:26:11 -0500 Received: from mga01.intel.com ([192.55.52.88]:58088 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbbA2X0J (ORCPT ); Thu, 29 Jan 2015 18:26:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,488,1418112000"; d="scan'208";a="644751191" Message-ID: <54CAC190.30905@linux.intel.com> Date: Thu, 29 Jan 2015 15:26:08 -0800 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Oleg Nesterov CC: Rik van Riel , Suresh Siddha , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Fenghua Yu , the arch/x86 maintainers , linux-kernel Subject: Re: [PATCH 0/3]: x86, fpu: unlazy_fpu fixes/cleanups References: <54C2A245.4010307@redhat.com> <20150129210723.GA31584@redhat.com> <54CAA357.1070108@linux.intel.com> <20150129213346.GA32511@redhat.com> <54CAA973.4050401@linux.intel.com> <20150129215638.GB1045@redhat.com> In-Reply-To: <20150129215638.GB1045@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/29/2015 01:56 PM, Oleg Nesterov wrote: > --- x/arch/x86/kernel/traps.c > +++ x/arch/x86/kernel/traps.c > @@ -313,7 +313,7 @@ dotraplinkage void do_bounds(struct pt_r > * It is not directly accessible, though, so we need to > * do an xsave and then pull it out of the xsave buffer. > */ > - fpu_save_init(&tsk->thread.fpu); > + unlazy_fpu(tsk); > xsave_buf = &(tsk->thread.fpu.state->xsave); ... > bndcsr = get_xsave_addr(xsave_buf, XSTATE_BNDCSR); Hmm, if the the thread was not using the FPU, and this fails to save anything in to the xsave_buf, what will bndcsr point to? It _looks_ to me like it will just point to uninitialized data since the xsave never happened. Fenghua, shouldn't get_xsave_addr() be checking the xstate bit against the xsave->xstate_bv?