diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 397f664..0a2cf45 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -170,6 +170,21 @@ amd64_linux_fetch_inferior_registers (struct target_ops *ops,
 
 	  amd64_supply_fxsave (regcache, -1, &fpregs);
 	}
+
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+      {
+	/* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
+	   fs_base and gs_base fields of user_regs_struct can be
+	   used directly.  */
+	unsigned long base;
+	if ((regnum == -1 || regnum == AMD64_FSBASE_REGNUM)
+	    && ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_FS) == 0)
+	  regcache_raw_supply (regcache, AMD64_FSBASE_REGNUM, &base);
+	if ((regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
+	    && ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_GS) == 0)
+	  regcache_raw_supply (regcache, AMD64_GSBASE_REGNUM, &base);
+      }
+#endif
     }
 }
 
@@ -236,6 +251,27 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
 	  if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0)
 	    perror_with_name (_("Couldn't write floating point status"));
 	}
+
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+      {
+	/* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
+	   fs_base and gs_base fields of user_regs_struct can be
+	   used directly.  */
+	unsigned long base;
+	if (regnum == -1 || regnum == AMD64_FSBASE_REGNUM)
+	  {
+	    regcache_raw_collect (regcache, AMD64_FSBASE_REGNUM, &base);
+	    if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_SET_FS) < 0)
+	      perror_with_name (_("Couldn't write fs_base"));
+	  }
+	if (regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
+	  {
+	    regcache_raw_collect (regcache, AMD64_GSBASE_REGNUM, &base);
+	    if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_SET_GS) < 0)
+	      perror_with_name (_("Couldn't write gs_base"));
+	  }
+      }
+#endif
     }
 }
 
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 021dca6..575b937 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -102,6 +102,11 @@ int amd64_linux_gregset_reg_offset[] =
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
+#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+  21 * 8, 22 * 8,		/* fs_base, gs_base */
+#else
+  -1, -1,
+#endif
   15 * 8			      /* "orig_rax" */
 };
 
diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h
index a850fe1..63f41b5 100644
--- a/gdb/amd64-linux-tdep.h
+++ b/gdb/amd64-linux-tdep.h
@@ -26,7 +26,7 @@
 /* Register number for the "orig_rax" register.  If this register
    contains a value >= 0 it is interpreted as the system call number
    that the kernel is supposed to restart.  */
-#define AMD64_LINUX_ORIG_RAX_REGNUM (AMD64_ZMM31H_REGNUM + 1)
+#define AMD64_LINUX_ORIG_RAX_REGNUM (AMD64_NUM_REGS)
 
 /* Total number of registers for GNU/Linux.  */
 #define AMD64_LINUX_NUM_REGS (AMD64_LINUX_ORIG_RAX_REGNUM + 1)
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 6096ce9..6867a06 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2943,6 +2943,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 								    NULL };
   static const char *const stap_register_indirection_suffixes[] = { ")",
 								    NULL };
+  const struct tdesc_feature *feature;
 
   /* AMD64 generally uses `fxsave' instead of `fsave' for saving its
      floating-point registers.  */
@@ -2987,6 +2988,17 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
       tdep->bnd0r_regnum = AMD64_BND0R_REGNUM;
     }
 
+  feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.seg");
+  if (feature != NULL)
+    {
+      struct tdesc_arch_data *tdesc_data
+	= (struct tdesc_arch_data *) info.tdep_info;
+      tdesc_numbered_register (feature, tdesc_data,
+                               AMD64_FSBASE_REGNUM, "fs_base");
+      tdesc_numbered_register (feature, tdesc_data,
+                               AMD64_GSBASE_REGNUM, "gs_base");
+    }
+
   tdep->num_byte_regs = 20;
   tdep->num_word_regs = 16;
   tdep->num_dword_regs = 16;
diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h
index 704225e..92b74df 100644
--- a/gdb/amd64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -76,13 +76,15 @@ enum amd64_regnum
   AMD64_K0_REGNUM,
   AMD64_K7_REGNUM = AMD64_K0_REGNUM + 7,
   AMD64_ZMM0H_REGNUM,
-  AMD64_ZMM31H_REGNUM = AMD64_ZMM0H_REGNUM + 31
+  AMD64_ZMM31H_REGNUM = AMD64_ZMM0H_REGNUM + 31,
+  AMD64_FSBASE_REGNUM,
+  AMD64_GSBASE_REGNUM
 };
 
 /* Number of general purpose registers.  */
 #define AMD64_NUM_GREGS		24
 
