All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <JBeulich@suse.com>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 04/20] x86/shadow: Only apply shadow heuristics when in guest context
Date: Thu, 19 Feb 2015 14:18:20 +0000	[thread overview]
Message-ID: <54E5F0AC.5090707@citrix.com> (raw)
In-Reply-To: <20150219131014.GB21953@deinos.phlegethon.org>

On 19/02/15 13:10, Tim Deegan wrote:
> At 17:16 +0000 on 12 Feb (1423757763), Andrew Cooper wrote:
>> It is incorrect to be applying these heuristics because of toolstack actions.
> It might be incorrect if we did, but we don't. :P
>
> The guess_wrmap() heuristics should only be called on v == current()
> because they use the shadow linear map, but this patch actually
> _relaxes_ that constraint so that they could run on other vcpus of the
> same guest (harmlessly).
>
> The second heuristic uses a stored smfn of a PTE, and uses the correct
> callback for the shadow page's type, so is safe to call from any vcpu
> so long as the domain's shadow lock is held.  The check you add here
> is needed _only_ because you are changing from using 'v' to using
> 'curr' for the test.
>
> The changes you've made in multi.c are again only needed because you
> are s/v/curr/ in the same patch, and again if anything are relaxing
> the checks.  Luckily they don't cover any mode-specific operations, so
> AFAICT the code is still safe after all these changes, and at least no
> worse than existing paths that use vcpu[0].
>
> So this patch is safe, but it's not a bugfix, and I think the
> changeset description needs to be rewritten.  What you're actually
> doing is removing uses of the vcpu parameter in these functions,
> replacing them with uses of current.  The changes to gating are a
> side-effect.
>
> With that change, Reviewed-by: Tim Deegan <tim@xen.org>

Thanks for taking the time to review this.  I will rewrite the commit
message and submit a v2.

~Andrew

  reply	other threads:[~2015-02-19 14:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 17:15 [PATCH RFC 00/20] Change parts of the shadow interface to be domain based Andrew Cooper
2015-02-12 17:16 ` [PATCH 01/20] x86/shadow: Whitespace cleanup Andrew Cooper
2015-02-12 17:16 ` [PATCH 02/20] x86/shadow: Rename hash_foreach() to hash_vcpu_foreach() Andrew Cooper
2015-02-12 17:16 ` [PATCH 03/20] x86/shadow: Introduce 'd' pointers and clean up use of 'v->domain' Andrew Cooper
2015-02-12 17:16 ` [PATCH 04/20] x86/shadow: Only apply shadow heuristics when in guest context Andrew Cooper
2015-02-19 13:10   ` Tim Deegan
2015-02-19 14:18     ` Andrew Cooper [this message]
2015-02-19 15:33     ` [PATCH v2 04/20] x86/shadow: Change the gating of shadow heuristics Andrew Cooper
2015-02-12 17:16 ` [PATCH 05/20] x86/shadow: Alter shadow_hash_{lookup, insert, delete}() to take a domain Andrew Cooper
2015-02-12 17:16 ` [PATCH 06/20] x86/shadow: Alter *_shadow_status() and make_fl1_shadow() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 07/20] x86/shadow: Alter sh_type_{is_pinnable, has_up_pointer}() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 08/20] x86/shadow: Alter OOS functions " Andrew Cooper
2015-02-12 17:16 ` [PATCH 09/20] x86/shadow: Alter shadow_{pro, de}mote() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 10/20] x86/shadow: Alter sh_put_ref() and shadow destroy functions " Andrew Cooper
2015-02-12 17:16 ` [PATCH 11/20] x86/shadow: Alter sh_get_ref() and sh_{, un}pin() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 12/20] x86/shadow: Alter shadow_set_l?e() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 13/20] x86/shadow: Alter sh_{clear_shadow_entry, remove_shadow_via_pointer}() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 14/20] x86/shadow: Alter sh_remove_l?_shadow() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 15/20] x86/shadow: Alter shadow_unhook{_???}_mappings() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 16/20] x86/shadow: Alter sh_rm_write_access_from_???() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 17/20] x86/shadow: Alter sh_remove_{all_}shadows{, _and_parents}() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 18/20] x86/shadow: Alter sh_{remove_all_mappings, rm_mappings_from_l1}() " Andrew Cooper
2015-02-12 17:16 ` [PATCH 19/20] x86/shadow: Alter sh_remove_write_access " Andrew Cooper
2015-02-12 17:16 ` [PATCH 20/20] x86/shadow: Cleanup of vcpu handling Andrew Cooper
2015-02-13 11:42 ` [PATCH RFC 00/20] Change parts of the shadow interface to be domain based Andrew Cooper
2015-02-16 12:29 ` Tim Deegan
2015-02-16 13:35   ` Andrew Cooper
2015-02-16 18:28     ` Tim Deegan
2015-02-19 12:35       ` Tim Deegan

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=54E5F0AC.5090707@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=tim@xen.org \
    --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 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.