From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754625AbbESG0W (ORCPT ); Tue, 19 May 2015 02:26:22 -0400 Received: from mga01.intel.com ([192.55.52.88]:43610 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754226AbbESGZU (ORCPT ); Tue, 19 May 2015 02:25:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,456,1427785200"; d="scan'208";a="573472755" Subject: [PATCH 14/19] x86, mpx: new directory entry to addr helper To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@linutronix.de, Dave Hansen , dave.hansen@linux.intel.com From: Dave Hansen Date: Mon, 18 May 2015 23:25:34 -0700 References: <20150519062528.E2D5DDFF@viggo.jf.intel.com> In-Reply-To: <20150519062528.E2D5DDFF@viggo.jf.intel.com> Message-Id: <20150519062534.C3DC7013@viggo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Hansen Currently, to get from a bounds directory entry to the virtual address of a bounds table, we simply mask off a few low bits. However, the set of bits we mask off is different for 32 and 64-bit binaries. This breaks the operation out in to a helper function and also adds a temporary variable to store the result until we are sure we are returning one. Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner --- b/arch/x86/include/asm/mpx.h | 1 - b/arch/x86/mm/mpx.c | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 8 deletions(-) diff -puN arch/x86/include/asm/mpx.h~mpx-new-entry-to-addr-helper arch/x86/include/asm/mpx.h --- a/arch/x86/include/asm/mpx.h~mpx-new-entry-to-addr-helper 2015-05-18 17:49:03.198615076 -0700 +++ b/arch/x86/include/asm/mpx.h 2015-05-18 17:49:03.203615302 -0700 @@ -45,7 +45,6 @@ #define MPX_BNDSTA_TAIL 2 #define MPX_BNDCFG_TAIL 12 #define MPX_BNDSTA_ADDR_MASK (~((1UL<