* [PATCH 32 1/2] core: Consume the new .note section that contains descriptions of xsave layout
2025-12-08 8:38 [PATCH 32 0/2] Handle the new .note section introduced in Linux Vignesh Balasubramanian
@ 2025-12-08 8:38 ` Vignesh Balasubramanian
2025-12-08 8:38 ` [PATCH 32 2/2] gcore: Create a new .note section for x86 Vignesh Balasubramanian
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Vignesh Balasubramanian @ 2025-12-08 8:38 UTC (permalink / raw)
To: gdb-patches, jinisusan.george, christina.schimpe,
AlokKumar.Sharma, jhb, simark
Cc: Vignesh Balasubramanian
Currently, we use some heuristics [1] to find the offsets of the xsave features
present in the xsave layouts of core files using XCR0 value.
While GDB can currently access the values of AVX-512 and PKRU registers on
AMD and Intel CPUs using existing heuristics, this approach may fail if the
XSAVE register offsets vary — even with the same XCR0 value.
Additionally, the current implementation may not scale effectively if a new
XSAVE state is introduced that matches the size of the existing states.
Linux kernel from 6.12 [2] creates a new .note section "NT_X86_XSAVE_LAYOUT"
which contains information on the size, offset and flags of each
xsave feature present when core is dumped.
[1] https://github.com/bminor/binutils-gdb/commit/c689d1fe58b2c0faf51e4f574d50271f1d0648e3
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kernel/fpu/xstate.c?id=ba386777a30b38dabcc7fb8a89ec2869a09915f7
Co-Authored-By: Jini Susan George <jinisusan.george@amd.com>
V2 -> V3:
Removed "struct x86_xfeat_component" and used "extract_unsigned_integer".
"if conditions" of i386_linux_core_read_xsave_info is modified.
Renamed macro "X86_XSTATE_TILE_DATA " and X86_XSTATE_PASID".
Some NITs
---
gdb/amd64-linux-tdep.c | 2 +-
gdb/i386-linux-tdep.c | 25 +++++++++---
gdb/i386-linux-tdep.h | 3 +-
gdb/i387-tdep.c | 86 +++++++++++++++++++++++++++++++++++++++++
gdb/i387-tdep.h | 12 ++++++
gdbsupport/x86-xstate.h | 4 ++
6 files changed, 124 insertions(+), 8 deletions(-)
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 284c956cd9b..393c0fd2adc 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1614,7 +1614,7 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
{
/* Linux/x86-64. */
x86_xsave_layout layout;
- uint64_t xstate_bv = i386_linux_core_read_xsave_info (abfd, layout);
+ uint64_t xstate_bv = i386_linux_core_read_xsave_info (gdbarch, abfd, layout);
if (xstate_bv == 0)
xstate_bv = X86_XSTATE_SSE_MASK;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 1d6abe2f546..8a7f416fb66 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -1077,7 +1077,8 @@ static int i386_linux_sc_reg_offset[] =
/* See i386-linux-tdep.h. */
uint64_t
-i386_linux_core_read_xsave_info (bfd *abfd, x86_xsave_layout &layout)
+i386_linux_core_read_xsave_info (struct gdbarch *gdbarch, bfd *abfd,
+ x86_xsave_layout &layout)
{
asection *xstate = bfd_get_section_by_name (abfd, ".reg-xstate");
if (xstate == nullptr)
@@ -1099,10 +1100,22 @@ i386_linux_core_read_xsave_info (bfd *abfd, x86_xsave_layout &layout)
uint64_t xcr0 = bfd_get_64 (abfd, contents);
- if (!i387_guess_xsave_layout (xcr0, size, layout))
- return 0;
+ /* Try using the note describing the XSAVE layout, if present. */
+ if (asection *xsave_layout_desc
+ = bfd_get_section_by_name (abfd, ".reg-xsave-layout");
+ xsave_layout_desc != nullptr)
+ {
+ if (i387_read_xsave_layout_desc (gdbarch, abfd, size,
+ layout, xsave_layout_desc))
+ return xcr0;
+ }
- return xcr0;
+ /* Otherwise, fallback to guessing the layout based on the size of the XSAVE
+ buffer. */
+ if (i387_guess_xsave_layout (xcr0, size, layout))
+ return xcr0;
+
+ return 0;
}
/* See i386-linux-tdep.h. */
@@ -1111,7 +1124,7 @@ bool
i386_linux_core_read_x86_xsave_layout (struct gdbarch *gdbarch, bfd &cbfd,
x86_xsave_layout &layout)
{
- return i386_linux_core_read_xsave_info (&cbfd, layout) != 0;
+ return i386_linux_core_read_xsave_info (gdbarch, &cbfd, layout) != 0;
}
/* See arch/x86-linux-tdesc.h. */
@@ -1131,7 +1144,7 @@ i386_linux_core_read_description (struct gdbarch *gdbarch,
{
/* Linux/i386. */
x86_xsave_layout layout;
- uint64_t xcr0 = i386_linux_core_read_xsave_info (abfd, layout);
+ uint64_t xcr0 = i386_linux_core_read_xsave_info (gdbarch, abfd, layout);
if (xcr0 == 0)
{
diff --git a/gdb/i386-linux-tdep.h b/gdb/i386-linux-tdep.h
index e75e53aba95..73c3729e885 100644
--- a/gdb/i386-linux-tdep.h
+++ b/gdb/i386-linux-tdep.h
@@ -58,7 +58,8 @@ enum i386_linux_regnum
Otherwise, return 0 to indicate no state was found and leave LAYOUT
untouched. */
-extern uint64_t i386_linux_core_read_xsave_info (bfd *abfd,
+extern uint64_t i386_linux_core_read_xsave_info (struct gdbarch *gdbarch,
+ bfd *abfd,
x86_xsave_layout &layout);
/* Implement the core_read_x86_xsave_layout gdbarch method. */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index ff66712ed0d..f6bee42fc7d 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -959,6 +959,92 @@ i387_guess_xsave_layout (uint64_t xcr0, size_t xsave_size,
/* See i387-tdep.h. */
+bool
+i387_read_xsave_layout_desc (struct gdbarch *gdbarch, bfd *abfd,
+ size_t xsave_size,
+ x86_xsave_layout &layout,
+ asection* xsave_layout_desc)
+{
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ gdb_byte *buf = (gdb_byte *) xmalloc(bfd_section_size(xsave_layout_desc));
+
+ if (!bfd_get_section_contents (abfd, xsave_layout_desc, buf, 0,
+ xsave_layout_desc->size))
+ {
+ warning (_("Couldn't read XSAVE Layout description records from"
+ "'.reg-xsave-layout' section in core file."));
+ return false;
+ }
+
+ /* This note section in linux is an array of below struct:
+ struct x86_xfeat_component
+ {
+ uint32_t type;
+ uint32_t size;
+ uint32_t offset;
+ uint32_t flags;
+ };
+ 16 bytes for each record.
+ We are interested in type (0th byte) and offset (8th byte). */
+
+ #define SIZEOF_XFEAT_TYPE 4
+ #define SIZEOF_XFEAT_OFFSET 4
+ #define OFFSET_AT_RECORD 8
+ #define SIZE_OF_RECORD 16
+
+ for (int i = 0; i < xsave_layout_desc->size; )
+ {
+ switch (extract_unsigned_integer(buf + i, SIZEOF_XFEAT_TYPE, byte_order))
+ {
+ case X86_XSTATE_AVX_ID:
+ layout.avx_offset = extract_unsigned_integer(buf + (i + OFFSET_AT_RECORD),
+ SIZEOF_XFEAT_OFFSET,
+ byte_order);
+ break;
+ case X86_XSTATE_BNDREGS_ID:
+ case X86_XSTATE_BNDCFG_ID:
+ /* MPX support in GDB is deprecated from GDB 15.2 Release. */
+ continue;
+ case X86_XSTATE_K_ID:
+ layout.k_offset = extract_unsigned_integer(buf + (i + OFFSET_AT_RECORD),
+ SIZEOF_XFEAT_OFFSET,
+ byte_order);
+ break;
+ case X86_XSTATE_ZMM_H_ID:
+ layout.zmm_h_offset = extract_unsigned_integer(buf + (i + OFFSET_AT_RECORD),
+ SIZEOF_XFEAT_OFFSET,
+ byte_order);
+ break;
+ case X86_XSTATE_ZMM_ID:
+ layout.zmm_offset = extract_unsigned_integer(buf + (i + OFFSET_AT_RECORD),
+ SIZEOF_XFEAT_OFFSET,
+ byte_order);
+ break;
+ case X86_XSTATE_PKRU_ID:
+ layout.pkru_offset = extract_unsigned_integer(buf + (i + OFFSET_AT_RECORD),
+ SIZEOF_XFEAT_OFFSET,
+ byte_order);
+ break;
+ case X86_XSTATE_PASID_ID ... X86_XSTATE_TILEDATA_ID:
+ /* These IDs are not part of x86_xsave_layout currently,
+ so we ignore. */
+ continue;
+ default:
+ /* 19 - 31 are reserved, shouldn't be any record with these IDs. */
+ warning (_("Unhandled xsave feature record type."));
+ break;
+ }
+
+ i += SIZE_OF_RECORD;
+ }
+
+ xfree (buf);
+ layout.sizeof_xsave = xsave_size;
+ return true;
+}
+
+/* See i387-tdep.h. */
+
x86_xsave_layout
i387_fallback_xsave_layout (uint64_t xcr0)
{
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h
index ed4df1d2458..becbed92260 100644
--- a/gdb/i387-tdep.h
+++ b/gdb/i387-tdep.h
@@ -139,6 +139,18 @@ extern void i387_supply_fxsave (struct regcache *regcache, int regnum,
extern bool i387_guess_xsave_layout (uint64_t xcr0, size_t xsave_size,
x86_xsave_layout &layout);
+/* Read offsets of xsave features in XSAVE Layout from the .note
+ section generated by Linux.
+ This .note section contains offset and size information of xsave
+ feature present in the machine where core file is dumped and it helps
+ to avoid guessing or hardcoding the offsets.
+ This feature is available from Linux 6.12. */
+
+extern bool i387_read_xsave_layout_desc (struct gdbarch *gdbarch, bfd *abfd,
+ size_t xsave_size,
+ x86_xsave_layout &layout,
+ asection *xsave_layout_desc);
+
/* Compute an XSAVE layout based on the XCR0 bitmask. This is used
as a fallback if a target does not provide an XSAVE layout. */
diff --git a/gdbsupport/x86-xstate.h b/gdbsupport/x86-xstate.h
index 6657c450c88..a9ab39152ad 100644
--- a/gdbsupport/x86-xstate.h
+++ b/gdbsupport/x86-xstate.h
@@ -24,11 +24,15 @@
#define X86_XSTATE_X87_ID 0
#define X86_XSTATE_SSE_ID 1
#define X86_XSTATE_AVX_ID 2
+#define X86_XSTATE_BNDREGS_ID 3
+#define X86_XSTATE_BNDCFG_ID 4
#define X86_XSTATE_K_ID 5
#define X86_XSTATE_ZMM_H_ID 6
#define X86_XSTATE_ZMM_ID 7
#define X86_XSTATE_PKRU_ID 9
+#define X86_XSTATE_PASID_ID 10
#define X86_XSTATE_CET_U_ID 11
+#define X86_XSTATE_TILEDATA_ID 18
/* The extended state feature bits. */
#define X86_XSTATE_X87 (1ULL << X86_XSTATE_X87_ID)
--
2.34.1
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 32 2/2] gcore: Create a new .note section for x86
2025-12-08 8:38 [PATCH 32 0/2] Handle the new .note section introduced in Linux Vignesh Balasubramanian
2025-12-08 8:38 ` [PATCH 32 1/2] core: Consume the new .note section that contains descriptions of xsave layout Vignesh Balasubramanian
@ 2025-12-08 8:38 ` Vignesh Balasubramanian
2025-12-14 13:39 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
2026-03-16 12:59 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
3 siblings, 0 replies; 13+ messages in thread
From: Vignesh Balasubramanian @ 2025-12-08 8:38 UTC (permalink / raw)
To: gdb-patches, jinisusan.george, christina.schimpe,
AlokKumar.Sharma, jhb, simark
Cc: Vignesh Balasubramanian
This new .note section contains the offset and size information of the
xsave features present in the machine where the core file is dumped.
It helps to avoid reliance on predetermined and possibly incorrect
offsets of the xsave features.
Please refer the linux commit below for further details.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kernel/fpu/xstate.c?id=ba386777a30b38dabcc7fb8a89ec2869a09915f7
Co-Authored-By: Jini Susan George <jinisusan.george@amd.com>
V2 -> V3:
Removed malloc in "form_x86_xsave_cpuid_records" and used the vector instead.
Some NITs
---
gdb/gcore-elf.c | 18 ++++++++++++++++++
gdb/gcore-elf.h | 8 ++++++++
gdb/linux-tdep.c | 1 +
gdb/nat/x86-xstate.c | 31 +++++++++++++++++++++++++++++++
gdb/nat/x86-xstate.h | 6 ++++++
gdb/target-debug.h | 6 ++++++
gdb/target-delegates-gen.c | 26 ++++++++++++++++++++++++++
gdb/target.c | 5 +++++
gdb/target.h | 10 ++++++++++
gdb/x86-linux-nat.c | 6 ++++++
gdb/x86-linux-nat.h | 1 +
gdbsupport/x86-xstate.h | 2 ++
12 files changed, 120 insertions(+)
diff --git a/gdb/gcore-elf.c b/gdb/gcore-elf.c
index 1e4376dab5e..33ee306ca6a 100644
--- a/gdb/gcore-elf.c
+++ b/gdb/gcore-elf.c
@@ -162,3 +162,21 @@ gcore_elf_make_tdesc_note (struct gdbarch *gdbarch, bfd *obfd,
tdesc_len));
}
}
+
+/* See gcore-elf.h. */
+
+void
+gcore_elf_make_target_specific_note (struct gdbarch *gdbarch, bfd *obfd,
+ gdb::unique_xmalloc_ptr<char> *note_data,
+ int *note_size)
+{
+ std::vector<uint32_t> data = target_specific_core_note ();
+
+ if (!data.empty ())
+ note_data->reset (elfcore_write_register_note (obfd,
+ note_data->release (),
+ note_size,
+ ".reg-xsave-layout",
+ data.data(),
+ data.size() * sizeof (data[0])));
+}
diff --git a/gdb/gcore-elf.h b/gdb/gcore-elf.h
index c43d0df741e..394e9195141 100644
--- a/gdb/gcore-elf.h
+++ b/gdb/gcore-elf.h
@@ -45,4 +45,12 @@ extern void gcore_elf_make_tdesc_note
(struct gdbarch *gdbarch, bfd *obfd,
gdb::unique_xmalloc_ptr<char> *note_data, int *note_size);
+/* Add content to *NOTE_DATA (and update *NOTE_SIZE) to include a note
+ containing the description of XSAVE Layout. */
+
+extern void gcore_elf_make_target_specific_note
+ (struct gdbarch *gdbarch, bfd *obfd,
+ gdb::unique_xmalloc_ptr<char> *note_data,
+ int *note_size);
+
#endif /* GDB_GCORE_ELF_H */
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 10843613c5d..cfebffc1206 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -2447,6 +2447,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
per-thread tdesc, so just emit the tdesc for the signalled thread. */
gdbarch = target_thread_architecture (signalled_thr->ptid);
gcore_elf_make_tdesc_note (gdbarch, obfd, ¬e_data, note_size);
+ gcore_elf_make_target_specific_note (gdbarch, obfd, ¬e_data, note_size);
return note_data;
}
diff --git a/gdb/nat/x86-xstate.c b/gdb/nat/x86-xstate.c
index 6f2dfde9448..e7a42952ee5 100644
--- a/gdb/nat/x86-xstate.c
+++ b/gdb/nat/x86-xstate.c
@@ -62,3 +62,34 @@ x86_fetch_xsave_layout (uint64_t xcr0, int len)
layout.pkru_offset = xsave_feature_offset (xcr0, X86_XSTATE_PKRU_ID);
return layout;
}
+
+/* See x86-xstate.h. */
+
+std::vector<uint32_t>
+form_x86_xsave_cpuid_records ()
+{
+ uint32_t ax = 0, bx = 0, cx = 0, dx = 0;
+ int features_present = 0;
+ std::vector<uint32_t> data;
+
+ if (x86_cpuid_count (0xd, 0, &ax, &bx, &cx, &dx))
+ features_present = ax;
+
+ for (int i = 2; i < MAX_XSAVE_CPUID_RECORDS; i++)
+ if (features_present & (1U << i))
+ {
+ if (x86_cpuid_count (0xd, i, &ax, &bx, &cx, &dx))
+ {
+ data.push_back (i);
+ data.push_back (ax);
+ data.push_back (bx);
+ data.push_back (cx);
+ }
+ ax = 0;
+ bx = 0;
+ cx = 0;
+ dx = 0;
+ }
+
+ return data;
+}
diff --git a/gdb/nat/x86-xstate.h b/gdb/nat/x86-xstate.h
index 0046ab8dc78..25dc686d472 100644
--- a/gdb/nat/x86-xstate.h
+++ b/gdb/nat/x86-xstate.h
@@ -32,4 +32,10 @@ int x86_xsave_length ();
x86_xsave_layout x86_fetch_xsave_layout (uint64_t xcr0, int len);
+/* Form a array of records for each XSAVE feature present containing
+ its type, size, offset and flags via CPUID. These will make a .note
+ section in core file. */
+
+std::vector<uint32_t> form_x86_xsave_cpuid_records ();
+
#endif /* GDB_NAT_X86_XSTATE_H */
diff --git a/gdb/target-debug.h b/gdb/target-debug.h
index 3e41e986b6c..a2e04a7b218 100644
--- a/gdb/target-debug.h
+++ b/gdb/target-debug.h
@@ -195,6 +195,12 @@ target_debug_print_std_vector_static_tracepoint_marker
(const std::vector<static_tracepoint_marker> &vec)
{ return host_address_to_string (vec.data ()); }
+
+static std::string
+target_debug_print_std_vector_uint32_t
+ (const std::vector<uint32_t> &vec)
+{ return host_address_to_string (vec.data ()); }
+
static std::string
target_debug_print_const_target_desc_p (const target_desc *tdesc)
{ return host_address_to_string (tdesc); }
diff --git a/gdb/target-delegates-gen.c b/gdb/target-delegates-gen.c
index 33124864b6d..ddd3185612f 100644
--- a/gdb/target-delegates-gen.c
+++ b/gdb/target-delegates-gen.c
@@ -132,6 +132,7 @@ struct dummy_target : public target_ops
bool supports_evaluation_of_breakpoint_conditions () override;
bool supports_dumpcore () override;
void dumpcore (const char *arg0) override;
+ std::vector<uint32_t> specific_core_note () override;
bool can_run_breakpoint_commands () override;
struct gdbarch *thread_architecture (ptid_t arg0) override;
bool filesystem_is_local () override;
@@ -313,6 +314,7 @@ struct debug_target : public target_ops
bool supports_evaluation_of_breakpoint_conditions () override;
bool supports_dumpcore () override;
void dumpcore (const char *arg0) override;
+ std::vector<uint32_t> specific_core_note () override;
bool can_run_breakpoint_commands () override;
struct gdbarch *thread_architecture (ptid_t arg0) override;
bool filesystem_is_local () override;
@@ -2836,6 +2838,30 @@ debug_target::dumpcore (const char *arg0)
target_debug_print_const_char_p (arg0).c_str ());
}
+std::vector<uint32_t>
+target_ops::specific_core_note ()
+{
+ return this->beneath ()->specific_core_note ();
+}
+
+std::vector<uint32_t>
+dummy_target::specific_core_note ()
+{
+ return std::vector<uint32_t> ();
+}
+
+std::vector<uint32_t>
+debug_target::specific_core_note ()
+{
+ target_debug_printf_nofunc ("-> %s->specific_core_note (...)", this->beneath ()->shortname ());
+ std::vector<uint32_t> result
+ = this->beneath ()->specific_core_note ();
+ target_debug_printf_nofunc ("<- %s->specific_core_note () = %s",
+ this->beneath ()->shortname (),
+ target_debug_print_std_vector_uint32_t (result).c_str ());
+ return result;
+}
+
bool
target_ops::can_run_breakpoint_commands ()
{
diff --git a/gdb/target.c b/gdb/target.c
index 05944319e26..86cb6280c11 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -261,6 +261,11 @@ target_dumpcore (const char *filename)
return current_inferior ()->top_target ()->dumpcore (filename);
}
+std::vector<uint32_t>
+target_specific_core_note ()
+{
+ return current_inferior ()->top_target ()->specific_core_note ();
+}
/* See target.h. */
bool
diff --git a/gdb/target.h b/gdb/target.h
index bf35227b658..133bb94b4ec 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -961,6 +961,11 @@ struct target_ops
virtual void dumpcore (const char *filename)
TARGET_DEFAULT_IGNORE ();
+ /* Generate target specific .note section.
+ For X86, contains description of XSAVE layout. */
+ virtual std::vector<uint32_t> specific_core_note ()
+ TARGET_DEFAULT_RETURN (std::vector<uint32_t> ());
+
/* Does this target support evaluation of breakpoint commands on its
end? */
virtual bool can_run_breakpoint_commands ()
@@ -1650,6 +1655,11 @@ extern bool target_supports_dumpcore ();
extern void target_dumpcore (const char *filename);
+/* Generate target specific .note section.
+ For X86, contains description of XSAVE layout. */
+
+extern std::vector<uint32_t> target_specific_core_note ();
+
/* Returns true if this target can handle breakpoint commands
on its end. */
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 0b84f4c0ada..626bd1192b2 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -44,6 +44,12 @@
#include "x86-tdep.h"
#include "nat/x86-linux-tdesc.h"
+
+std::vector<uint32_t>
+x86_linux_nat_target::specific_core_note ()
+{
+ return form_x86_xsave_cpuid_records();
+}
/* linux_nat_target::low_new_fork implementation. */
void
diff --git a/gdb/x86-linux-nat.h b/gdb/x86-linux-nat.h
index 37e6da5d122..3c395035c9b 100644
--- a/gdb/x86-linux-nat.h
+++ b/gdb/x86-linux-nat.h
@@ -63,6 +63,7 @@ struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
{ return x86_stopped_data_address (addr_p); }
void low_new_fork (struct lwp_info *parent, pid_t child_pid) override;
+ std::vector<uint32_t> specific_core_note () override;
void low_forget_process (pid_t pid) override
{ x86_forget_process (pid); }
diff --git a/gdbsupport/x86-xstate.h b/gdbsupport/x86-xstate.h
index a9ab39152ad..130a7f24a88 100644
--- a/gdbsupport/x86-xstate.h
+++ b/gdbsupport/x86-xstate.h
@@ -49,6 +49,8 @@
#define X86_XSTATE_PKRU (1ULL << X86_XSTATE_PKRU_ID)
#define X86_XSTATE_CET_U (1ULL << X86_XSTATE_CET_U_ID)
+#define MAX_XSAVE_CPUID_RECORDS 32
+
/* Total size of the XSAVE area extended region and offsets of
register states within the region. Offsets are set to 0 to
indicate the absence of the associated registers. */
--
2.34.1
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2025-12-08 8:38 [PATCH 32 0/2] Handle the new .note section introduced in Linux Vignesh Balasubramanian
2025-12-08 8:38 ` [PATCH 32 1/2] core: Consume the new .note section that contains descriptions of xsave layout Vignesh Balasubramanian
2025-12-08 8:38 ` [PATCH 32 2/2] gcore: Create a new .note section for x86 Vignesh Balasubramanian
@ 2025-12-14 13:39 ` Schimpe, Christina
2026-01-06 6:48 ` Balasubrmanian, Vignesh
2026-02-08 4:18 ` Vignesh Balasubramanian
2026-03-16 12:59 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
3 siblings, 2 replies; 13+ messages in thread
From: Schimpe, Christina @ 2025-12-14 13:39 UTC (permalink / raw)
To: Vignesh Balasubramanian, gdb-patches, jinisusan.george,
AlokKumar.Sharma, jhb, simark
Hi Vignesh,
I'll review the patches once we have clarified the opens for the test. Please see my comment below.
> -----Original Message-----
> From: Vignesh Balasubramanian <vigbalas@amd.com>
> Sent: Montag, 8. Dezember 2025 09:38
> To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> jhb@FreeBSD.org; simark@simark.ca
> Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> Subject: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> The XSAVE layout of the machine where the core file is dumped is not visible
> to GDB. It is assumed currently using some heuristics.
>
> It has been addressed to some extent recently but still uses heuristics.
> https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> 1ab2
>
> New patches have been committed to the linux kernel (version 6.12) to
> resolve this issue by adding a new .note section which contains descriptions
> of the xsave layout to the core file.
>
> The first of this patch set consumes this new .note section and uses that to
> identify the xsave layout.
> The second one enables gdb to generate a similar .note section if the corefile
> is dumped through the 'gcore' command.
>
> Working on test case patch, will share it in a few days.
In the gdb testsuite we already have tests for (g)core commands and for OS generated corefiles.
Based on the test that you shared initially
https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
I wonder what your test will cover that is not tested already with existing tests.
Would it be sufficient to extend the existing tests in case a linux kernel >= 6.12 is used ?
Christina
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2025-12-14 13:39 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
@ 2026-01-06 6:48 ` Balasubrmanian, Vignesh
2026-03-06 7:08 ` Schimpe, Christina
2026-02-08 4:18 ` Vignesh Balasubramanian
1 sibling, 1 reply; 13+ messages in thread
From: Balasubrmanian, Vignesh @ 2026-01-06 6:48 UTC (permalink / raw)
To: Schimpe, Christina, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Christina,
In my test, I read the core file's new note-section data with the program and compare it against the "cupid" instructions. I couldn't find any existing test that validates note-section contents. If full validation is too much, I can instead extend "maint-info-sections.exp" to check only that the section exists.
Please advise.
thanks.
Vigneshbalu.
-----Original Message-----
From: Schimpe, Christina <christina.schimpe@intel.com>
Sent: Sunday, December 14, 2025 7:09 PM
To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>; Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org; simark@simark.ca
Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Vignesh,
I'll review the patches once we have clarified the opens for the test. Please see my comment below.
> -----Original Message-----
> From: Vignesh Balasubramanian <vigbalas@amd.com>
> Sent: Montag, 8. Dezember 2025 09:38
> To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> jhb@FreeBSD.org; simark@simark.ca
> Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> Subject: [PATCH 32 0/2] Handle the new .note section introduced in
> Linux
>
> The XSAVE layout of the machine where the core file is dumped is not
> visible to GDB. It is assumed currently using some heuristics.
>
> It has been addressed to some extent recently but still uses heuristics.
> https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> 1ab2
>
> New patches have been committed to the linux kernel (version 6.12) to
> resolve this issue by adding a new .note section which contains
> descriptions of the xsave layout to the core file.
>
> The first of this patch set consumes this new .note section and uses
> that to identify the xsave layout.
> The second one enables gdb to generate a similar .note section if the
> corefile is dumped through the 'gcore' command.
>
> Working on test case patch, will share it in a few days.
In the gdb testsuite we already have tests for (g)core commands and for OS generated corefiles.
Based on the test that you shared initially https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
I wonder what your test will cover that is not tested already with existing tests.
Would it be sufficient to extend the existing tests in case a linux kernel >= 6.12 is used ?
Christina
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-01-06 6:48 ` Balasubrmanian, Vignesh
@ 2026-03-06 7:08 ` Schimpe, Christina
2026-03-06 7:42 ` Balasubrmanian, Vignesh
0 siblings, 1 reply; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-06 7:08 UTC (permalink / raw)
To: Balasubrmanian, Vignesh, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
Hi Vignesh,
unfortunately, I missed your message. I am not sure how this could have slipped and then I've been out for a couple of weeks.
If you don't hear back from me, please ping me in the mailing lists.
We have this guideline: https://sourceware.org/gdb/wiki/ContributionChecklist
You can expect my feedback on this next week.
Christina
> -----Original Message-----
> From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> Sent: Dienstag, 6. Januar 2026 07:49
> To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hi Christina,
>
> In my test, I read the core file's new note-section data with the program and
> compare it against the "cupid" instructions. I couldn't find any existing test
> that validates note-section contents. If full validation is too much, I can
> instead extend "maint-info-sections.exp" to check only that the section exists.
>
> Please advise.
>
> thanks.
> Vigneshbalu.
>
> -----Original Message-----
> From: Schimpe, Christina <christina.schimpe@intel.com>
> Sent: Sunday, December 14, 2025 7:09 PM
> To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Hi Vignesh,
>
> I'll review the patches once we have clarified the opens for the test. Please
> see my comment below.
>
> > -----Original Message-----
> > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > Sent: Montag, 8. Dezember 2025 09:38
> > To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> > Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> > jhb@FreeBSD.org; simark@simark.ca
> > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > Subject: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > The XSAVE layout of the machine where the core file is dumped is not
> > visible to GDB. It is assumed currently using some heuristics.
> >
> > It has been addressed to some extent recently but still uses heuristics.
> > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> >
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > 1ab2
> >
> > New patches have been committed to the linux kernel (version 6.12) to
> > resolve this issue by adding a new .note section which contains
> > descriptions of the xsave layout to the core file.
> >
> > The first of this patch set consumes this new .note section and uses
> > that to identify the xsave layout.
> > The second one enables gdb to generate a similar .note section if the
> > corefile is dumped through the 'gcore' command.
> >
> > Working on test case patch, will share it in a few days.
>
> In the gdb testsuite we already have tests for (g)core commands and for OS
> generated corefiles.
>
> Based on the test that you shared initially
> https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
> I wonder what your test will cover that is not tested already with existing
> tests.
>
> Would it be sufficient to extend the existing tests in case a linux kernel >=
> 6.12 is used ?
>
> Christina
>
> Intel Deutschland GmbH
> Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> Tel: +49 89 991 430, www.intel.de
> Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
> Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich
> Commercial Register: Amtsgericht München HRB 186928
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-03-06 7:08 ` Schimpe, Christina
@ 2026-03-06 7:42 ` Balasubrmanian, Vignesh
2026-03-06 8:13 ` Schimpe, Christina
0 siblings, 1 reply; 13+ messages in thread
From: Balasubrmanian, Vignesh @ 2026-03-06 7:42 UTC (permalink / raw)
To: Schimpe, Christina, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
[AMD Official Use Only - AMD Internal Distribution Only]
Thanks Christina,
Please review this last update https://sourceware.org/pipermail/gdb-patches/2026-February/224832.html
It looks like my previous message was sent without a subject while I was trying to reply to your email thread. I may have used the wrong command, or there might have been a glitch with my git send-email setup.
thanks,
Vigneshbalu.
-----Original Message-----
From: Schimpe, Christina <christina.schimpe@intel.com>
Sent: Friday, March 6, 2026 12:38 PM
To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>; Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org; simark@simark.ca
Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Vignesh,
unfortunately, I missed your message. I am not sure how this could have slipped and then I've been out for a couple of weeks.
If you don't hear back from me, please ping me in the mailing lists.
We have this guideline: https://sourceware.org/gdb/wiki/ContributionChecklist
You can expect my feedback on this next week.
Christina
> -----Original Message-----
> From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> Sent: Dienstag, 6. Januar 2026 07:49
> To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> Linux
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hi Christina,
>
> In my test, I read the core file's new note-section data with the
> program and compare it against the "cupid" instructions. I couldn't
> find any existing test that validates note-section contents. If full
> validation is too much, I can instead extend "maint-info-sections.exp" to check only that the section exists.
>
> Please advise.
>
> thanks.
> Vigneshbalu.
>
> -----Original Message-----
> From: Schimpe, Christina <christina.schimpe@intel.com>
> Sent: Sunday, December 14, 2025 7:09 PM
> To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> Linux
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Hi Vignesh,
>
> I'll review the patches once we have clarified the opens for the test.
> Please see my comment below.
>
> > -----Original Message-----
> > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > Sent: Montag, 8. Dezember 2025 09:38
> > To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> > Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> > jhb@FreeBSD.org; simark@simark.ca
> > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > Subject: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > The XSAVE layout of the machine where the core file is dumped is not
> > visible to GDB. It is assumed currently using some heuristics.
> >
> > It has been addressed to some extent recently but still uses heuristics.
> > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> >
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > 1ab2
> >
> > New patches have been committed to the linux kernel (version 6.12)
> > to resolve this issue by adding a new .note section which contains
> > descriptions of the xsave layout to the core file.
> >
> > The first of this patch set consumes this new .note section and uses
> > that to identify the xsave layout.
> > The second one enables gdb to generate a similar .note section if
> > the corefile is dumped through the 'gcore' command.
> >
> > Working on test case patch, will share it in a few days.
>
> In the gdb testsuite we already have tests for (g)core commands and
> for OS generated corefiles.
>
> Based on the test that you shared initially
> https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
> I wonder what your test will cover that is not tested already with
> existing tests.
>
> Would it be sufficient to extend the existing tests in case a linux
> kernel >=
> 6.12 is used ?
>
> Christina
>
> Intel Deutschland GmbH
> Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> Tel: +49 89 991 430, www.intel.de
> Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered
> Seat: Munich Commercial Register: Amtsgericht München HRB 186928
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-03-06 7:42 ` Balasubrmanian, Vignesh
@ 2026-03-06 8:13 ` Schimpe, Christina
2026-03-11 9:50 ` Schimpe, Christina
0 siblings, 1 reply; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-06 8:13 UTC (permalink / raw)
To: Balasubrmanian, Vignesh, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
Thank you for the update. I'll do the review as soon possible.
Kind Regards,
Christina
> -----Original Message-----
> From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> Sent: Freitag, 6. März 2026 08:42
> To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Thanks Christina,
>
> Please review this last update https://sourceware.org/pipermail/gdb-
> patches/2026-February/224832.html
>
> It looks like my previous message was sent without a subject while I was
> trying to reply to your email thread. I may have used the wrong command, or
> there might have been a glitch with my git send-email setup.
>
> thanks,
> Vigneshbalu.
>
> -----Original Message-----
> From: Schimpe, Christina <christina.schimpe@intel.com>
> Sent: Friday, March 6, 2026 12:38 PM
> To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Hi Vignesh,
>
> unfortunately, I missed your message. I am not sure how this could have
> slipped and then I've been out for a couple of weeks.
>
> If you don't hear back from me, please ping me in the mailing lists.
> We have this guideline:
> https://sourceware.org/gdb/wiki/ContributionChecklist
>
> You can expect my feedback on this next week.
>
> Christina
>
> > -----Original Message-----
> > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > Sent: Dienstag, 6. Januar 2026 07:49
> > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > patches@sourceware.org; George, Jini Susan
> <JiniSusan.George@amd.com>;
> > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > simark@simark.ca
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > Hi Christina,
> >
> > In my test, I read the core file's new note-section data with the
> > program and compare it against the "cupid" instructions. I couldn't
> > find any existing test that validates note-section contents. If full
> > validation is too much, I can instead extend "maint-info-sections.exp" to
> check only that the section exists.
> >
> > Please advise.
> >
> > thanks.
> > Vigneshbalu.
> >
> > -----Original Message-----
> > From: Schimpe, Christina <christina.schimpe@intel.com>
> > Sent: Sunday, December 14, 2025 7:09 PM
> > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > patches@sourceware.org; George, Jini Susan
> <JiniSusan.George@amd.com>;
> > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > simark@simark.ca
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Vignesh,
> >
> > I'll review the patches once we have clarified the opens for the test.
> > Please see my comment below.
> >
> > > -----Original Message-----
> > > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > > Sent: Montag, 8. Dezember 2025 09:38
> > > To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> > > Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> > > jhb@FreeBSD.org; simark@simark.ca
> > > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > > Subject: [PATCH 32 0/2] Handle the new .note section introduced in
> > > Linux
> > >
> > > The XSAVE layout of the machine where the core file is dumped is not
> > > visible to GDB. It is assumed currently using some heuristics.
> > >
> > > It has been addressed to some extent recently but still uses heuristics.
> > > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> > >
> >
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > > 1ab2
> > >
> > > New patches have been committed to the linux kernel (version 6.12)
> > > to resolve this issue by adding a new .note section which contains
> > > descriptions of the xsave layout to the core file.
> > >
> > > The first of this patch set consumes this new .note section and uses
> > > that to identify the xsave layout.
> > > The second one enables gdb to generate a similar .note section if
> > > the corefile is dumped through the 'gcore' command.
> > >
> > > Working on test case patch, will share it in a few days.
> >
> > In the gdb testsuite we already have tests for (g)core commands and
> > for OS generated corefiles.
> >
> > Based on the test that you shared initially
> > https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
> > I wonder what your test will cover that is not tested already with
> > existing tests.
> >
> > Would it be sufficient to extend the existing tests in case a linux
> > kernel >=
> > 6.12 is used ?
> >
> > Christina
> >
> > Intel Deutschland GmbH
> > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > Tel: +49 89 991 430, www.intel.de
> > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered
> > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
> Intel Deutschland GmbH
> Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> Tel: +49 89 991 430, www.intel.de
> Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
> Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich
> Commercial Register: Amtsgericht München HRB 186928
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-03-06 8:13 ` Schimpe, Christina
@ 2026-03-11 9:50 ` Schimpe, Christina
2026-03-13 14:08 ` Schimpe, Christina
0 siblings, 1 reply; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-11 9:50 UTC (permalink / raw)
To: Balasubrmanian, Vignesh, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
> > It looks like my previous message was sent without a subject while I
> > was trying to reply to your email thread. I may have used the wrong
> > command, or there might have been a glitch with my git send-email setup.
For such issues it usually helps me to send the email to myself first.
For the review:
I started digging into this and am ramping up on the history of this topic,
since the discussions for this started in 2022 which I didn't follow.
But I should be able to have some comments soon.
Christina
> -----Original Message-----
> From: Schimpe, Christina
> Sent: Freitag, 6. März 2026 09:14
> To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> patches@sourceware.org; George, Jini Susan <JiniSusan.George@amd.com>;
> Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> simark@simark.ca
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> Thank you for the update. I'll do the review as soon possible.
>
> Kind Regards,
> Christina
>
> > -----Original Message-----
> > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > Sent: Freitag, 6. März 2026 08:42
> > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > patches@sourceware.org; George, Jini Susan
> <JiniSusan.George@amd.com>;
> > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > simark@simark.ca
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > Thanks Christina,
> >
> > Please review this last update https://sourceware.org/pipermail/gdb-
> > patches/2026-February/224832.html
> >
> > It looks like my previous message was sent without a subject while I
> > was trying to reply to your email thread. I may have used the wrong
> > command, or there might have been a glitch with my git send-email setup.
> >
> > thanks,
> > Vigneshbalu.
> >
> > -----Original Message-----
> > From: Schimpe, Christina <christina.schimpe@intel.com>
> > Sent: Friday, March 6, 2026 12:38 PM
> > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > patches@sourceware.org; George, Jini Susan
> <JiniSusan.George@amd.com>;
> > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > simark@simark.ca
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Vignesh,
> >
> > unfortunately, I missed your message. I am not sure how this could
> > have slipped and then I've been out for a couple of weeks.
> >
> > If you don't hear back from me, please ping me in the mailing lists.
> > We have this guideline:
> > https://sourceware.org/gdb/wiki/ContributionChecklist
> >
> > You can expect my feedback on this next week.
> >
> > Christina
> >
> > > -----Original Message-----
> > > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > > Sent: Dienstag, 6. Januar 2026 07:49
> > > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > > patches@sourceware.org; George, Jini Susan
> > <JiniSusan.George@amd.com>;
> > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > > simark@simark.ca
> > > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced
> > > in Linux
> > >
> > > [AMD Official Use Only - AMD Internal Distribution Only]
> > >
> > > Hi Christina,
> > >
> > > In my test, I read the core file's new note-section data with the
> > > program and compare it against the "cupid" instructions. I couldn't
> > > find any existing test that validates note-section contents. If full
> > > validation is too much, I can instead extend
> > > "maint-info-sections.exp" to
> > check only that the section exists.
> > >
> > > Please advise.
> > >
> > > thanks.
> > > Vigneshbalu.
> > >
> > > -----Original Message-----
> > > From: Schimpe, Christina <christina.schimpe@intel.com>
> > > Sent: Sunday, December 14, 2025 7:09 PM
> > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > > patches@sourceware.org; George, Jini Susan
> > <JiniSusan.George@amd.com>;
> > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > > simark@simark.ca
> > > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced
> > > in Linux
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Vignesh,
> > >
> > > I'll review the patches once we have clarified the opens for the test.
> > > Please see my comment below.
> > >
> > > > -----Original Message-----
> > > > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > Sent: Montag, 8. Dezember 2025 09:38
> > > > To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> > > > Christina <christina.schimpe@intel.com>;
> AlokKumar.Sharma@amd.com;
> > > > jhb@FreeBSD.org; simark@simark.ca
> > > > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > Subject: [PATCH 32 0/2] Handle the new .note section introduced in
> > > > Linux
> > > >
> > > > The XSAVE layout of the machine where the core file is dumped is
> > > > not visible to GDB. It is assumed currently using some heuristics.
> > > >
> > > > It has been addressed to some extent recently but still uses heuristics.
> > > > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> > > >
> > >
> > da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > > > 1ab2
> > > >
> > > > New patches have been committed to the linux kernel (version 6.12)
> > > > to resolve this issue by adding a new .note section which contains
> > > > descriptions of the xsave layout to the core file.
> > > >
> > > > The first of this patch set consumes this new .note section and
> > > > uses that to identify the xsave layout.
> > > > The second one enables gdb to generate a similar .note section if
> > > > the corefile is dumped through the 'gcore' command.
> > > >
> > > > Working on test case patch, will share it in a few days.
> > >
> > > In the gdb testsuite we already have tests for (g)core commands and
> > > for OS generated corefiles.
> > >
> > > Based on the test that you shared initially
> > > https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
> > > I wonder what your test will cover that is not tested already with
> > > existing tests.
> > >
> > > Would it be sufficient to extend the existing tests in case a linux
> > > kernel >=
> > > 6.12 is used ?
> > >
> > > Christina
> > >
> > > Intel Deutschland GmbH
> > > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > > Tel: +49 89 991 430, www.intel.de
> > > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > > Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered
> > > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
> > Intel Deutschland GmbH
> > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > Tel: +49 89 991 430, www.intel.de
> > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered
> > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-03-11 9:50 ` Schimpe, Christina
@ 2026-03-13 14:08 ` Schimpe, Christina
2026-03-17 10:02 ` Schimpe, Christina
0 siblings, 1 reply; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-13 14:08 UTC (permalink / raw)
To: Balasubrmanian, Vignesh, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
> -----Original Message-----
> From: Schimpe, Christina
> Sent: Mittwoch, 11. März 2026 10:51
> To: 'Balasubrmanian, Vignesh' <Vignesh.Balasubrmanian@amd.com>; 'gdb-
> patches@sourceware.org' <gdb-patches@sourceware.org>; 'George, Jini
> Susan' <JiniSusan.George@amd.com>; 'Sharma, Alok Kumar'
> <AlokKumar.Sharma@amd.com>; 'jhb@FreeBSD.org' <jhb@FreeBSD.org>;
> 'simark@simark.ca' <simark@simark.ca>
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> > > It looks like my previous message was sent without a subject while I
> > > was trying to reply to your email thread. I may have used the wrong
> > > command, or there might have been a glitch with my git send-email
> setup.
>
> For such issues it usually helps me to send the email to myself first.
>
> For the review:
> I started digging into this and am ramping up on the history of this topic,
> since the discussions for this started in 2022 which I didn't follow.
>
> But I should be able to have some comments soon.
>
> Christina
>
> > -----Original Message-----
> > From: Schimpe, Christina
> > Sent: Freitag, 6. März 2026 09:14
> > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > patches@sourceware.org; George, Jini Susan
> <JiniSusan.George@amd.com>;
> > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > simark@simark.ca
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > Thank you for the update. I'll do the review as soon possible.
> >
> > Kind Regards,
> > Christina
> >
> > > -----Original Message-----
> > > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > > Sent: Freitag, 6. März 2026 08:42
> > > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > > patches@sourceware.org; George, Jini Susan
> > <JiniSusan.George@amd.com>;
> > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > > simark@simark.ca
> > > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced
> > > in Linux
> > >
> > > [AMD Official Use Only - AMD Internal Distribution Only]
> > >
> > > Thanks Christina,
> > >
> > > Please review this last update https://sourceware.org/pipermail/gdb-
> > > patches/2026-February/224832.html
> > >
> > > It looks like my previous message was sent without a subject while I
> > > was trying to reply to your email thread. I may have used the wrong
> > > command, or there might have been a glitch with my git send-email
> setup.
> > >
> > > thanks,
> > > Vigneshbalu.
> > >
> > > -----Original Message-----
> > > From: Schimpe, Christina <christina.schimpe@intel.com>
> > > Sent: Friday, March 6, 2026 12:38 PM
> > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > > patches@sourceware.org; George, Jini Susan
> > <JiniSusan.George@amd.com>;
> > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > > simark@simark.ca
> > > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced
> > > in Linux
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Vignesh,
> > >
> > > unfortunately, I missed your message. I am not sure how this could
> > > have slipped and then I've been out for a couple of weeks.
> > >
> > > If you don't hear back from me, please ping me in the mailing lists.
> > > We have this guideline:
> > > https://sourceware.org/gdb/wiki/ContributionChecklist
> > >
> > > You can expect my feedback on this next week.
> > >
> > > Christina
> > >
> > > > -----Original Message-----
> > > > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > > > Sent: Dienstag, 6. Januar 2026 07:49
> > > > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > > > patches@sourceware.org; George, Jini Susan
> > > <JiniSusan.George@amd.com>;
> > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> jhb@FreeBSD.org;
> > > > simark@simark.ca
> > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > introduced in Linux
> > > >
> > > > [AMD Official Use Only - AMD Internal Distribution Only]
> > > >
> > > > Hi Christina,
> > > >
> > > > In my test, I read the core file's new note-section data with the
> > > > program and compare it against the "cupid" instructions. I
> > > > couldn't find any existing test that validates note-section
> > > > contents. If full validation is too much, I can instead extend
> > > > "maint-info-sections.exp" to
> > > check only that the section exists.
> > > >
> > > > Please advise.
> > > >
> > > > thanks.
> > > > Vigneshbalu.
> > > >
> > > > -----Original Message-----
> > > > From: Schimpe, Christina <christina.schimpe@intel.com>
> > > > Sent: Sunday, December 14, 2025 7:09 PM
> > > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>;
> gdb-
> > > > patches@sourceware.org; George, Jini Susan
> > > <JiniSusan.George@amd.com>;
> > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> jhb@FreeBSD.org;
> > > > simark@simark.ca
> > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > introduced in Linux
> > > >
> > > > Caution: This message originated from an External Source. Use
> > > > proper caution when opening attachments, clicking links, or responding.
> > > >
> > > >
> > > > Hi Vignesh,
> > > >
> > > > I'll review the patches once we have clarified the opens for the test.
> > > > Please see my comment below.
> > > >
> > > > > -----Original Message-----
> > > > > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > > Sent: Montag, 8. Dezember 2025 09:38
> > > > > To: gdb-patches@sourceware.org; jinisusan.george@amd.com;
> > > > > Schimpe, Christina <christina.schimpe@intel.com>;
> > AlokKumar.Sharma@amd.com;
> > > > > jhb@FreeBSD.org; simark@simark.ca
> > > > > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > > Subject: [PATCH 32 0/2] Handle the new .note section introduced
> > > > > in Linux
> > > > >
> > > > > The XSAVE layout of the machine where the core file is dumped is
> > > > > not visible to GDB. It is assumed currently using some heuristics.
> > > > >
> > > > > It has been addressed to some extent recently but still uses heuristics.
> > > > > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa
> > > > > -
> > > > >
> > > >
> > >
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > > > > 1ab2
> > > > >
> > > > > New patches have been committed to the linux kernel (version
> > > > > 6.12) to resolve this issue by adding a new .note section which
> > > > > contains descriptions of the xsave layout to the core file.
> > > > >
> > > > > The first of this patch set consumes this new .note section and
> > > > > uses that to identify the xsave layout.
> > > > > The second one enables gdb to generate a similar .note section
> > > > > if the corefile is dumped through the 'gcore' command.
> > > > >
> > > > > Working on test case patch, will share it in a few days.
> > > >
> > > > In the gdb testsuite we already have tests for (g)core commands
> > > > and for OS generated corefiles.
> > > >
> > > > Based on the test that you shared initially
> > > > https://sourceware.org/pipermail/gdb-patches/2025-July/219369.html
> > > > I wonder what your test will cover that is not tested already with
> > > > existing tests.
> > > >
> > > > Would it be sufficient to extend the existing tests in case a
> > > > linux kernel >=
> > > > 6.12 is used ?
> > > >
> > > > Christina
> > > >
> > > > Intel Deutschland GmbH
> > > > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > > > Tel: +49 89 991 430, www.intel.de
> > > > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > > > Sorrell Chairperson of the Supervisory Board: Nicole Lau
> > > > Registered
> > > > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
> > > Intel Deutschland GmbH
> > > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > > Tel: +49 89 991 430, www.intel.de
> > > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > > Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered
> > > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
Hi Vignesh,
I did not investigate the detailed code of your test, as I still wonder about the general direction.
I should have more ideas next week.
One question I have in the meantime:
Is there any specific reason why the note is not implemented for gdbserver ?
I think it would be good to have it all together.
One small patch for a new corefile note (including gdbserver support) is this one:
"gdb: amd64 linux coredump support with shadow stack."
Maybe it helps you to dig into this.
Thanks,
Christina
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2026-03-13 14:08 ` Schimpe, Christina
@ 2026-03-17 10:02 ` Schimpe, Christina
0 siblings, 0 replies; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-17 10:02 UTC (permalink / raw)
To: Balasubrmanian, Vignesh, gdb-patches, George, Jini Susan, Sharma,
Alok Kumar, jhb, simark
I currently see two open items in this series, and I was wondering if Simon or John might have
additional input on them.
Regarding the missing gdbserver implementation:
IIUC we must send the offset and size information using the remote protocol. Or do we have any
other options?
Concerning the testing topic:
My understanding is that, at the time when the workaround was not yet part of GDB, we observed
some failing tests on AMD CPUs. Is that correct?
In my view, it should be sufficient to verify that these tests are still passing when running
on a sufficiently recent kernel version. And maybe additionally checking that the note exists.
Thanks,
Christina
> -----Original Message-----
> From: Schimpe, Christina
> Sent: Freitag, 13. März 2026 15:09
> To: 'Balasubrmanian, Vignesh' <Vignesh.Balasubrmanian@amd.com>; 'gdb-
> patches@sourceware.org' <gdb-patches@sourceware.org>; 'George, Jini
> Susan' <JiniSusan.George@amd.com>; 'Sharma, Alok Kumar'
> <AlokKumar.Sharma@amd.com>; 'jhb@FreeBSD.org' <jhb@FreeBSD.org>;
> 'simark@simark.ca' <simark@simark.ca>
> Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> > -----Original Message-----
> > From: Schimpe, Christina
> > Sent: Mittwoch, 11. März 2026 10:51
> > To: 'Balasubrmanian, Vignesh' <Vignesh.Balasubrmanian@amd.com>; 'gdb-
> > patches@sourceware.org' <gdb-patches@sourceware.org>; 'George, Jini
> > Susan' <JiniSusan.George@amd.com>; 'Sharma, Alok Kumar'
> > <AlokKumar.Sharma@amd.com>; 'jhb@FreeBSD.org' <jhb@FreeBSD.org>;
> > 'simark@simark.ca' <simark@simark.ca>
> > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced in
> > Linux
> >
> > > > It looks like my previous message was sent without a subject while
> > > > I was trying to reply to your email thread. I may have used the
> > > > wrong command, or there might have been a glitch with my git
> > > > send-email
> > setup.
> >
> > For such issues it usually helps me to send the email to myself first.
> >
> > For the review:
> > I started digging into this and am ramping up on the history of this
> > topic, since the discussions for this started in 2022 which I didn't follow.
> >
> > But I should be able to have some comments soon.
> >
> > Christina
> >
> > > -----Original Message-----
> > > From: Schimpe, Christina
> > > Sent: Freitag, 6. März 2026 09:14
> > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>; gdb-
> > > patches@sourceware.org; George, Jini Susan
> > <JiniSusan.George@amd.com>;
> > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; jhb@FreeBSD.org;
> > > simark@simark.ca
> > > Subject: RE: [PATCH 32 0/2] Handle the new .note section introduced
> > > in Linux
> > >
> > > Thank you for the update. I'll do the review as soon possible.
> > >
> > > Kind Regards,
> > > Christina
> > >
> > > > -----Original Message-----
> > > > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > > > Sent: Freitag, 6. März 2026 08:42
> > > > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > > > patches@sourceware.org; George, Jini Susan
> > > <JiniSusan.George@amd.com>;
> > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> jhb@FreeBSD.org;
> > > > simark@simark.ca
> > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > introduced in Linux
> > > >
> > > > [AMD Official Use Only - AMD Internal Distribution Only]
> > > >
> > > > Thanks Christina,
> > > >
> > > > Please review this last update
> > > > https://sourceware.org/pipermail/gdb-
> > > > patches/2026-February/224832.html
> > > >
> > > > It looks like my previous message was sent without a subject while
> > > > I was trying to reply to your email thread. I may have used the
> > > > wrong command, or there might have been a glitch with my git
> > > > send-email
> > setup.
> > > >
> > > > thanks,
> > > > Vigneshbalu.
> > > >
> > > > -----Original Message-----
> > > > From: Schimpe, Christina <christina.schimpe@intel.com>
> > > > Sent: Friday, March 6, 2026 12:38 PM
> > > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>;
> gdb-
> > > > patches@sourceware.org; George, Jini Susan
> > > <JiniSusan.George@amd.com>;
> > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> jhb@FreeBSD.org;
> > > > simark@simark.ca
> > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > introduced in Linux
> > > >
> > > > Caution: This message originated from an External Source. Use
> > > > proper caution when opening attachments, clicking links, or responding.
> > > >
> > > >
> > > > Hi Vignesh,
> > > >
> > > > unfortunately, I missed your message. I am not sure how this could
> > > > have slipped and then I've been out for a couple of weeks.
> > > >
> > > > If you don't hear back from me, please ping me in the mailing lists.
> > > > We have this guideline:
> > > > https://sourceware.org/gdb/wiki/ContributionChecklist
> > > >
> > > > You can expect my feedback on this next week.
> > > >
> > > > Christina
> > > >
> > > > > -----Original Message-----
> > > > > From: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>
> > > > > Sent: Dienstag, 6. Januar 2026 07:49
> > > > > To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> > > > > patches@sourceware.org; George, Jini Susan
> > > > <JiniSusan.George@amd.com>;
> > > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> > jhb@FreeBSD.org;
> > > > > simark@simark.ca
> > > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > > introduced in Linux
> > > > >
> > > > > [AMD Official Use Only - AMD Internal Distribution Only]
> > > > >
> > > > > Hi Christina,
> > > > >
> > > > > In my test, I read the core file's new note-section data with
> > > > > the program and compare it against the "cupid" instructions. I
> > > > > couldn't find any existing test that validates note-section
> > > > > contents. If full validation is too much, I can instead extend
> > > > > "maint-info-sections.exp" to
> > > > check only that the section exists.
> > > > >
> > > > > Please advise.
> > > > >
> > > > > thanks.
> > > > > Vigneshbalu.
> > > > >
> > > > > -----Original Message-----
> > > > > From: Schimpe, Christina <christina.schimpe@intel.com>
> > > > > Sent: Sunday, December 14, 2025 7:09 PM
> > > > > To: Balasubrmanian, Vignesh <Vignesh.Balasubrmanian@amd.com>;
> > gdb-
> > > > > patches@sourceware.org; George, Jini Susan
> > > > <JiniSusan.George@amd.com>;
> > > > > Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>;
> > jhb@FreeBSD.org;
> > > > > simark@simark.ca
> > > > > Subject: RE: [PATCH 32 0/2] Handle the new .note section
> > > > > introduced in Linux
> > > > >
> > > > > Caution: This message originated from an External Source. Use
> > > > > proper caution when opening attachments, clicking links, or responding.
> > > > >
> > > > >
> > > > > Hi Vignesh,
> > > > >
> > > > > I'll review the patches once we have clarified the opens for the test.
> > > > > Please see my comment below.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > > > Sent: Montag, 8. Dezember 2025 09:38
> > > > > > To: gdb-patches@sourceware.org; jinisusan.george@amd.com;
> > > > > > Schimpe, Christina <christina.schimpe@intel.com>;
> > > AlokKumar.Sharma@amd.com;
> > > > > > jhb@FreeBSD.org; simark@simark.ca
> > > > > > Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> > > > > > Subject: [PATCH 32 0/2] Handle the new .note section
> > > > > > introduced in Linux
> > > > > >
> > > > > > The XSAVE layout of the machine where the core file is dumped
> > > > > > is not visible to GDB. It is assumed currently using some heuristics.
> > > > > >
> > > > > > It has been addressed to some extent recently but still uses heuristics.
> > > > > > https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20
> > > > > > aa
> > > > > > -
> > > > > >
> > > > >
> > > >
> > da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad
> > > > > > 1ab2
> > > > > >
> > > > > > New patches have been committed to the linux kernel (version
> > > > > > 6.12) to resolve this issue by adding a new .note section
> > > > > > which contains descriptions of the xsave layout to the core file.
> > > > > >
> > > > > > The first of this patch set consumes this new .note section
> > > > > > and uses that to identify the xsave layout.
> > > > > > The second one enables gdb to generate a similar .note section
> > > > > > if the corefile is dumped through the 'gcore' command.
> > > > > >
> > > > > > Working on test case patch, will share it in a few days.
> > > > >
> > > > > In the gdb testsuite we already have tests for (g)core commands
> > > > > and for OS generated corefiles.
> > > > >
> > > > > Based on the test that you shared initially
> > > > > https://sourceware.org/pipermail/gdb-patches/2025-July/219369.ht
> > > > > ml I wonder what your test will cover that is not tested already
> > > > > with existing tests.
> > > > >
> > > > > Would it be sufficient to extend the existing tests in case a
> > > > > linux kernel >=
> > > > > 6.12 is used ?
> > > > >
> > > > > Christina
> > > > >
> > > > > Intel Deutschland GmbH
> > > > > Registered Address: Dornacher Straße 1, 85622 Feldkirchen,
> > > > > Germany
> > > > > Tel: +49 89 991 430, www.intel.de Managing Directors: Harry
> > > > > Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of
> > > > > the Supervisory Board: Nicole Lau Registered
> > > > > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
> > > > Intel Deutschland GmbH
> > > > Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
> > > > Tel: +49 89 991 430, www.intel.de
> > > > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong
> > > > Sorrell Chairperson of the Supervisory Board: Nicole Lau
> > > > Registered
> > > > Seat: Munich Commercial Register: Amtsgericht München HRB 186928
>
> Hi Vignesh,
>
> I did not investigate the detailed code of your test, as I still wonder about the
> general direction.
> I should have more ideas next week.
>
> One question I have in the meantime:
>
> Is there any specific reason why the note is not implemented for gdbserver ?
>
> I think it would be good to have it all together.
>
> One small patch for a new corefile note (including gdbserver support) is this
> one:
> "gdb: amd64 linux coredump support with shadow stack."
>
> Maybe it helps you to dig into this.
>
> Thanks,
> Christina
>
>
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread
* (no subject)
2025-12-14 13:39 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
2026-01-06 6:48 ` Balasubrmanian, Vignesh
@ 2026-02-08 4:18 ` Vignesh Balasubramanian
1 sibling, 0 replies; 13+ messages in thread
From: Vignesh Balasubramanian @ 2026-02-08 4:18 UTC (permalink / raw)
To: gdb-patches, jinisusan.george, christina.schimpe,
AlokKumar.Sharma, jhb, simark
The test validates two things: (1) the gcore component that generates a
kernel-like core note using the gcore command, and (2) the gdb component
that internalizes that note via "maint info sections".
The test does not depend on the OS version.
The test is currently unsupported under gdbserver because support for
target-specific core notes for remote targets is not yet implemented.
Updated the patch with distinct functions and to improve error handling.
Please share your comments, i will send v4 with this test case.
From 2d7bde97ed90f43bfb18e83beb9ebec2ce22b7d2 Mon Sep 17 00:00:00 2001
From: Vignesh Balasubramanian <vigbalas@amd.com>
Date: Sun, 8 Feb 2026 09:03:43 +0530
Subject: [PATCH] Test case to validate the new .note section
NT_X86_XSAVE_LAYOUT
This test case is divided into 3 parts.
First, it calls gdb on a small program and dumps a core file through
the 'gcore' command.
Second, load the generated core file into gdb and invoke
"maint info sect .reg-xsave-layout" to learn the offsets of xsave features
from the new .note section in the core file and size of the note.
Third, invoke another program, with core file and its information,
which validates the value of xsave feature records inside the .note section
using cpuid instruction.
So it validates both the core consumption(Patch-1) and generation through
gcore(Patch-2).
Co-Authored-By: Jini Susan George <jinisusan.george@amd.com>
---
gdb/testsuite/gdb.arch/x86-xsave-layout.c | 120 ++++++++++++++++++
gdb/testsuite/gdb.arch/x86-xsave-layout.exp | 131 ++++++++++++++++++++
2 files changed, 251 insertions(+)
create mode 100644 gdb/testsuite/gdb.arch/x86-xsave-layout.c
create mode 100644 gdb/testsuite/gdb.arch/x86-xsave-layout.exp
diff --git a/gdb/testsuite/gdb.arch/x86-xsave-layout.c b/gdb/testsuite/gdb.arch/x86-xsave-layout.c
new file mode 100644
index 00000000000..6d127af151b
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/x86-xsave-layout.c
@@ -0,0 +1,120 @@
+/* Test program for .note section that contains XSAVE layout description
+ in core files.
+
+ Copyright 2021-2025 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "nat/x86-cpuid.h"
+
+#define XSAVE_LEAF 0xD
+
+struct x86_xfeat_component
+{
+ uint32_t type;
+ uint32_t size;
+ uint32_t offset;
+ uint32_t flags;
+};
+
+#define FAIL_IF(x) if (x) { \
+ printf("Record Mismatch."); \
+ exit (1); }
+
+/* This function read xsave feature records present in the .note of core
+ file and compare it with value of cpuid instruction. */
+
+void
+read_and_test_cpuid_records (const char *core_path, unsigned file_off,
+ unsigned note_size)
+{
+ FILE *fp = fopen (core_path, "rb");
+
+ fseek(fp, file_off, SEEK_SET);
+
+ struct x86_xfeat_component *xsave_layout_desc = (struct x86_xfeat_component *)
+ malloc (note_size);
+ if (fread(xsave_layout_desc, 1, note_size, fp) != note_size)
+ {
+ printf ("Couldn't read records from core file\n");
+ free (xsave_layout_desc);
+ fclose(fp);
+ exit(1);
+ }
+
+ int num_records = (note_size / sizeof(struct x86_xfeat_component));
+
+ unsigned int eax=0,ebx=0,ecx=0,edx=0;
+ for (int i=0; i<num_records; i++)
+ {
+
+ x86_cpuid_count (XSAVE_LEAF,
+ xsave_layout_desc[i].type,
+ &eax, &ebx, &ecx, &edx);
+
+ FAIL_IF (xsave_layout_desc[i].size != eax );
+ FAIL_IF (xsave_layout_desc[i].offset != ebx);
+ FAIL_IF (xsave_layout_desc[i].flags != ecx);
+ }
+
+ free(xsave_layout_desc);
+ fclose(fp);
+}
+
+
+/* This program is called with core file, offset of .note section
+ * where xsave feature records are saved and number of records */
+int main(int argc, char *argv[])
+{
+ unsigned file_off;
+ unsigned note_size;
+
+ /* argv[1] = core file name.
+ argv[2] = file offset at which cpuid record starts.
+ argv[3] = total size of cpuid records. */
+
+ if (argc < 4)
+ {
+ printf ("%d: bad command line arguments\n", argc);
+ exit (1);
+ }
+
+ if (sscanf (argv[2], "%x", &file_off) != 1)
+ {
+ printf ("%s: bad command line arguments\n", argv[2]);
+ exit (1);
+ }
+
+ if (sscanf (argv[3], "%x", ¬e_size) != 1)
+ {
+ printf ("%s: bad command line arguments\n", argv[3]);
+ exit(1);
+ }
+
+ /* sanity check. */
+ if ((note_size % sizeof (struct x86_xfeat_component)) != 0 || note_size == 0)
+ {
+ printf ("invalid size of cpuid records = %d\n", note_size);
+ exit(1);
+ }
+
+ /* read the records from core file and test. */
+ read_and_test_cpuid_records(argv[1], file_off, note_size);
+ printf ("Records matches with CPUID instruction .\n");
+}
diff --git a/gdb/testsuite/gdb.arch/x86-xsave-layout.exp b/gdb/testsuite/gdb.arch/x86-xsave-layout.exp
new file mode 100644
index 00000000000..6a5fdfdfb39
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/x86-xsave-layout.exp
@@ -0,0 +1,131 @@
+# Copyright 2025-2026 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Program x86-xsave-layout.c is compiled and invoked with args
+# gcore file "x86-xsave-layout.gcore", offset at which cpuid record starts
+# and size of cpuid records to validate the .note section.
+
+require {is_any_target "x86_64-*-linux*"}
+
+# target-specific core note functionality has not yet been implemented for remote
+# targets, so gdbserver doesn't dump this note.
+require !gdb_protocol_is_remote
+
+standard_testfile
+
+set options [list c++ debug \
+ additional_flags=-I$srcdir/../ \
+ additional_flags=-I$srcdir/../../ ]
+
+if { [build_executable "failed to prepare" $testfile $srcfile $options] } {
+ return
+}
+
+# Dump a core file throug gcore.
+proc test_dump_native_core { corefile } {
+
+ if {![gcore_cmd_available]} {
+ unsupported "gcore command not available"
+ return 0
+ }
+
+ clean_restart $::testfile
+ if {![runto_main]} {
+ return 0
+ }
+
+ if {![gdb_gcore_cmd $corefile "dump core"]} {
+ return 0
+ }
+
+ gdb_exit
+
+ return 1
+}
+
+# Use "maint info section" command to find the new note section and
+# offset at which stored in file as well as size of it.
+proc get_note_offset_size {corefile} {
+ clean_restart
+
+ if { $corefile eq "" } {
+ unsupported "unable to generate core file"
+ return
+ }
+ gdb_core_cmd $corefile "load corefile"
+
+ set xsave_record [capture_command_output "maint info sect .reg-xsave-layout" ""]
+
+ set info_line [lindex [split $xsave_record "\n"] 2]
+ set info_line_substr [regexp -all -inline {\S+} $info_line]
+ set offset [regsub ":" [lindex $info_line_substr 3] ""]
+ set size [lindex [split [lindex $info_line_substr 1] "->"] 2]
+
+ return [list $offset $size]
+}
+
+# Compare the the data in core file with the output of CPUID instruction.
+proc compare_gcore_cpuid {corefile offset size} {
+ clean_restart $::testfile
+
+ gdb_test "set args $corefile $offset $size "
+
+ if {![runto_main]} {
+ return
+ }
+
+ # Look for "Records matches with CPUID"
+ set test "Compare CPUID Records"
+ gdb_test_multiple "continue" $test {
+ -re "Records matches with CPUID" {
+ pass $test
+ }
+ }
+}
+
+# Dump core file through gcore command.
+# Find the offset and size of the note section and compare it
+# with the output of CPUID instruction.
+proc test_gcore_xsave_layout_note {} {
+
+ set corefile [standard_output_file ${::testfile}.gcore]
+
+ #Dump a gcore file
+ if {![test_dump_native_core $corefile]} {
+ unsupported "Core dump failed"
+ return
+ }
+
+ set offset 0
+ set size 0
+
+ if { $corefile eq "" } {
+ unsupported "unable to generate core file"
+ return
+ }
+
+ #Find offset and size of a xsave layout note in the corefile
+ lassign [get_note_offset_size $corefile] offset size
+
+ if { $offset eq "" || $size eq "" } {
+ fail "No xsave layout note section present in core file."
+ return
+ }
+
+ compare_gcore_cpuid $corefile $offset $size
+}
+
+#test
+test_gcore_xsave_layout_note
--
2.34.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 32 0/2] Handle the new .note section introduced in Linux
2025-12-08 8:38 [PATCH 32 0/2] Handle the new .note section introduced in Linux Vignesh Balasubramanian
` (2 preceding siblings ...)
2025-12-14 13:39 ` [PATCH 32 0/2] Handle the new .note section introduced in Linux Schimpe, Christina
@ 2026-03-16 12:59 ` Schimpe, Christina
3 siblings, 0 replies; 13+ messages in thread
From: Schimpe, Christina @ 2026-03-16 12:59 UTC (permalink / raw)
To: Vignesh Balasubramanian, gdb-patches, jinisusan.george,
AlokKumar.Sharma, jhb, simark
Hi Vignesh,
Is this series regression tested ? On my system with old linux kernel (5.15) gdb hangs if I load a corefile that I generated with gcore.
And it might be a good idea to check the patches formatting we have several options:
- Clang-format: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=.clang-format;h=fd4f2d951e22b78f6228fdd16d2138a69a472eaa;hb=refs/heads/master
- GNU style script together with a pre-commit hook:
https://github.com/gcc-mirror/gcc/blob/master/contrib/check_GNU_style.sh
https://pre-commit.com/
Christina
> -----Original Message-----
> From: Vignesh Balasubramanian <vigbalas@amd.com>
> Sent: Montag, 8. Dezember 2025 09:38
> To: gdb-patches@sourceware.org; jinisusan.george@amd.com; Schimpe,
> Christina <christina.schimpe@intel.com>; AlokKumar.Sharma@amd.com;
> jhb@FreeBSD.org; simark@simark.ca
> Cc: Vignesh Balasubramanian <vigbalas@amd.com>
> Subject: [PATCH 32 0/2] Handle the new .note section introduced in Linux
>
> The XSAVE layout of the machine where the core file is dumped is not visible to
> GDB. It is assumed currently using some heuristics.
>
> It has been addressed to some extent recently but still uses heuristics.
> https://inbox.sourceware.org/gdb-patches/2628f45a-77f7-8b2c-20aa-
> da65d1d82a37@simark.ca/T/#m4c67d59c18a5962f771ba8ca1e2bee9365ad1
> ab2
>
> New patches have been committed to the linux kernel (version 6.12) to resolve
> this issue by adding a new .note section which contains descriptions of the
> xsave layout to the core file.
>
> The first of this patch set consumes this new .note section and uses that to
> identify the xsave layout.
> The second one enables gdb to generate a similar .note section if the corefile is
> dumped through the 'gcore' command.
>
> Working on test case patch, will share it in a few days.
>
> This patch shoud be applied on top of binutils patch:
> https://sourceware.org/pipermail/binutils/2025-September/144207.html
>
> Co-Authored-By: Jini Susan George <jinisusan.george@amd.com>
>
> Vignesh Balasubramanian (2):
> core: Consume the new .note section that contains descriptions of
> xsave layout
> gcore: Create a new .note section for x86
>
> gdb/amd64-linux-tdep.c | 2 +-
> gdb/gcore-elf.c | 18 ++++++++
> gdb/gcore-elf.h | 8 ++++
> gdb/i386-linux-tdep.c | 25 ++++++++---
> gdb/i386-linux-tdep.h | 3 +-
> gdb/i387-tdep.c | 86 ++++++++++++++++++++++++++++++++++++++
> gdb/i387-tdep.h | 12 ++++++
> gdb/linux-tdep.c | 1 +
> gdb/nat/x86-xstate.c | 31 ++++++++++++++
> gdb/nat/x86-xstate.h | 6 +++
> gdb/target-debug.h | 6 +++
> gdb/target-delegates-gen.c | 26 ++++++++++++
> gdb/target.c | 5 +++
> gdb/target.h | 10 +++++
> gdb/x86-linux-nat.c | 6 +++
> gdb/x86-linux-nat.h | 1 +
> gdbsupport/x86-xstate.h | 6 +++
> 17 files changed, 244 insertions(+), 8 deletions(-)
>
> --
> 2.34.1
Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928
^ permalink raw reply [flat|nested] 13+ messages in thread