-#define AMD64_NUM_REGS		(AMD64_ZMM31H_REGNUM + 1)
+#define AMD64_NUM_REGS		(AMD64_GSBASE_REGNUM + 1)
 
 extern struct target_desc *tdesc_amd64;
 
diff --git a/gdb/features/i386/64bit-seg.xml b/gdb/features/i386/64bit-seg.xml
new file mode 100644
index 0000000..7af63ee
--- /dev/null
+++ b/gdb/features/i386/64bit-seg.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2015 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.i386.seg">
+  <reg name="fs_base" bitsize="64" type="data_ptr"/>
+  <reg name="gs_base" bitsize="64" type="data_ptr"/>
+</feature>
diff --git a/gdb/features/i386/amd64-avx-linux.c b/gdb/features/i386/amd64-avx-linux.c
index ec419be..01e80a5 100644
--- a/gdb/features/i386/amd64-avx-linux.c
+++ b/gdb/features/i386/amd64-avx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_avx_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
 
   tdesc_amd64_avx_linux = result;
 }
diff --git a/gdb/features/i386/amd64-avx-linux.xml b/gdb/features/i386/amd64-avx-linux.xml
index 35be33f..5acfe53 100644
--- a/gdb/features/i386/amd64-avx-linux.xml
+++ b/gdb/features/i386/amd64-avx-linux.xml
@@ -14,5 +14,6 @@
   <xi:include href="64bit-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
   <xi:include href="64bit-avx.xml"/>
 </target>
diff --git a/gdb/features/i386/amd64-avx512-linux.c b/gdb/features/i386/amd64-avx512-linux.c
index 61a547f..f3a56b0 100644
--- a/gdb/features/i386/amd64-avx512-linux.c
+++ b/gdb/features/i386/amd64-avx512-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_avx512_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
   type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_amd64_avx512_linux (void)
   field_type = tdesc_named_type (feature, "_bndcfgu");
   tdesc_add_field (type, "config", field_type);
 
-  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
-  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+  tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+  tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
   field_type = tdesc_named_type (feature, "ieee_single");
@@ -245,78 +249,78 @@ initialize_tdesc_amd64_avx512_linux (void)
   field_type = tdesc_named_type (feature, "uint128");
   tdesc_create_vector (feature, "v2ui128", field_type, 2);
 
-  tdesc_create_reg (feature, "xmm16", 80, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm17", 81, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm18", 82, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm19", 83, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm20", 84, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm21", 85, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm22", 86, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm23", 87, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm24", 88, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm25", 89, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm26", 90, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm27", 91, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm28", 92, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm29", 93, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm30", 94, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm31", 95, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "ymm16h", 96, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm17h", 97, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm18h", 98, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm19h", 99, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm20h", 100, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm21h", 101, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm22h", 102, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm23h", 103, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm24h", 104, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm25h", 105, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm26h", 106, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm27h", 107, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm28h", 108, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm29h", 109, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm30h", 110, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm31h", 111, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "k0", 112, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k1", 113, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k2", 114, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k3", 115, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k4", 116, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k5", 117, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k6", 118, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k7", 119, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "zmm0h", 120, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm1h", 121, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm2h", 122, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm3h", 123, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm4h", 124, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm5h", 125, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm6h", 126, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm7h", 127, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm8h", 128, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm9h", 129, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm10h", 130, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm11h", 131, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm12h", 132, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm13h", 133, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm14h", 134, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm15h", 135, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm16h", 136, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm17h", 137, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm18h", 138, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm19h", 139, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm20h", 140, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm21h", 141, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm22h", 142, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm23h", 143, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm24h", 144, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm25h", 145, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm26h", 146, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm27h", 147, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm28h", 148, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm29h", 149, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm30h", 150, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm31h", 151, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "xmm16", 82, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm17", 83, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm18", 84, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm19", 85, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm20", 86, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm21", 87, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm22", 88, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm23", 89, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm24", 90, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm25", 91, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm26", 92, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm27", 93, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm28", 94, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm29", 95, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm30", 96, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm31", 97, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "ymm16h", 98, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm17h", 99, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm18h", 100, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm19h", 101, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm20h", 102, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm21h", 103, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm22h", 104, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm23h", 105, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm24h", 106, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm25h", 107, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm26h", 108, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm27h", 109, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm28h", 110, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm29h", 111, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm30h", 112, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm31h", 113, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "k0", 114, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k1", 115, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k2", 116, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k3", 117, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k4", 118, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k5", 119, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k6", 120, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k7", 121, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "zmm0h", 122, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm1h", 123, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm2h", 124, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm3h", 125, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm4h", 126, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm5h", 127, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm6h", 128, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm7h", 129, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm8h", 130, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm9h", 131, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm10h", 132, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm11h", 133, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm12h", 134, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm13h", 135, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm14h", 136, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm15h", 137, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm16h", 138, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm17h", 139, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm18h", 140, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm19h", 141, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm20h", 142, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm21h", 143, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm22h", 144, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm23h", 145, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm24h", 146, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm25h", 147, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm26h", 148, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm27h", 149, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm28h", 150, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm29h", 151, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm30h", 152, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm31h", 153, 1, NULL, 256, "v2ui128");
 
   tdesc_amd64_avx512_linux = result;
 }
