From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20595 invoked by alias); 8 Oct 2013 14:41:39 -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 20583 invoked by uid 89); 8 Oct 2013 14:41:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_00,SPAM_SUBJECT,SPF_PASS autolearn=no 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; Tue, 08 Oct 2013 14:41:38 +0000 Received: from EMEA1-MTA by nat28.tlf.novell.com with Novell_GroupWise; Tue, 08 Oct 2013 15:41:34 +0100 Message-Id: <525435BC02000078000F9A51@nat28.tlf.novell.com> Date: Tue, 08 Oct 2013 14:41:00 -0000 From: "Jan Beulich" To: "H.J. Lu" Cc: , Subject: [PATCH 2/6] x86/MPX: fix address size handling References: <5254349502000078000F9A3D@nat28.tlf.novell.com> In-Reply-To: <5254349502000078000F9A3D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartFBC8F08C.2__=" X-SW-Source: 2013-10/txt/msg00070.txt.bz2 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartFBC8F08C.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 1222 While address overrides are ignored in 64-bit mode (and hence shouldn't result in an error), trying to use 16-bit addressing is documented to result in #UD, and hence the assembler should reject the attempt. gas/ 2013-10-08 Jan Beulich * tc-i386.c (md_assemble): Alter address size checking for MPX instructions. --- 2013-10-07/gas/config/tc-i386.c +++ 2013-10-07/gas/config/tc-i386.c @@ -3549,10 +3549,15 @@ md_assemble (char *line) if (i.bnd_prefix && !i.tm.opcode_modifier.bndprefixok) as_bad (_("expecting valid branch instruction after `bnd'")); =20 - if (i.tm.cpu_flags.bitfield.cpumpx - && flag_code =3D=3D CODE_64BIT - && i.prefix[ADDR_PREFIX]) - as_bad (_("32-bit address isn't allowed in 64-bit MPX instructions.")); + if (i.tm.cpu_flags.bitfield.cpumpx) + { + if (flag_code =3D=3D CODE_64BIT && i.prefix[ADDR_PREFIX]) + as_warn (_("32-bit addressing is ignored in 64-bit MPX instructions")); + else if (flag_code !=3D CODE_16BIT + ? i.prefix[ADDR_PREFIX] + : i.mem_operands && !i.prefix[ADDR_PREFIX]) + as_bad (_("16-bit addressing isn't allowed in MPX instructions")); + } =20 /* Insert BND prefix. */ if (add_bnd_prefix --=__PartFBC8F08C.2__= Content-Type: text/plain; name="binutils-mainline-x86-MPX-address-size.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="binutils-mainline-x86-MPX-address-size.patch" Content-length: 1219 While address overrides are ignored in 64-bit mode (and hence shouldn't result in an error), trying to use 16-bit addressing is documented to result in #UD, and hence the assembler should reject the attempt. gas/ 2013-10-08 Jan Beulich * tc-i386.c (md_assemble): Alter address size checking for MPX instructions. --- 2013-10-07/gas/config/tc-i386.c +++ 2013-10-07/gas/config/tc-i386.c @@ -3549,10 +3549,15 @@ md_assemble (char *line) if (i.bnd_prefix && !i.tm.opcode_modifier.bndprefixok) as_bad (_("expecting valid branch instruction after `bnd'")); =20 - if (i.tm.cpu_flags.bitfield.cpumpx - && flag_code =3D=3D CODE_64BIT - && i.prefix[ADDR_PREFIX]) - as_bad (_("32-bit address isn't allowed in 64-bit MPX instructions.")); + if (i.tm.cpu_flags.bitfield.cpumpx) + { + if (flag_code =3D=3D CODE_64BIT && i.prefix[ADDR_PREFIX]) + as_warn (_("32-bit addressing is ignored in 64-bit MPX instructions")); + else if (flag_code !=3D CODE_16BIT + ? i.prefix[ADDR_PREFIX] + : i.mem_operands && !i.prefix[ADDR_PREFIX]) + as_bad (_("16-bit addressing isn't allowed in MPX instructions")); + } =20 /* Insert BND prefix. */ if (add_bnd_prefix --=__PartFBC8F08C.2__=--