[RFC,1/2] x86: default to not accepting MPX insns

Message ID 2dec576a-3a21-4135-90f2-da34f4ee8960@suse.com
State New
Headers
Series x86: don't enable deprecated ISA extensions by default |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply

Commit Message

Jan Beulich Nov. 15, 2024, 10:58 a.m. UTC
  Gcc9 had MPX support removed. While we don't want to remove support,
require these deprecated insns (and registers) to be enabled explicitly.
---
Question is whether -madd-bnd-prefix should then also enable MPX.
  

Patch

--- a/gas/testsuite/gas/i386/bnd.l
+++ b/gas/testsuite/gas/i386/bnd.l
@@ -1,14 +1,12 @@ 
 .*: Assembler messages:
-.*:6: Error: .*`bndmov'.*
+.*:5: Error: .*`bndmov'.*
 GAS LISTING .*
 
 
 [ 	]*1[ 	]+\.text
 [ 	]*2[ 	]+\.intel_syntax noprefix
-[ 	]*3[ 	]+\.arch generic32
-[ 	]*4[ 	]+bnd:
-[ 	]*5[ 	]+\?\?\?\? A1000000[ 	]+mov	eax, bnd0
-[ 	]*5[ 	]+00
-[ 	]*6[ 	]+bndmov	bnd0, bnd0
-[ 	]*7[ 	]+\?\?\?\? 00000000 		\.p2align 4,0
-#...
+[ 	]*3[ 	]+bnd:
+[ 	]*4[ 	]+\?\?\?\? A1000000[ 	]+mov	eax, bnd0
+[ 	]*4[ 	]+00
+[ 	]*5[ 	]+bndmov	bnd0, bnd0
+#pass
--- a/gas/testsuite/gas/i386/bnd.s
+++ b/gas/testsuite/gas/i386/bnd.s
@@ -1,6 +1,5 @@ 
 	.text
 	.intel_syntax noprefix
-	.arch generic32
 bnd:
 	mov	eax, bnd0
 	bndmov	bnd0, bnd0
--- a/gas/testsuite/gas/i386/got.d
+++ b/gas/testsuite/gas/i386/got.d
@@ -1,4 +1,4 @@ 
-#as: -mrelax-relocations=yes
+#as: -mrelax-relocations=yes -march=+mpx
 #objdump: -dwr
 
 .*: +file format .*
--- a/gas/testsuite/gas/i386/got-no-relax.d
+++ b/gas/testsuite/gas/i386/got-no-relax.d
@@ -1,5 +1,5 @@ 
 #source: got.s
