From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbaILSmo (ORCPT ); Fri, 12 Sep 2014 14:42:44 -0400 Received: from www.linutronix.de ([62.245.132.108]:49600 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbaILSmn (ORCPT ); Fri, 12 Sep 2014 14:42:43 -0400 Date: Fri, 12 Sep 2014 20:42:23 +0200 (CEST) From: Thomas Gleixner To: Dave Hansen cc: Qiaowei Ren , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 08/10] x86, mpx: add prctl commands PR_MPX_REGISTER, PR_MPX_UNREGISTER In-Reply-To: Message-ID: References: <1410425210-24789-1-git-send-email-qiaowei.ren@intel.com> <1410425210-24789-9-git-send-email-qiaowei.ren@intel.com> <541239F1.2000508@intel.com> <5413050A.1090307@intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Sep 2014, Thomas Gleixner wrote: > On Fri, 12 Sep 2014, Dave Hansen wrote: > The proper solution to this problem is: > > do_bounds() > bd_addr = get_bd_addr_from_xsave(); > bd_entry = bndstatus & ADDR_MASK: Just for clarification. You CANNOT avoid the xsave here because it's the only way to access BNDSTATUS according to the manual. "The BNDCFGU and BNDSTATUS registers are accessible only with XSAVE/XRSTOR family of instructions" So there is no point to cache BNDCFGU as you get it anyway when you need to retrieve the invalid BD entry. Thanks, tglx