diff --git a/gdb/features/i386/amd64-avx512-linux.xml b/gdb/features/i386/amd64-avx512-linux.xml
index a1878a4..c228388 100644
--- a/gdb/features/i386/amd64-avx512-linux.xml
+++ b/gdb/features/i386/amd64-avx512-linux.xml
@@ -14,6 +14,7 @@
   <xi:include href="64bit-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
   <xi:include href="64bit-avx.xml"/>
   <xi:include href="64bit-mpx.xml"/>
   <xi:include href="64bit-avx512.xml"/>
diff --git a/gdb/features/i386/amd64-linux.c b/gdb/features/i386/amd64-linux.c
index 8cbf4bf..53b20f2 100644
--- a/gdb/features/i386/amd64-linux.c
+++ b/gdb/features/i386/amd64-linux.c
@@ -151,5 +151,9 @@ initialize_tdesc_amd64_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   tdesc_amd64_linux = result;
 }
diff --git a/gdb/features/i386/amd64-linux.xml b/gdb/features/i386/amd64-linux.xml
index e4f5545..5d0b13a 100644
--- a/gdb/features/i386/amd64-linux.xml
+++ b/gdb/features/i386/amd64-linux.xml
@@ -14,4 +14,5 @@
   <xi:include href="64bit-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
 </target>
diff --git a/gdb/features/i386/amd64-mpx-linux.c b/gdb/features/i386/amd64-mpx-linux.c
index 86a1774..4855e0d 100644
--- a/gdb/features/i386/amd64-mpx-linux.c
+++ b/gdb/features/i386/amd64-mpx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_mpx_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
   type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_amd64_mpx_linux (void)
   field_type = tdesc_named_type (feature, "_bndcfgu");
   tdesc_add_field (type, "config", field_type);
 
-  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
-  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+  tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+  tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
 
   tdesc_amd64_mpx_linux = result;
 }
diff --git a/gdb/features/i386/amd64-mpx-linux.xml b/gdb/features/i386/amd64-mpx-linux.xml
index 6ed4d1d..bd4552f 100644
--- a/gdb/features/i386/amd64-mpx-linux.xml
+++ b/gdb/features/i386/amd64-mpx-linux.xml
@@ -14,6 +14,7 @@
   <xi:include href="64bit-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
   <xi:include href="64bit-avx.xml"/>
   <xi:include href="64bit-mpx.xml"/>
 </target>
diff --git a/gdb/features/i386/x32-avx-linux.c b/gdb/features/i386/x32-avx-linux.c
index 1f39610..e58af55 100644
--- a/gdb/features/i386/x32-avx-linux.c
+++ b/gdb/features/i386/x32-avx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_x32_avx_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
 
   tdesc_x32_avx_linux = result;
 }
diff --git a/gdb/features/i386/x32-avx-linux.xml b/gdb/features/i386/x32-avx-linux.xml
index 51e6a20..5c2e46f 100644
--- a/gdb/features/i386/x32-avx-linux.xml
+++ b/gdb/features/i386/x32-avx-linux.xml
@@ -14,5 +14,6 @@
   <xi:include href="x32-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
   <xi:include href="64bit-avx.xml"/>
 </target>
