From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbdJTSZv (ORCPT ); Fri, 20 Oct 2017 14:25:51 -0400 Received: from mga05.intel.com ([192.55.52.43]:34467 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbdJTSZt (ORCPT ); Fri, 20 Oct 2017 14:25:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,408,1503385200"; d="scan'208";a="912011943" Date: Fri, 20 Oct 2017 11:24:48 -0700 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, ricardo.neri@intel.com, Adam Buchbinder , Colin Ian King , Lorenzo Stoakes , Qiaowei Ren , Arnaldo Carvalho de Melo , Adrian Hunter , Kees Cook , Thomas Garnier , Dmitry Vyukov Subject: Re: [PATCH v9 19/29] x86/insn-eval: Add support to resolve 32-bit address encodings Message-ID: <20171020182448.GE12298@voyager> References: <1507089272-32733-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1507089272-32733-20-git-send-email-ricardo.neri-calderon@linux.intel.com> <20171020171229.pofottubbjnwgmws@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171020171229.pofottubbjnwgmws@pd.tnic> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 20, 2017 at 07:12:30PM +0200, Borislav Petkov wrote: > On Tue, Oct 03, 2017 at 08:54:22PM -0700, Ricardo Neri wrote: > > The new function get_addr_ref_32() is almost identical to the existing > > function insn_get_addr_ref() (used for 64-bit addresses); except for the > > differences mentioned above. For the sake of simplicity and readability, > > it is better to use two separate functions. > > You're kidding, right? > > You're not adding another small function - this new one is just as big. And > almost identical. > > So if you split the whole handling into helpers - for example, each > if-clause is doing very similar things - you can carve out the repeating > pieces into helpers and then call them each time with the respective > parameters, you can get rid of all that needless duplication. I will create these helper functions. This change and your suggestion in patch 18 will impact other patches in the series (e.g., the function get_addr_ref_16() in patch 22). Would it make sense to submit a v10 and resume review there? Also, do you think I am still on-time to make it to v4.15? Thanks and BR, Ricardo > > -- > Regards/Gruss, > Boris. > > SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) > --