-#as: -mrelax-relocations=no
+#as: -mrelax-relocations=no -march=+mpx
 #objdump: -dwr
 
 .*: +file format .*
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -68,7 +68,7 @@  if [gas_32_check] then {
     run_dump_test "intelok"
     run_dump_test "intelok2"
     run_dump_test "prefix"
-    run_list_test "prefix32" "-al"
+    run_list_test "prefix32" "-al -march=+mpx"
     run_dump_test "insn-32"
     run_dump_test "lea"
     run_dump_test "lea16"
@@ -374,8 +374,8 @@  if [gas_32_check] then {
     run_dump_test "prefetch-intel"
     run_dump_test "smap"
     run_dump_test "mpx"
-    run_list_test "mpx-inval-1" "-al"
-    run_list_test "mpx-inval-2" "-al"
+    run_list_test "mpx-inval-1" "-al -march=+mpx"
+    run_list_test "mpx-inval-2" "-al -march=+mpx"
     run_dump_test "mpx-add-bnd-prefix"
     run_dump_test "mpx-16bit"
     run_list_test "bnd" "-al"
--- a/gas/testsuite/gas/i386/lfence-load.d
+++ b/gas/testsuite/gas/i386/lfence-load.d
@@ -1,4 +1,4 @@ 
-#as: -mlfence-after-load=yes
+#as: -mlfence-after-load=yes -march=+mpx
 #objdump: -dw
 #warning_output: lfence-load.e
 #name: -mlfence-after-load=yes
--- a/gas/testsuite/gas/i386/mpx.d
+++ b/gas/testsuite/gas/i386/mpx.d
@@ -1,3 +1,4 @@ 
+#as: -march=+mpx
 #objdump: -drw
 #name: i386 MPX
 
--- a/gas/testsuite/gas/i386/mpx-16bit.d
+++ b/gas/testsuite/gas/i386/mpx-16bit.d
@@ -1,4 +1,4 @@ 
-#as: -I${srcdir}/$subdir
+#as: -I${srcdir}/$subdir -march=+mpx
 #objdump: -drw -Mi8086
 #name: i386 MPX (16-bit)
 
--- a/gas/testsuite/gas/i386/mpx-add-bnd-prefix.d
+++ b/gas/testsuite/gas/i386/mpx-add-bnd-prefix.d
@@ -1,4 +1,4 @@ 
-#as: -madd-bnd-prefix
+#as: -madd-bnd-prefix -march=+mpx
 #warning_output: mpx-add-bnd-prefix.e
 #objdump: -drw
 #name: Check -madd-bnd-prefix
--- a/gas/testsuite/gas/i386/notrack.d
+++ b/gas/testsuite/gas/i386/notrack.d
@@ -1,4 +1,5 @@ 
 #objdump: -dw
+#as: -march=+mpx
 #name: i386 NOTRACK prefix
 
 .*: +file format .*
--- a/gas/testsuite/gas/i386/notrack-intel.d
+++ b/gas/testsuite/gas/i386/notrack-intel.d
@@ -1,5 +1,6 @@ 
 #source: notrack.s
 #objdump: -dw -Mintel
+#as: -march=+mpx
 #name: i386 NOTRACK prefix (Intel disassembly)
 
 .*: +file format .*
--- a/gas/testsuite/gas/i386/opts.d
+++ b/gas/testsuite/gas/i386/opts.d
@@ -1,4 +1,5 @@ 
 #objdump: -drwMsuffix
+#as: -march=+mpx
 #name: encoding option
 
 .*: +file format .*
--- a/gas/testsuite/gas/i386/opts-intel.d
+++ b/gas/testsuite/gas/i386/opts-intel.d
@@ -1,4 +1,5 @@ 
 #objdump: -drwMintel,suffix
+#as: -march=+mpx
 #name: encoding option (Intel mode)
 #source: opts.s
 
--- a/gas/testsuite/gas/i386/pseudos.d
+++ b/gas/testsuite/gas/i386/pseudos.d
@@ -1,4 +1,4 @@ 
-#as: -O0
+#as: -O0 -march=+mpx
 #objdump: -drw
 #name: pseudo prefixes
 
--- a/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d
+++ b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d
@@ -1,4 +1,4 @@ 
-#as: -J
+#as: -J -march=+mpx
 #source: ../x86-64-mpx-branch-1.s
 #objdump: -dwr
 #name: x86-64 MPX branch
--- a/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d
+++ b/gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d
@@ -1,4 +1,4 @@ 
-#as: -J -madd-bnd-prefix
+#as: -J -madd-bnd-prefix -march=+mpx
 #source: ../x86-64-mpx-branch-1.s
 #objdump: -dwr
 #name: x86-64 branch with BND prefix
--- a/gas/testsuite/gas/i386/sse2avx-opts.d
+++ b/gas/testsuite/gas/i386/sse2avx-opts.d
@@ -1,4 +1,4 @@ 
-#as: -msse2avx
+#as: -msse2avx -march=+mpx
 #objdump: -drwMsuffix
 #name: encoding option with -msse2avx
 #source: opts.s
--- a/gas/testsuite/gas/i386/sse2avx-opts-intel.d
+++ b/gas/testsuite/gas/i386/sse2avx-opts-intel.d
@@ -1,4 +1,4 @@ 
-#as: -msse2avx
+#as: -msse2avx -march=+mpx
 #objdump: -drwMintel,suffix
 #name: encoding option with -msse2avx (Intel mode)
 #source: opts.s
--- a/gas/testsuite/gas/i386/x86-64.exp
+++ b/gas/testsuite/gas/i386/x86-64.exp
@@ -168,7 +168,7 @@  run_list_test "x86-64-specific-reg"
 run_list_test "suffix-bad"
 run_list_test "x86-64-suffix-bad"
 run_list_test "unspec64" ""
-run_list_test "prefix64" "-al"
+run_list_test "prefix64" "-al -march=+mpx"
 run_list_test "oversized64" "-al --divide"
 run_dump_test "x86-64-fxsave"
 run_dump_test "x86-64-fxsave-intel"
@@ -303,8 +303,8 @@  run_dump_test "x86-64-prefetch"
 run_dump_test "x86-64-prefetch-intel"
 run_dump_test "x86-64-smap"
 run_dump_test "x86-64-mpx"
-run_list_test "x86-64-mpx-inval-1" "-al"
-run_list_test "x86-64-mpx-inval-2" "-al"
+run_list_test "x86-64-mpx-inval-1" "-al -march=+mpx"
+run_list_test "x86-64-mpx-inval-2" "-al -march=+mpx"
 run_dump_test "x86-64-mpx-addr32"
 run_dump_test "x86-64-mpx-add-bnd-prefix"
 run_dump_test "x86-64-sha"
--- a/gas/testsuite/gas/i386/x86-64-lfence-load.d
+++ b/gas/testsuite/gas/i386/x86-64-lfence-load.d
@@ -1,4 +1,4 @@ 
-#as: -mlfence-after-load=yes
+#as: -mlfence-after-load=yes -march=+mpx
 #objdump: -dw
 #warning_output: lfence-load.e
 #name: x86-64 -mlfence-after-load=yes
--- a/gas/testsuite/gas/i386/x86-64-mpx.d
+++ b/gas/testsuite/gas/i386/x86-64-mpx.d
@@ -1,3 +1,4 @@ 
+#as: -march=+mpx
 #objdump: -drw
 #name: x86-64 MPX
 
--- a/gas/testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.d
+++ b/gas/testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.d
@@ -1,4 +1,4 @@ 
-#as: -madd-bnd-prefix
+#as: -madd-bnd-prefix -march=+mpx
 #warning_output: x86-64-mpx-add-bnd-prefix.e
 #objdump: -drw
 #name: Check -madd-bnd-prefix (x86-64)
--- a/gas/testsuite/gas/i386/x86-64-mpx-addr32.d
+++ b/gas/testsuite/gas/i386/x86-64-mpx-addr32.d
@@ -1,3 +1,4 @@ 
+#as: -march=+mpx
 #objdump: -drw
 #name: x86-64 MPX addr32 tests
 
--- a/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d
+++ b/gas/testsuite/gas/i386/x86-64-mpx-branch-1.d
@@ -1,4 +1,4 @@ 
-#as: -J
+#as: -J -march=+mpx
 #objdump: -dwr
 #name: x86-64 MPX branch
 #notarget: *-*-solaris*
--- a/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d
+++ b/gas/testsuite/gas/i386/x86-64-mpx-branch-2.d
@@ -1,4 +1,4 @@ 
-#as: -J -madd-bnd-prefix
+#as: -J -madd-bnd-prefix -march=+mpx
 #objdump: -dwr
 #name: x86-64 branch with BND prefix
 #dump: x86-64-mpx-branch-1.d
--- a/gas/testsuite/gas/i386/x86-64-notrack.d
+++ b/gas/testsuite/gas/i386/x86-64-notrack.d
@@ -1,3 +1,4 @@ 
+#as: -march=+mpx
 #objdump: -dw
 #name: x86-64 NOTRACK prefix
 
--- a/gas/testsuite/gas/i386/x86-64-notrack-intel.d
+++ b/gas/testsuite/gas/i386/x86-64-notrack-intel.d
@@ -1,4 +1,5 @@ 
 #source: x86-64-notrack.s
+#as: -march=+mpx
 #objdump: -dw -Mintel
 #name: x86-64 NOTRACK prefix (Intel disassembly)
 
--- a/gas/testsuite/gas/i386/x86-64-pseudos.d
+++ b/gas/testsuite/gas/i386/x86-64-pseudos.d
@@ -1,4 +1,4 @@ 
-#as: -O0
+#as: -O0 -march=+mpx
 #objdump: -drw
 #name: x86-64 pseudo prefixes
 
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -45,7 +45,7 @@  typedef struct dependency
 static const dependency isa_dependencies[] =
 {
   { "UNKNOWN",
-    "~IAMCU" },
+    "~(IAMCU|MPX)" },
   { "GENERIC32",
     "386" },
   { "GENERIC64",