xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] x86: save/restore only partial register state where possible
Date: Wed, 03 Oct 2012 15:35:27 +0100	[thread overview]
Message-ID: <CC920BBF.40A4E%keir.xen@gmail.com> (raw)
In-Reply-To: <506C461E020000780008D00F@nat28.tlf.novell.com>

On 03/10/2012 14:05, "Jan Beulich" <jbeulich@suse.com> wrote:

>>>> Keir Fraser <keir@xen.org> 10/02/12 7:02 PM >>>
>> On 02/10/2012 16:27, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>> ... and make restore conditional not only upon having saved the state,
>>> but also upon whether saved state was actually modified (and register
>>> values are known to have been preserved).
>>> 
>>> Note that RBP is unconditionally considered a volatile register (i.e.
>>> irrespective of CONFIG_FRAME_POINTER), since the RBP handling would
>>> become overly complicated due to the need to save/restore it on the
>>> compat mode hypercall path [6th argument].
>>> 
>>> Note further that for compat mode code paths, saving/restoring R8...R15
>>> is entirely unnecessary - we don't allow those guests to enter 64-bit
>>> mode, and hence they have no way of seeing these registers' contents
>>> (and there consequently also is no information leak, except if the
>>> context saving domctl would be considered such).
>>> 
>>> Finally, note that this may not properly deal with gdbstub's needs, yet
>>> (but if so, I can't really suggest adjustments, as I don't know that
>>> code).
>>> 
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> Ugly. I'd prefer not to bother unless there really is a win we could care
>> about here.
> 
> Without this patch, patch 1 doesn't make a lot of sense either (and patch 2
> then is merely cleanup).

Okay, can you re-submit with some comments around what the new TRAP flag
values mean and how they should be used? Maybe some comments for the
save/restore macros, and their new arguments, would be nice too. And are you
confident that this approach is maintainable/non-fragile (i.e., we're not
going to be continually finding rare cases where registers are being dirtied
but not saved/restored)?

 -- Keir

> Jan
> 

  reply	other threads:[~2012-10-03 14:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:20 [PATCH 0/3] x86: adjust entry frame generation Jan Beulich
2012-10-02 15:26 ` [PATCH 1/3] x86: use MOV instead of PUSH/POP when saving/restoring register state Jan Beulich
2012-10-02 17:01   ` Keir Fraser
2012-10-02 17:57   ` Konrad Rzeszutek Wilk
2012-10-03 13:01     ` Jan Beulich
2012-10-02 15:26 ` [PATCH 2/3] x86: consolidate frame state manipulation functions Jan Beulich
2012-10-02 17:01   ` Keir Fraser
2012-10-02 15:27 ` [PATCH 3/3] x86: save/restore only partial register state where possible Jan Beulich
2012-10-02 17:02   ` Keir Fraser
2012-10-03 13:05     ` Jan Beulich
2012-10-03 14:35       ` Keir Fraser [this message]
2012-10-30 14:26         ` Jan Beulich
2012-10-30 14:20 ` [PATCH 0/2, v2] x86: adjust entry frame generation Jan Beulich
2012-10-30 14:27   ` [PATCH 1/2, v2] x86: use MOV instead of PUSH/POP when saving/restoring register state Jan Beulich
2012-10-30 15:19     ` Mats Petersson
2012-10-30 14:36       ` Keir Fraser
2012-10-30 15:33       ` Jan Beulich
2012-10-30 14:29   ` [PATCH 2/2, v2] x86: save/restore only partial register state where possible Jan Beulich
2012-10-30 14:35   ` [PATCH 0/2, v2] x86: adjust entry frame generation Keir Fraser

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=CC920BBF.40A4E%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).