diff --git a/gdb/features/i386/x32-avx512-linux.c b/gdb/features/i386/x32-avx512-linux.c
index 0f835d4..a8036c1 100644
--- a/gdb/features/i386/x32-avx512-linux.c
+++ b/gdb/features/i386/x32-avx512-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_x32_avx512_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
   type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_x32_avx512_linux (void)
   field_type = tdesc_named_type (feature, "_bndcfgu");
   tdesc_add_field (type, "config", field_type);
 
-  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
-  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
-  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+  tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+  tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+  tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
   field_type = tdesc_named_type (feature, "ieee_single");
@@ -245,78 +249,78 @@ initialize_tdesc_x32_avx512_linux (void)
   field_type = tdesc_named_type (feature, "uint128");
   tdesc_create_vector (feature, "v2ui128", field_type, 2);
 
-  tdesc_create_reg (feature, "xmm16", 80, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm17", 81, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm18", 82, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm19", 83, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm20", 84, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm21", 85, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm22", 86, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm23", 87, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm24", 88, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm25", 89, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm26", 90, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm27", 91, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm28", 92, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm29", 93, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm30", 94, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "xmm31", 95, 1, NULL, 128, "vec128");
-  tdesc_create_reg (feature, "ymm16h", 96, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm17h", 97, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm18h", 98, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm19h", 99, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm20h", 100, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm21h", 101, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm22h", 102, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm23h", 103, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm24h", 104, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm25h", 105, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm26h", 106, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm27h", 107, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm28h", 108, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm29h", 109, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm30h", 110, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "ymm31h", 111, 1, NULL, 128, "uint128");
-  tdesc_create_reg (feature, "k0", 112, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k1", 113, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k2", 114, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k3", 115, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k4", 116, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k5", 117, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k6", 118, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "k7", 119, 1, NULL, 64, "uint64");
-  tdesc_create_reg (feature, "zmm0h", 120, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm1h", 121, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm2h", 122, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm3h", 123, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm4h", 124, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm5h", 125, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm6h", 126, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm7h", 127, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm8h", 128, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm9h", 129, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm10h", 130, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm11h", 131, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm12h", 132, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm13h", 133, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm14h", 134, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm15h", 135, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm16h", 136, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm17h", 137, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm18h", 138, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm19h", 139, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm20h", 140, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm21h", 141, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm22h", 142, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm23h", 143, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm24h", 144, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm25h", 145, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm26h", 146, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm27h", 147, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm28h", 148, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm29h", 149, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm30h", 150, 1, NULL, 256, "v2ui128");
-  tdesc_create_reg (feature, "zmm31h", 151, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "xmm16", 82, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm17", 83, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm18", 84, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm19", 85, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm20", 86, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm21", 87, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm22", 88, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm23", 89, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm24", 90, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm25", 91, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm26", 92, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm27", 93, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm28", 94, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm29", 95, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm30", 96, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "xmm31", 97, 1, NULL, 128, "vec128");
+  tdesc_create_reg (feature, "ymm16h", 98, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm17h", 99, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm18h", 100, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm19h", 101, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm20h", 102, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm21h", 103, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm22h", 104, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm23h", 105, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm24h", 106, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm25h", 107, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm26h", 108, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm27h", 109, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm28h", 110, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm29h", 111, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm30h", 112, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "ymm31h", 113, 1, NULL, 128, "uint128");
+  tdesc_create_reg (feature, "k0", 114, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k1", 115, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k2", 116, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k3", 117, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k4", 118, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k5", 119, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k6", 120, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "k7", 121, 1, NULL, 64, "uint64");
+  tdesc_create_reg (feature, "zmm0h", 122, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm1h", 123, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm2h", 124, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm3h", 125, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm4h", 126, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm5h", 127, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm6h", 128, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm7h", 129, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm8h", 130, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm9h", 131, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm10h", 132, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm11h", 133, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm12h", 134, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm13h", 135, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm14h", 136, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm15h", 137, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm16h", 138, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm17h", 139, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm18h", 140, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm19h", 141, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm20h", 142, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm21h", 143, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm22h", 144, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm23h", 145, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm24h", 146, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm25h", 147, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm26h", 148, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm27h", 149, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm28h", 150, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm29h", 151, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm30h", 152, 1, NULL, 256, "v2ui128");
+  tdesc_create_reg (feature, "zmm31h", 153, 1, NULL, 256, "v2ui128");
 
   tdesc_x32_avx512_linux = result;
 }
