mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"Lu, Hongjiu" <hongjiu.lu@intel.com>,
	"Lachner, Peter" <peter.lachner@intel.com>
Subject: Re: [patch] x86: ptrace and core-dump extensions for xstate
Date: Thu, 04 Feb 2010 14:05:14 -0800	[thread overview]
Message-ID: <1265321114.2768.256.camel@sbs-t61.sc.intel.com> (raw)
In-Reply-To: <20100204205543.E1D11E7@magilla.sf.frob.com>

On Thu, 2010-02-04 at 12:55 -0800, Roland McGrath wrote:
> Just proofread it.  I really did mean "obvious typos", i.e. spelling,
> whitespace, punctuation, nothing more.

Roland, All I found after double checking is:

> For now, only first 8 bytes of the sw_usable_bytes[464..467]

should be

> For now, only first 8 bytes of the sw_usable_bytes[464..471]

Let me know if I am overlooking something.

> 
> > This issue is not new and gets handled in the same way as for existing
> > fxsave/fxrstor, as they don't specify page alignment restrictions.
> 
> I didn't suggest it was new.  I was looking for some confirmation that
> there is in fact no permanent (i.e. compile-time) size limit.

Yes. No size limit as of now.

> I don't think this is the right way to think about it.  The regset code
> does not need to do anything different at all.  There will in future be
> other callers of the regset hooks, that's what the whole interface is there
> for.  Regardless of whether modification is full or partial, you just
> enforce the various bitmasks on the resultant buffer as you already do, and
> that's all there is to it.  If userland stores partial contents with a
> bogus format, that's its problem.  It's just like the program itself had
> used xrstor in user mode with the same bogus buffer contents.

Ok. I think I can agree, if we are ok with giving room for the ptrace
(or any other user of the API) to make a mistake and corrupt reg-state
of the process under debug, if it doesn't follow rules.

> > We probably have to extend regset infrastructure to track which NT_*
> > types are part of PTRACE_[GET|SET]REGSET and which are not.
> 
> I don't understand what you mean.  The point of the generic requests is
> that they apply to any user_regset you want.  user_regset does not need
> anything new.

Thought some of them might be only relevant to core-dump or based on
permissions etc. But I guess get/set routines of the regset should be
able to take care of this?

> > Also, I am not sure if pushing the ptrace interpretation of the user
> > pointer into the regset routines is a good idea. 
> 
> I don't understand what you mean here at all.  I did not suggest anything
> that affects what the regset routines themselves do in any way at all.
>
> It is an unacceptably bad idea to have any new ptrace interfaces for regset
> access that do anything different than exactly let you get/set all or part
> of a regset exactly as the arch's user_regset provides it.

So in the example you provided before:

        struct iovec iov = { mybuffer, mylength };
        ret = ptrace(PTRACE_GETREGSET, NT_X86_XSTATE, &iov);

You wanted to propose common data format (iov) for all of the NT_* ?

thanks,
suresh


  reply	other threads:[~2010-02-04 22:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02  2:00 Suresh Siddha
2010-02-02  2:33 ` [tip:x86/ptrace] " tip-bot for Suresh Siddha
2010-02-03 23:08 ` [patch] " Roland McGrath
2010-02-03 23:45   ` Lu, Hongjiu
2010-02-04  2:02     ` Roland McGrath
2010-02-04  2:05       ` Lu, Hongjiu
2010-02-04  2:16         ` Roland McGrath
2010-02-04  2:22           ` Lu, Hongjiu
2010-02-04  4:54             ` Roland McGrath
2010-02-04  5:01               ` Lu, Hongjiu
2010-02-04  5:18                 ` Roland McGrath
2010-02-04  5:32                   ` Lu, Hongjiu
2010-02-04 20:28   ` Suresh Siddha
2010-02-04 20:55     ` Roland McGrath
2010-02-04 22:05       ` Suresh Siddha [this message]
2010-02-04 22:18         ` H. Peter Anvin
2010-02-05 19:47           ` Lu, Hongjiu
2010-02-05 21:15           ` Roland McGrath
2010-02-05 21:39             ` Suresh Siddha
2010-02-09 17:28               ` Oleg Nesterov
2010-02-05 21:02         ` Roland McGrath

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=1265321114.2768.256.camel@sbs-t61.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=hongjiu.lu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=peter.lachner@intel.com \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®