p type, size, offset and flag values for every xfeature that is present.
+ */
+static int dump_xsave_layout_desc(struct coredump_params *cprm)
+{
+ int num_records = 0;
+ int i;
+
+ for_each_extended_xfeature(i, fpu_kernel_cfg.max_features) {
+ struct xfeat_component xc = {changing "int" to "u32" as per review comment.
+ .type = i,
+ .size = xstate_sizes[i],
+ .offset = xstate_offsets[i],
+ /* reserved for future use */
+ .flags = 0,
+ };
+
+ if (!dump_emit(cprm, &xc, sizeof(xc)))
+ return 0;
+
+ num_records++;
+ }
+ return num_records;
+}
+
+static int get_xsave_desc_size(void)
+{
+ int cnt = 0;
+ int i;
+
+ for_each_extended_xfeature(i, fpu_kernel_cfg.max_features)
+ cnt++;
+
+ return cnt * (sizeof(struct xfeat_component));
+}
+
+
+int elf_coredump_extra_notes_size(void)
+{
+ int size;
+ /* .note header */
+ size = sizeof(struct elf_note);
+ /* name + align */
+ size += roundup(sizeof(owner_name), 4);
+ size += get_xsave_desc_size();
+
#define NT_S390_TIMER 0x301 /* s390 timer register */
#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
--
2.43.0
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette