All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Paul Lai <paul.c.lai@intel.com>
Cc: ravi.sahita@intel.com, xen-devel@lists.xensource.com,
	george.dunlap@citrix.com, jbeulich@suse.com
Subject: Re: [PATCH Altp2m cleanup 2/3 v9 1/2] Move altp2m specific functions to altp2m files.
Date: Tue, 11 Oct 2016 15:20:49 -0400	[thread overview]
Message-ID: <20161011192049.GE23193@localhost.localdomain> (raw)
In-Reply-To: <1476207685-4737-2-git-send-email-paul.c.lai@intel.com>

On Tue, Oct 11, 2016 at 10:41:24AM -0700, Paul Lai wrote:
> This makes the code a little easier to read.
> Moving hvm_altp2m_supported() check into functions that use it
> for better readability.
> Got rid of stray blanks after open paren after function names.
> Defining _XEN_ASM_X86_P2M_H instead of _XEN_P2M_H for
> xen/include/asm-x86/p2m.h.
> 
> Signed-off-by: Paul Lai <paul.c.lai@intel.com>
> ---
> v9
> Per request:
> o Fixing comments in altp2m_domain_init(struct domain *d)
> o Fixing white space (missing blank after NULL in if())
> o Reversing the order of
>      d->arch.altp2m_eptp = NULL
>      p2m_teardown(d->arch.altp2m_p2m[i]);
> o coding style within domain_init()
> o splitting off the altp2m and ept functions into a seperate patch.
> ---
>  xen/arch/x86/mm/altp2m.c          | 57 +++++++++++++++++++++++++++++++++++++++
>  xen/arch/x86/mm/hap/hap.c         | 40 ++++++++-------------------
>  xen/include/asm-x86/altp2m.h      |  4 ++-
>  xen/include/asm-x86/hvm/vmx/vmx.h |  3 +++
>  xen/include/asm-x86/p2m.h         |  9 +++----
>  5 files changed, 77 insertions(+), 36 deletions(-)
> 
> diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
> index 930bdc2..6856a0e 100644
> --- a/xen/arch/x86/mm/altp2m.c
> +++ b/xen/arch/x86/mm/altp2m.c
> @@ -17,6 +17,7 @@
>  
>  #include <asm/hvm/support.h>
>  #include <asm/hvm/hvm.h>
> +#include <asm/domain.h>
>  #include <asm/p2m.h>
>  #include <asm/altp2m.h>
>  
> @@ -66,6 +67,62 @@ altp2m_vcpu_destroy(struct vcpu *v)
>  }
>  
>  /*
> + *  allocate and initialize memory for altp2m portion of domain
> + *
> + *  returns < 0 on error
> + *  returns 0 on no operation & success
> + */
> +int
> +altp2m_domain_init(struct domain *d)
> +{
> +    int rc;
> +    unsigned int i;
> +
> +    if ( d == NULL )
> +        return 0;
> +
> +    if ( !hvm_altp2m_supported() )
> +        return 0;
> +
> +    /* Init alternate p2m data. */
> +    if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL )
> +        return -ENOMEM;
> +
> +    for ( i = 0; i < MAX_EPTP; i++ )
> +        d->arch.altp2m_eptp[i] = mfn_x(INVALID_MFN);
> +
> +    for ( i = 0; i < MAX_ALTP2M; i++ )
> +    {
> +        rc = p2m_alloc_table(d->arch.altp2m_p2m[i]);
> +        if ( rc != 0 ) {

{ should be on its own line.

And you can also do:
	if ( rc )
	{
		...
> +            altp2m_domain_teardown(d);
> +            return rc;
> +        }
> +    }
> +
> +    d->arch.altp2m_active = 0;
> +
> +    return rc;
> +}
> +
> +void

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

  reply	other threads:[~2016-10-11 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11 17:41 [PATCH Altp2m cleanup 2/3 v9 0/2] Cleaning up altp2m code Paul Lai
2016-10-11 17:41 ` [PATCH Altp2m cleanup 2/3 v9 1/2] Move altp2m specific functions to altp2m files Paul Lai
2016-10-11 19:20   ` Konrad Rzeszutek Wilk [this message]
2016-10-11 19:26     ` Lai, Paul
2016-10-11 17:41 ` [PATCH Altp2m cleanup 2/3 v9 2/2] Moving ept code to ept specific files as requested in: https://lists.xenproject.org/archives/html/xen-devel/2015-07/msg04323.html Renamed p2m_init_altp2m_helper() to p2m_init_altp2m_ept() Paul Lai
2016-10-11 19:22   ` Konrad Rzeszutek Wilk

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=20161011192049.GE23193@localhost.localdomain \
    --to=konrad.wilk@oracle.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=paul.c.lai@intel.com \
    --cc=ravi.sahita@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /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.