xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Egger, Christoph" <chegger@amazon.de>
To: Sergey Dyasli <sergey.dyasli@citrix.com>, xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH RFC 02/12] x86/np2m: add np2m_flush_eptp()
Date: Tue, 1 Aug 2017 09:55:37 +0200	[thread overview]
Message-ID: <c83a60eb-a8ca-3072-4b7f-6cb4819742b9@amazon.de> (raw)
In-Reply-To: <20170718103429.25020-3-sergey.dyasli@citrix.com>

On 18.07.17 12:34, Sergey Dyasli wrote:
> The new function finds all np2m objects with the specified eptp and
> flushes them. p2m_flush_table_locked() is added in order not to release
> the p2m lock after np2m_base check.
> 
> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
> ---
>  xen/arch/x86/mm/p2m.c     | 34 +++++++++++++++++++++++++++++++---
>  xen/include/asm-x86/p2m.h |  2 ++
>  2 files changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
> index b8c8bba421..bc330d8f52 100644
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -1708,15 +1708,14 @@ p2m_getlru_nestedp2m(struct domain *d, struct p2m_domain *p2m)
>      return p2m;
>  }
>  
> -/* Reset this p2m table to be empty */
>  static void
> -p2m_flush_table(struct p2m_domain *p2m)
> +p2m_flush_table_locked(struct p2m_domain *p2m)
>  {
>      struct page_info *top, *pg;
>      struct domain *d = p2m->domain;
>      mfn_t mfn;
>  
> -    p2m_lock(p2m);
> +    ASSERT(p2m_locked_by_me(p2m));
>  
>      /*
>       * "Host" p2m tables can have shared entries &c that need a bit more care
> @@ -1756,6 +1755,14 @@ p2m_flush_table(struct p2m_domain *p2m)
>      p2m_unlock(p2m);
>  }
>  
> +/* Reset this p2m table to be empty */
> +static void
> +p2m_flush_table(struct p2m_domain *p2m)
> +{
> +    p2m_lock(p2m);
> +    p2m_flush_table_locked(p2m);
> +}
> +
>  void
>  p2m_flush(struct vcpu *v, struct p2m_domain *p2m)
>  {
> @@ -1773,6 +1780,27 @@ p2m_flush_nestedp2m(struct domain *d)
>          p2m_flush_table(d->arch.nested_p2m[i]);
>  }
>  
> +void np2m_flush_eptp(struct vcpu *v, unsigned long eptp)
> +{
> +    struct domain *d = v->domain;
> +    struct p2m_domain *p2m;
> +    unsigned int i;
> +
> +    eptp &= ~(0xfffull);
> +
> +    nestedp2m_lock(d);
> +    for ( i = 0; i < MAX_NESTEDP2M; i++ )
> +    {
> +        p2m = d->arch.nested_p2m[i];
> +        p2m_lock(p2m);
> +        if ( p2m->np2m_base == eptp )
> +            p2m_flush_table_locked(p2m);
> +        else
> +            p2m_unlock(p2m);
> +    }
> +    nestedp2m_unlock(d);
> +}
> +

What exactly is eptp specific in this function ?

Christoph


>  static void assign_np2m(struct vcpu *v, struct p2m_domain *p2m)
>  {
>      struct nestedvcpu *nv = &vcpu_nestedhvm(v);
> diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
> index 9086bb35dc..0e39999387 100644
> --- a/xen/include/asm-x86/p2m.h
> +++ b/xen/include/asm-x86/p2m.h
> @@ -779,6 +779,8 @@ int p2m_pt_handle_deferred_changes(uint64_t gpa);
>  void p2m_flush(struct vcpu *v, struct p2m_domain *p2m);
>  /* Flushes all nested p2m tables */
>  void p2m_flush_nestedp2m(struct domain *d);
> +/* Flushes all np2m objects with the specified eptp */
> +void np2m_flush_eptp(struct vcpu *v, unsigned long eptp);
>  
>  void nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
>      l1_pgentry_t *p, l1_pgentry_t new, unsigned int level);
> 

Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-08-01  7:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 10:34 [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 01/12] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 02/12] x86/np2m: add np2m_flush_eptp() Sergey Dyasli
2017-08-01  7:55   ` Egger, Christoph [this message]
2017-08-03 14:18     ` Sergey Dyasli
2017-08-03 14:40       ` Jan Beulich
2017-08-28 16:08   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 03/12] x86/vvmx: use np2m_flush_eptp() for INVEPT_SINGLE_CONTEXT Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 04/12] x86/np2m: remove np2m_base from p2m_get_nestedp2m() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 05/12] x86/np2m: add np2m_generation Sergey Dyasli
2017-08-28 16:18   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 06/12] x86/vvmx: add stale_eptp flag Sergey Dyasli
2017-08-28 16:31   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 07/12] x86/np2m: add np2m_schedule_in/out() Sergey Dyasli
2017-08-28 16:42   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 08/12] x86/np2m: add p2m_get_nestedp2m_locked() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 09/12] x86/np2m: improve nestedhvm_hap_nested_page_fault() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 10/12] x86/np2m: implement sharing of np2m between vCPUs Sergey Dyasli
2017-08-28 16:59   ` George Dunlap
2017-07-18 10:34 ` [PATCH RFC 11/12] x86/np2m: add break to np2m_flush_eptp() Sergey Dyasli
2017-07-18 10:34 ` [PATCH RFC 12/12] x86/vvmx: remove EPTP write from ept_handle_violation() Sergey Dyasli
2017-08-28 17:03 ` [PATCH RFC 00/12] Nested p2m: allow sharing between vCPUs George Dunlap
2017-08-29 13:39   ` Sergey Dyasli

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=c83a60eb-a8ca-3072-4b7f-6cb4819742b9@amazon.de \
    --to=chegger@amazon.de \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=suravee.suthikulpanit@amd.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 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).