Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbdINSar (ORCPT ); Thu, 14 Sep 2017 14:30:47 -0400 Received: from mga05.intel.com ([192.55.52.43]:39152 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbdINSaq (ORCPT ); Thu, 14 Sep 2017 14:30:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,394,1500966000"; d="scan'208";a="1014523595" Message-ID: <1505413827.8286.10.camel@linux.intel.com> Subject: Re: [PATCH v8 10/28] x86/insn-eval: Add a utility function to get register offsets From: Ricardo Neri To: Borislav Petkov Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka , Chen Yucong , "Ravi V. Shankar" , Shuah Khan , linux-kernel@vger.kernel.org, x86@kernel.org, Adam Buchbinder , Colin Ian King , Lorenzo Stoakes , Qiaowei Ren , Arnaldo Carvalho de Melo , Adrian Hunter , Kees Cook , Thomas Garnier , Dmitry Vyukov Date: Thu, 14 Sep 2017 11:30:27 -0700 In-Reply-To: <20170908133514.vty22j5xl76dt6ef@pd.tnic> References: <20170819002809.111312-1-ricardo.neri-calderon@linux.intel.com> <20170819002809.111312-11-ricardo.neri-calderon@linux.intel.com> <20170908133514.vty22j5xl76dt6ef@pd.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1703 Lines: 45 On Fri, 2017-09-08 at 15:35 +0200, Borislav Petkov wrote: > On Fri, Aug 18, 2017 at 05:27:51PM -0700, Ricardo Neri wrote: > > > > The function get_reg_offset() returns the offset to the register > > the > > argument specifies as indicated in an enumeration of type offset. > > Callers > > of this function would need the definition of such enumeration. > > This is > > not needed. Instead, add helper functions for this purpose. These > > functions > > are useful in cases when, for instance, the caller needs to decide > > whether > > the operand is a register or a memory location by looking at the rm > > part > > of the ModRM byte. As of now, this is the only helper function that > > is > > needed. > > > > Cc: Dave Hansen > > Cc: Adam Buchbinder > > Cc: Colin Ian King > > Cc: Lorenzo Stoakes > > Cc: Qiaowei Ren > > Cc: Arnaldo Carvalho de Melo > > Cc: Masami Hiramatsu > > Cc: Adrian Hunter > > Cc: Kees Cook > > Cc: Thomas Garnier > > Cc: Peter Zijlstra > > Cc: Borislav Petkov > > Cc: Dmitry Vyukov > > Cc: Ravi V. Shankar > > Cc: x86@kernel.org > > Signed-off-by: Ricardo Neri > > --- > >  arch/x86/include/asm/insn-eval.h |  1 + > >  arch/x86/lib/insn-eval.c         | 15 +++++++++++++++ > >  2 files changed, 16 insertions(+) > Reviewed-by: Borislav Petkov Thanks for your review! BR, Ricardo