This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: fix "REP RET" with -madd-bnd-prefix
- From: "Jan Beulich" <JBeulich at suse dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <binutils at sourceware dot org>
- Date: Wed, 30 May 2018 08:23:34 -0600
- Subject: Re: [PATCH] x86: fix "REP RET" with -madd-bnd-prefix
- References: <5B0E558202000078001C6D83@prv1-mh.provo.novell.com> <CAMe9rOofvzWRyVYk1TzvAui0w_ujBG4DH-tk1nE3HMPZf=vKEw@mail.gmail.com>
>>> On 30.05.18 at 14:35, <hjl.tools@gmail.com> wrote:
> On Wed, May 30, 2018 at 12:40 AM, Jan Beulich <JBeulich@suse.com> wrote:
>> --- a/gas/testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.s
>> +++ b/gas/testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.s
>> @@ -8,7 +8,9 @@
>> jmp *(%rbx)
>> ret
>> foo:
>> - # Use of REPNE prefix - we shouldn't get any error
>> + # Use of any REP prefix - we shouldn't get any error
>> + rep ret
>> + repe ret
>> repne ret
>> # BND prefix already exists - we shouldn't get any error here
>> bnd ret
>>
>
> Assembly code asks for F3 prefix and F2 prefix is generated.
> It does't look right to me.
Not emitting a BND prefix despite -madd-bnd-prefix looks even worse
to me: Which REP prefix is used doesn't matter without MPX, but it
very much does matter with MPX.
Jan