All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v3] x86/PV: remove unnecessary toggle_guest_pt() overhead
Date: Fri, 22 May 2020 12:07:27 +0200	[thread overview]
Message-ID: <a6084473-2fb7-4106-66a4-d180ef483314@suse.com> (raw)
In-Reply-To: <d7840278-b999-65fa-40bf-2b78e5266837@citrix.com>

On 21.05.2020 18:46, Andrew Cooper wrote:
> On 05/05/2020 07:16, Jan Beulich wrote:
>> While the mere updating of ->pv_cr3 and ->root_pgt_changed aren't overly
>> expensive (but still needed only for the toggle_guest_mode() path), the
>> effect of the latter on the exit-to-guest path is not insignificant.
>> Move the logic into toggle_guest_mode(), on the basis that
>> toggle_guest_pt() will always be invoked in pairs, yet we can't safely
>> undo the setting of root_pgt_changed during the second of these
>> invocations.
>>
>> While at it, add a comment ahead of toggle_guest_pt() to clarify its
>> intended usage.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> I'm still of the opinion that the commit message wants rewriting to get
> the important points across clearly.
> 
> And those are that toggle_guest_pt() is called in pairs specifically to
> read kernel data structures when emulating a userspace action, and that
> this doesn't modify cr3 from the guests point of view, and therefore
> doesn't need the resync on exit-to-guest path.

Is this

"toggle_guest_pt() is called in pairs, to read guest kernel data
 structures when emulating a guest userspace action. Hence this doesn't
 modify cr3 from the guest's point of view, and therefore doesn't need
 any resync on the exit-to-guest path. Therefore move the updating of
 ->pv_cr3 and ->root_pgt_changed into toggle_guest_mode(), since undoing
 the changes during the second of these invocations wouldn't be a safe
 thing to do."

any better?

Jan


  reply	other threads:[~2020-05-22 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  6:16 [PATCH v3] x86/PV: remove unnecessary toggle_guest_pt() overhead Jan Beulich
2020-05-18 16:52 ` Roger Pau Monné
2020-05-21 16:46 ` Andrew Cooper
2020-05-22 10:07   ` Jan Beulich [this message]
2020-05-29 16:24     ` Andrew Cooper

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=a6084473-2fb7-4106-66a4-d180ef483314@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.