All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH V2 2/3] x86/mm: allocate logdirty_ranges for altp2ms
Date: Fri, 26 Oct 2018 08:54:15 -0600	[thread overview]
Message-ID: <5BD32A9702000078001F5439@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <1540300744-7406-3-git-send-email-rcojocaru@bitdefender.com>

>>> On 23.10.18 at 15:19, <rcojocaru@bitdefender.com> wrote:
> --- a/xen/arch/x86/mm/p2m-ept.c
> +++ b/xen/arch/x86/mm/p2m-ept.c
> @@ -1348,6 +1348,8 @@ int ept_p2m_init(struct p2m_domain *p2m)
>  void ept_p2m_uninit(struct p2m_domain *p2m)
>  {
>      struct ept_data *ept = &p2m->ept;
> +
> +    p2m_free_logdirty(p2m);

This and ...

>      free_cpumask_var(ept->invalidate);
>  }
>  
> @@ -1434,11 +1436,20 @@ void setup_ept_dump(void)
>      register_keyhandler('D', ept_dump_p2m_table, "dump VT-x EPT tables", 0);
>  }
>  
> -void p2m_init_altp2m_ept(struct domain *d, unsigned int i)
> +int p2m_init_altp2m_ept(struct domain *d, unsigned int i)
>  {
>      struct p2m_domain *p2m = d->arch.altp2m_p2m[i];
>      struct p2m_domain *hostp2m = p2m_get_hostp2m(d);
>      struct ept_data *ept;
> +    int rc = p2m_init_logdirty(p2m);
> +
> +    if ( rc )
> +        return rc;
> +
> +    rc = rangeset_merge(p2m->logdirty_ranges, hostp2m->logdirty_ranges);
> +
> +    if ( rc )
> +        return rc;

... all of this logically belong into p2m.c, as it's not code which is
EPT-specific. This would also eliminate the need to make the two
functions non-static.

Also I think the rangeset_merge() invocation would deserve a
brief comment noting that this "merge" is really just a "copy".

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-10-26 14:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 13:19 [PATCH V2 0/3] Fix VGA logdirty related display freezes with altp2m Razvan Cojocaru
2018-10-23 13:19 ` [PATCH V2 1/3] x86/altp2m: propagate ept.ad changes to all active altp2ms Razvan Cojocaru
2018-10-23 13:19 ` [PATCH V2 2/3] x86/mm: allocate logdirty_ranges for altp2ms Razvan Cojocaru
2018-10-26 14:54   ` Jan Beulich [this message]
2018-10-26 15:02     ` Razvan Cojocaru
2018-10-23 13:19 ` [PATCH V2 3/3] x86/altp2m: fix display frozen when switching to a new view early Razvan Cojocaru
2018-10-26 14:47   ` Jan Beulich
2018-10-26 15:00     ` Razvan Cojocaru
2018-10-26 15:04       ` Jan Beulich

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=5BD32A9702000078001F5439@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=wei.liu2@citrix.com \
    --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.