Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320AbdI2L4d (ORCPT ); Fri, 29 Sep 2017 07:56:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:37701 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751964AbdI2L4b (ORCPT ); Fri, 29 Sep 2017 07:56:31 -0400 Date: Fri, 29 Sep 2017 13:56:11 +0200 From: Borislav Petkov To: Ricardo Neri 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 Subject: Re: [PATCH v8 12/28] x86/insn-eval: Add utility functions to get segment selector Message-ID: <20170929115611.ldpldjr7z7ygdgph@pd.tnic> References: <20170819002809.111312-1-ricardo.neri-calderon@linux.intel.com> <20170819002809.111312-13-ricardo.neri-calderon@linux.intel.com> <20170926104353.vmpxybv3v5immc56@pd.tnic> <1506486104.8286.142.camel@linux.intel.com> <20170927114713.wbee7ze2ud2ekvbw@pd.tnic> <1506551546.2532.36.camel@linux.intel.com> <20170928093639.nwvohdd7h7i4htft@pd.tnic> <1506665202.2532.118.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1506665202.2532.118.camel@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1010 Lines: 29 On Thu, Sep 28, 2017 at 11:06:42PM -0700, Ricardo Neri wrote: > I agree. In fact, insn_get_seg_base() does not need insn at all. All it needs is > a INAT_SEG_REG_* index. This would make things clear. UMIP (and callers that > need to copy_from_user code can do insn_get_seg_base(regs, INAT_SEG_REG_CS). No > insn needed. Yap. > In fact, it is only the insn_get_addr_ref_xx() family of functions that does I think you mean get_addr_ref_xx() here. > Do you think the pseudocode above addresses your concerns? > > *insn_get_seg_base() will take a INAT_SEG_REG_* index > *insn_get_ref_xx() receives an initialized insn that can check for NULL value. > *a reworked resolve_seg_reg_idx will clearly check if it can use segment > override prefixes and obtain them. If not, it will use default values. Makes sense, but send me the final version to take a look at it too. Thanks. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --