From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbdAWQ7J (ORCPT ); Mon, 23 Jan 2017 11:59:09 -0500 Received: from mga04.intel.com ([192.55.52.120]:18044 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdAWQ7I (ORCPT ); Mon, 23 Jan 2017 11:59:08 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,274,1477983600"; d="scan'208";a="216635507" Date: Mon, 23 Jan 2017 08:55:30 -0800 From: Yu-cheng Yu To: Dave Hansen Cc: fenghua.yu@intel.com, dvlasenk@redhat.com, peterz@infradead.org, oleg@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, brgerst@gmail.com, luto@kernel.org, bp@alien8.de, jpoimboe@redhat.com, haokexin@gmail.com, hpa@zytor.com, quentin.casasnovas@oracle.com, tglx@linutronix.de, torvalds@linux-foundation.org, riel@redhat.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Message-ID: <20170123165529.GA4996@test-lenovo> References: <1485075023-30161-1-git-send-email-haokexin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 23, 2017 at 07:36:20AM -0800, Dave Hansen wrote: > The kernel xsave buffer should *ALWAYS* have the > XCOMP_BV_COMPACTED_FORMAT bit set. It should have been set before the > copyin and it should be set when it's finished. > > The best fix here would be not to paper over the issue in the copy > function but find where it got clobbered, or where some initialization > code failed to set it. Someone else reported different issues from the same bug and a different patch was just tested OK this morning. I think that adding xfeatures bits to xcomp_bv should have been done in fpstate_init(). Also, in copy_init_fpstate_to_fpregs(), we do: copy_kernel_to_xregs(&init_fpstate.xsave, -1). That (-1) could mean (0) because the parameters are declared as: copy_kernel_to_xregs(struct xregs_state *, u64) Yu-cheng