Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756021AbdIGU10 (ORCPT ); Thu, 7 Sep 2017 16:27:26 -0400 Received: from mga05.intel.com ([192.55.52.43]:56777 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755608AbdIGU1X (ORCPT ); Thu, 7 Sep 2017 16:27:23 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,360,1500966000"; d="scan'208";a="148794613" Message-ID: <1504816041.30780.8.camel@linux.intel.com> Subject: Re: [PATCH v8 09/28] x86/insn-eval: Do not BUG on invalid register type 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, 07 Sep 2017 13:27:21 -0700 In-Reply-To: <20170907175413.5jyxbr3evv7bvock@pd.tnic> References: <20170819002809.111312-1-ricardo.neri-calderon@linux.intel.com> <20170819002809.111312-10-ricardo.neri-calderon@linux.intel.com> <20170907175413.5jyxbr3evv7bvock@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: 1100 Lines: 39 On Thu, 2017-09-07 at 19:54 +0200, Borislav Petkov wrote: > > Also, I meant to add it to pr_fmt. Feel free to merge this hunk ontop > of > yours: > > --- > diff --git a/arch/x86/lib/insn-eval.c b/arch/x86/lib/insn-eval.c > index 3919458fecbf..d46034ddfbb7 100644 > --- a/arch/x86/lib/insn-eval.c > +++ b/arch/x86/lib/insn-eval.c > @@ -10,6 +10,9 @@ >  #include >  #include >   > +#undef pr_fmt > +#define pr_fmt(fmt) "insn: " fmt > + >  enum reg_type { >         REG_TYPE_RM = 0, >         REG_TYPE_INDEX, > @@ -86,7 +89,7 @@ static int get_reg_offset(struct insn *insn, struct > pt_regs *regs, >                 break; >   >         default: > -               pr_err_ratelimited("insn: x86: invalid register > type"); > +               pr_err_ratelimited("invalid register type: %d\n", > type); >                 return -EINVAL; >         } >   Oh, I didn't understand your comment initially. Sure, I will add merge this on top of my patch. Thanks and BR, Ricardo