[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1493333398.74182.10.camel@ranerica-desktop>
Date: Thu, 27 Apr 2017 15:49:58 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Borislav Petkov <bp@...e.de>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Brian Gerst <brgerst@...il.com>,
Chris Metcalf <cmetcalf@...lanox.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Huang Rui <ray.huang@....com>, Jiri Slaby <jslaby@...e.cz>,
Jonathan Corbet <corbet@....net>,
"Michael S. Tsirkin" <mst@...hat.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Vlastimil Babka <vbabka@...e.cz>,
Chen Yucong <slaoub@...il.com>,
Alexandre Julliard <julliard@...ehq.org>,
Stas Sergeev <stsp@...t.ru>, Fenghua Yu <fenghua.yu@...el.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-msdos@...r.kernel.org, wine-devel@...ehq.org,
Adam Buchbinder <adam.buchbinder@...il.com>,
Colin Ian King <colin.king@...onical.com>,
Lorenzo Stoakes <lstoakes@...il.com>,
Qiaowei Ren <qiaowei.ren@...el.com>,
Nathan Howard <liverlint@...il.com>,
Adan Hawthorn <adanhawthorn@...il.com>,
Joe Perches <joe@...ches.com>
Subject: Re: [v6 PATCH 03/21] x86/mpx: Do not use R/EBP as base in the SIB
byte with Mod = 0
On Wed, 2017-04-26 at 10:05 +0200, Borislav Petkov wrote:
> On Tue, Apr 25, 2017 at 07:04:20PM -0700, Ricardo Neri wrote:
> > For the specific case of ModRM.mod being 0, I feel I need to clarify
> > that REX.B is not decoded and if SIB.base is %r13 the base is also 0.
>
> Well, that all doesn't matter. The rule is this:
>
> ModRM.mod == 00b and ModRM.r/m == 101b -> effective address: disp32
>
> See Table 2-2. "32-Bit Addressing Forms with the ModR/M Byte" in the SDM.
You are right. This summarizes the rule. Then I will shorten the
comment.
>
> So the base register is not used. How that base register is specified
> then doesn't matter (undecoded REX bits or not).
>
> > This comment adds clarity because REX.X is decoded when determining
> > SIB.index.
>
> Well, that's a different thing. The REX bits participating in the SIB
> fields don't matter about this particular case. We only want to say that
> we're returning a disp32 without a base register and the comment should
> keep it simple without extraneous information.
>
> I know, you want to mention what Table 2-5. "Special Cases of REX
> Encodings" says but we should avoid unnecessary content in the comment.
> People who want details can stare at the manuals - the comment should
> only document what that particular case is.
>
> Btw, you could write it even better:
>
> if (!X86_MODRM_MOD(insn->modrm.value) && X86_MODRM_RM(insn->modrm.value) == 5)
>
> and then it is basically a 1:1 copy of the rule from Table 2-2.
It is!
Thanks and BR,
Ricardo
Powered by blists - more mailing lists