Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753724AbdDKV41 (ORCPT ); Tue, 11 Apr 2017 17:56:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:35219 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbdDKV4Z (ORCPT ); Tue, 11 Apr 2017 17:56:25 -0400 Date: Tue, 11 Apr 2017 23:56:01 +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 , 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 , Nathan Howard , Adan Hawthorn , Joe Perches Subject: Re: [v6 PATCH 01/21] x86/mpx: Use signed variables to compute effective addresses Message-ID: <20170411215601.kycakoyogyfdosi5@pd.tnic> References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <20170308003254.27833-2-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170308003254.27833-2-ricardo.neri-calderon@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: 771 Lines: 21 On Tue, Mar 07, 2017 at 04:32:34PM -0800, Ricardo Neri wrote: > Even though memory addresses are unsigned. The operands used to compute the ... unsigned, the operands ... > effective address do have a sign. This is true for the r/m part of the > ModRM byte, the base and index parts of the SiB byte as well as the > displacement. Thus, signed variables shall be used when computing the > effective address from these operands. Once the signed effective address > has been computed, it is casted to an unsigned long to determine the > linear address. > > Variables are renamed to better reflect the type of address being > computed. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --