From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9361 invoked by alias); 9 Oct 2013 07:40:10 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 9344 invoked by uid 89); 9 Oct 2013 07:40:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: nat28.tlf.novell.com Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 09 Oct 2013 07:40:10 +0000 Received: from EMEA1-MTA by nat28.tlf.novell.com with Novell_GroupWise; Wed, 09 Oct 2013 08:40:09 +0100 Message-Id: <5255247302000078000F9DE8@nat28.tlf.novell.com> Date: Wed, 09 Oct 2013 07:40:00 -0000 From: "Jan Beulich" To: "H.J. Lu" Cc: ,"Binutils" Subject: Re: [PATCH 6/6] x86/MPX: bndmk, bndldx, and bndstx don't allow RIP-relative addressing References: <5254349502000078000F9A3D@nat28.tlf.novell.com> <5254367002000078000F9A61@nat28.tlf.novell.com> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2013-10/txt/msg00109.txt.bz2 >>> On 08.10.13 at 18:13, "H.J. Lu" wrote: > On Tue, Oct 8, 2013 at 7:44 AM, Jan Beulich wrote: >> gas/ >> 2013-10-08 Jan Beulich >> >> * tc-i386.c (i386_index_check): Reject RIP-relative addressing f= or >> bndmk, bndldx, and bndstx. Warn about register scaling by other >> than 1 for bndldx and bndstx. >> >> --- 2013-10-07/gas/config/tc-i386.c >> +++ 2013-10-07/gas/config/tc-i386.c >> @@ -8360,6 +8375,25 @@ bad_address: >> || i.index_reg->reg_num =3D=3D RegEiz)) >> || !i.index_reg->reg_type.bitfield.baseindex))) >> goto bad_address; >> + >> + /* bndmk, bndldx, and bndstx have special restrictions. */ >> + if (current_templates->start->base_opcode =3D=3D 0xf30f1b >> + || (current_templates->start->base_opcode & ~1) =3D=3D 0x0= f1a) >> + { >> + /* They cannot use RIP-relative addressing. */ >> + if (i.base_reg >> + && i.base_reg->reg_num =3D=3D (addr_mode =3D=3D CODE_6= 4BIT ? RegRip >> + : R= egEip)) >> + { >> + as_bad (_("`%s' cannot be used here"), operand_string); >> + return 0; >> + } >=20 > RegEip should be disallowed much earlier since address size > prefix doesn't work for MPX. Only if that diagnostic gets converted back to an error, which I don't agree to so far. >> + /* bndldx and bndstx ignore their scale factor. */ >> + if (current_templates->start->base_opcode !=3D 0xf30f1b >> + && i.log2_scale_factor) >> + as_warn (_("register scaling is being ignored here")); >=20 > Scaling factor is still encoded. I am not sure if it belongs to assemble= r. That's why it's a warning - it's providing a hint to the programmer that what (s)he wrote makes no sense, but is being accepted. I wouldn't, however, mind hiding this one when quiet_warnings is set. Jan