From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689AbdELCJZ (ORCPT ); Thu, 11 May 2017 22:09:25 -0400 Received: from mga03.intel.com ([134.134.136.65]:54275 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbdELCJY (ORCPT ); Thu, 11 May 2017 22:09:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,327,1491289200"; d="scan'208";a="1129349761" Message-ID: <1494554960.118905.52.camel@ranerica-desktop> Subject: Re: [v6 PATCH 08/21] x86/insn-eval: Add utility function to get segment descriptor base address 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 , Alexandre Julliard , Stas Sergeev , Fenghua Yu , "Ravi V. Shankar" , Shuah Khan , linux-kernel@vger.kernel.org, x86@kernel.org, linux-msdos@vger.kernel.org, wine-devel@winehq.org, Adam Buchbinder , Colin Ian King , Lorenzo Stoakes , Qiaowei Ren , Arnaldo Carvalho de Melo , Adrian Hunter , Kees Cook , Thomas Garnier , Dmitry Vyukov Date: Thu, 11 May 2017 19:09:20 -0700 In-Reply-To: <20170505171940.rg4yotcakixyglzu@pd.tnic> References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <20170308003254.27833-9-ricardo.neri-calderon@linux.intel.com> <20170420082533.hwc6eon3aom43qzo@pd.tnic> <1493246264.36058.72.camel@ranerica-desktop> <20170505171940.rg4yotcakixyglzu@pd.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-05-05 at 19:19 +0200, Borislav Petkov wrote: > On Wed, Apr 26, 2017 at 03:37:44PM -0700, Ricardo Neri wrote: > > I need a human-readable way of identifying what segment selector (in > > pt_regs, vm86regs or directly reading the segment registers) to use. > > Since there is a segment override prefix for all of them, I thought I > > could use them. > > Yes, you should... > > > Perhaps I can rename enum segment to enum segment_selector and comment > > that the values in the enum are those of the override prefixes. Would > > that be reasonable? > > ... but you should call them what they are: "enum seg_override_pfxs" or > "enum seg_ovr_pfx" or... > > Or somesuch. I suck at naming stuff. In my v7, I simply named my enumeration enum segment_register, which is what they are. Some of its entries happen to have the value of the segment override prefixes but also have special entries as SEG_REG_INVAL when for errors and SEG_REG_IGNORE for long mode [1]. Thanks and BR, Ricardo [1]. https://lkml.org/lkml/2017/5/5/405