diff --git a/gdb/features/i386/x32-avx512-linux.xml b/gdb/features/i386/x32-avx512-linux.xml
index bdc7b2f..f1d95d6 100644
--- a/gdb/features/i386/x32-avx512-linux.xml
+++ b/gdb/features/i386/x32-avx512-linux.xml
@@ -14,6 +14,7 @@
   <xi:include href="x32-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
   <xi:include href="64bit-avx.xml"/>
   <xi:include href="64bit-mpx.xml"/>
   <xi:include href="64bit-avx512.xml"/>
diff --git a/gdb/features/i386/x32-linux.c b/gdb/features/i386/x32-linux.c
index 387436f..cb43ebb 100644
--- a/gdb/features/i386/x32-linux.c
+++ b/gdb/features/i386/x32-linux.c
@@ -151,5 +151,9 @@ initialize_tdesc_x32_linux (void)
   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
 
+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.seg");
+  tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "data_ptr");
+  tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "data_ptr");
+
   tdesc_x32_linux = result;
 }
diff --git a/gdb/features/i386/x32-linux.xml b/gdb/features/i386/x32-linux.xml
index feb1571..e7a86e6 100644
--- a/gdb/features/i386/x32-linux.xml
+++ b/gdb/features/i386/x32-linux.xml
@@ -14,4 +14,5 @@
   <xi:include href="x32-core.xml"/>
   <xi:include href="64bit-sse.xml"/>
   <xi:include href="64bit-linux.xml"/>
+  <xi:include href="64bit-seg.xml"/>
 </target>
diff --git a/gdb/regformats/i386/amd64-avx-linux.dat b/gdb/regformats/i386/amd64-avx-linux.dat
index d8199da..7780b3b 100644
--- a/gdb/regformats/i386/amd64-avx-linux.dat
+++ b/gdb/regformats/i386/amd64-avx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
 128:ymm0h
 128:ymm1h
 128:ymm2h
diff --git a/gdb/regformats/i386/amd64-avx512-linux.dat b/gdb/regformats/i386/amd64-avx512-linux.dat
index dfc41e2..f1658d3 100644
--- a/gdb/regformats/i386/amd64-avx512-linux.dat
+++ b/gdb/regformats/i386/amd64-avx512-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
 128:ymm0h
 128:ymm1h
 128:ymm2h
diff --git a/gdb/regformats/i386/amd64-linux.dat b/gdb/regformats/i386/amd64-linux.dat
index 6914cc4..cd16a15 100644
--- a/gdb/regformats/i386/amd64-linux.dat
+++ b/gdb/regformats/i386/amd64-linux.dat
@@ -61,3 +61,5 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
diff --git a/gdb/regformats/i386/amd64-mpx-linux.dat b/gdb/regformats/i386/amd64-mpx-linux.dat
index 7a05cfe..32bcce1 100644
--- a/gdb/regformats/i386/amd64-mpx-linux.dat
+++ b/gdb/regformats/i386/amd64-mpx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
 128:ymm0h
 128:ymm1h
 128:ymm2h
diff --git a/gdb/regformats/i386/x32-avx-linux.dat b/gdb/regformats/i386/x32-avx-linux.dat
index a2b8d02..eb0e3953 100644
--- a/gdb/regformats/i386/x32-avx-linux.dat
+++ b/gdb/regformats/i386/x32-avx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
 128:ymm0h
 128:ymm1h
 128:ymm2h
diff --git a/gdb/regformats/i386/x32-avx512-linux.dat b/gdb/regformats/i386/x32-avx512-linux.dat
index 0f5b2ce..0b7f73a 100644
--- a/gdb/regformats/i386/x32-avx512-linux.dat
+++ b/gdb/regformats/i386/x32-avx512-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
 128:ymm0h
 128:ymm1h
 128:ymm2h
diff --git a/gdb/regformats/i386/x32-linux.dat b/gdb/regformats/i386/x32-linux.dat
index d976a25..eee378f 100644
--- a/gdb/regformats/i386/x32-linux.dat
+++ b/gdb/regformats/i386/x32-linux.dat
@@ -61,3 +61,5 @@ expedite:rbp,rsp,rip
 128:xmm15
 32:mxcsr
 64:orig_rax
+64:fs_base
+64:gs_base
