From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752589AbbCXXmX (ORCPT ); Tue, 24 Mar 2015 19:42:23 -0400 Received: from mga03.intel.com ([134.134.136.65]:44661 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbbCXXmU (ORCPT ); Tue, 24 Mar 2015 19:42:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,461,1422950400"; d="scan'208";a="703667821" Message-ID: <5511F65A.5020505@intel.com> Date: Tue, 24 Mar 2015 16:42:18 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andy Lutomirski CC: Thomas Gleixner , "linux-kernel@vger.kernel.org" , X86 ML , Dave Hansen , Rik van Riel , Suresh Siddha , Ingo Molnar , "H. Peter Anvin" , Fenghua Yu Subject: Re: [PATCH 01/17] x86, fpu: wrap get_xsave_addr() to make it safer References: <1427235664-25318-1-git-send-email-dave.hansen@intel.com> <1427235664-25318-2-git-send-email-dave.hansen@intel.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/24/2015 03:28 PM, Andy Lutomirski wrote: > Your function appears to be getting it for write (I assume that's what > the unlazy_fpu is for), so I'd rather have it called > tsk_get_xsave_field_for_write or something like that. It should be entirely read-only. For MPX (the only user of get_xsave_addr() iirc), we are only worried about getting the status codes (and addresses) out of the bndstatus register and making sure that the kernel-recorded bounds directory address matches the bndcfgu (configuration) register. We don't ever write to the registers.