From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbdJERio (ORCPT ); Thu, 5 Oct 2017 13:38:44 -0400 Received: from mga06.intel.com ([134.134.136.31]:37799 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbdJERim (ORCPT ); Thu, 5 Oct 2017 13:38:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,481,1500966000"; d="scan'208";a="143169343" From: "Neri, Ricardo" To: "bp@suse.de" CC: "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "x86@kernel.org" , "Ren, Qiaowei" , "adam.buchbinder@gmail.com" , "colin.king@canonical.com" , "tglx@linutronix.de" , "adanhawthorn@gmail.com" , "dave.hansen@linux.intel.com" , "ray.huang@amd.com" , "joe@perches.com" , "vbabka@suse.cz" , "mst@redhat.com" , "akpm@linux-foundation.org" , "hpa@zytor.com" , "brgerst@gmail.com" , "mingo@redhat.com" , "luto@kernel.org" , "pbonzini@redhat.com" , "Shankar, Ravi V" , "mhiramat@kernel.org" , "jslaby@suse.cz" , "liverlint@gmail.com" , "Gortmaker, Paul (Wind River)" , "cmetcalf@mellanox.com" , "slaoub@gmail.com" , "shuah@kernel.org" , "lstoakes@gmail.com" Subject: Re: [PATCH v9 06/29] x86/mpx: Use signed variables to compute effective addresses Thread-Topic: [PATCH v9 06/29] x86/mpx: Use signed variables to compute effective addresses Thread-Index: AQHTPMSjtbDPzYyXy0S/3L8OnpTM+KLVeAQAgACFQwA= Date: Thu, 5 Oct 2017 17:38:40 +0000 Message-ID: <1507225100.13798.0.camel@intel.com> References: <1507089272-32733-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1507089272-32733-7-git-send-email-ricardo.neri-calderon@linux.intel.com> <20171005094122.mejikubtadpjua5h@pd.tnic> In-Reply-To: <20171005094122.mejikubtadpjua5h@pd.tnic> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.3.52.59] Content-Type: text/plain; charset="utf-8" Content-ID: <12045C5CAE8BE04D87EEE907C7F14805@intel.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v95Hcmhp011155 On Thu, 2017-10-05 at 11:41 +0200, Borislav Petkov wrote: > On Tue, Oct 03, 2017 at 08:54:09PM -0700, Ricardo Neri wrote: > > > > Even though memory addresses are unsigned, the operands used to compute the > > effective address do have a sign. This is true for ModRM.rm, SIB.base, > > SIB.index as well as the displacement bytes. 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. > > > > Cc: Borislav Petkov > > Cc: Andy Lutomirski > > Cc: Dave Hansen > > Cc: Adam Buchbinder > > Cc: Colin Ian King > > Cc: Lorenzo Stoakes > > Cc: Qiaowei Ren > > Cc: Peter Zijlstra > > Cc: Nathan Howard > > Cc: Adan Hawthorn > > Cc: Joe Perches > > Cc: Ravi V. Shankar > > Cc: x86@kernel.org > > Signed-off-by: Ricardo Neri > > --- > >  arch/x86/mm/mpx.c | 20 ++++++++++++++------ > >  1 file changed, 14 insertions(+), 6 deletions(-) > Reviewed-by: Borislav Petkov Thank you! BR, Ricardo