From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by kanga.kvack.org (Postfix) with ESMTP id 9702B6B0036 for ; Mon, 21 Jul 2014 02:08:08 -0400 (EDT) Received: by mail-pa0-f45.google.com with SMTP id eu11so9163659pac.4 for ; Sun, 20 Jul 2014 23:08:08 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com. [134.134.136.20]) by mx.google.com with ESMTP id fb3si13183361pab.58.2014.07.20.23.08.03 for ; Sun, 20 Jul 2014 23:08:03 -0700 (PDT) From: Andi Kleen Subject: Re: [PATCH v7 07/10] x86, mpx: decode MPX instruction to get bound violation information References: <1405921124-4230-1-git-send-email-qiaowei.ren@intel.com> <1405921124-4230-8-git-send-email-qiaowei.ren@intel.com> Date: Sun, 20 Jul 2014 23:07:59 -0700 In-Reply-To: <1405921124-4230-8-git-send-email-qiaowei.ren@intel.com> (Qiaowei Ren's message of "Mon, 21 Jul 2014 13:38:41 +0800") Message-ID: <87ppgz2qio.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Qiaowei Ren Cc: "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Qiaowei Ren writes: > + */ > +#ifdef CONFIG_X86_64 > + insn->x86_64 = 1; > + insn->addr_bytes = 8; > +#else > + insn->x86_64 = 0; > + insn->addr_bytes = 4; > +#endif How would that handle compat mode on a 64bit kernel? Should likely look at the code segment instead of ifdef. > + /* Note: the upper 32 bits are ignored in 32-bit mode. */ Again correct for compat mode? I believe the upper bits are undefined. -Andi -- ak@linux.intel.com -- Speaking for myself only -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753700AbaGUGIC (ORCPT ); Mon, 21 Jul 2014 02:08:02 -0400 Received: from mga09.intel.com ([134.134.136.24]:55174 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752763AbaGUGIA (ORCPT ); Mon, 21 Jul 2014 02:08:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,698,1400050800"; d="scan'208";a="576279578" From: Andi Kleen To: Qiaowei Ren Cc: "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v7 07/10] x86, mpx: decode MPX instruction to get bound violation information References: <1405921124-4230-1-git-send-email-qiaowei.ren@intel.com> <1405921124-4230-8-git-send-email-qiaowei.ren@intel.com> Date: Sun, 20 Jul 2014 23:07:59 -0700 In-Reply-To: <1405921124-4230-8-git-send-email-qiaowei.ren@intel.com> (Qiaowei Ren's message of "Mon, 21 Jul 2014 13:38:41 +0800") Message-ID: <87ppgz2qio.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Qiaowei Ren writes: > + */ > +#ifdef CONFIG_X86_64 > + insn->x86_64 = 1; > + insn->addr_bytes = 8; > +#else > + insn->x86_64 = 0; > + insn->addr_bytes = 4; > +#endif How would that handle compat mode on a 64bit kernel? Should likely look at the code segment instead of ifdef. > + /* Note: the upper 32 bits are ignored in 32-bit mode. */ Again correct for compat mode? I believe the upper bits are undefined. -Andi -- ak@linux.intel.com -- Speaking for myself only