mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Balasubrmanian, Vignesh" <vigbalas@amd.com>
To: Borislav Petkov <bp@alien8.de>,
	"Balasubrmanian, Vignesh" <Vignesh.Balasubrmanian@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-toolchains@vger.kernel.org"
	<linux-toolchains@vger.kernel.org>,
	"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
	"npiggin@gmail.com" <npiggin@gmail.com>,
	"christophe.leroy@csgroup.eu" <christophe.leroy@csgroup.eu>,
	"aneesh.kumar@kernel.org" <aneesh.kumar@kernel.org>,
	"naveen.n.rao@linux.ibm.com" <naveen.n.rao@linux.ibm.com>,
	"ebiederm@xmission.com" <ebiederm@xmission.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"George, Jini Susan" <JiniSusan.George@amd.com>,
	"matz@suse.de" <matz@suse.de>,
	"binutils@sourceware.org" <binutils@sourceware.org>,
	"jhb@FreeBSD.org" <jhb@freebsd.org>,
	"felix.willgerodt@intel.com" <felix.willgerodt@intel.com>
Subject: Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files
Date: Tue, 9 Jul 2024 10:42:19 +0530	[thread overview]
Message-ID: <456d9a5f-45cb-4307-b8e9-3333a2c71e69@amd.com> (raw)
In-Reply-To: <20240531105843.GBZlmtY7j7p8LJfQOh@fat_crate.local>

Apologies for the delay. I am sending the new version patch with below 
changes.

On 5/31/2024 4:28 PM, Borislav Petkov wrote:
> 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) {

Modifying "fpu_kernel_cfg.max_features" to "fpu_user_cfg.max_features"

Supervisor bits also set in "fpu_kernel_cfg.max_features"

(https://github.com/torvalds/linux/blob/master/arch/x86/kernel/fpu/xstate.c#L777)

> +               struct xfeat_component xc = {
> +                       .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;
> +
changing "int" to "u32" as per review comment.
> +       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;

Adding below check, same as in "elf_coredump_extra_notes_write"

if (!fpu_user_cfg.max_features)

return 0;


thanks,
vigneshbalu.

> +       /* .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

      reply	other threads:[~2024-07-09  5:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  9:53 [PATCH v2 0/1] Add XSAVE layout description to Core files for debuggers to support varying XSAVE layouts Vignesh Balasubramanian
2024-05-07  9:53 ` [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files Vignesh Balasubramanian
2024-05-07 23:40   ` kernel test robot
2024-05-08  0:13   ` kernel test robot
2024-05-08  8:04   ` Kees Cook
2024-05-08 13:02   ` Thomas Gleixner
2024-05-22 13:12     ` Balasubrmanian, Vignesh
2024-05-22 15:34       ` Borislav Petkov
     [not found]         ` <902b1bf0-15e6-42df-8f86-21387deef437@amd.com>
2024-05-23 14:45           ` Borislav Petkov
2024-05-26  4:54             ` Balasubrmanian, Vignesh
2024-05-26  9:05               ` Borislav Petkov
2024-05-31  9:19                 ` Balasubrmanian, Vignesh
2024-05-31 10:58                   ` Borislav Petkov
2024-07-09  5:12                     ` Balasubrmanian, Vignesh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456d9a5f-45cb-4307-b8e9-3333a2c71e69@amd.com \
    --to=vigbalas@amd.com \
    --cc=JiniSusan.George@amd.com \
    --cc=Vignesh.Balasubrmanian@amd.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=binutils@sourceware.org \
    --cc=bp@alien8.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=ebiederm@xmission.com \
    --cc=felix.willgerodt@intel.com \
    --cc=jhb@freebsd.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matz@suse.de \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome