All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH] x86/EPT: adjust types in ept_split_super_page()
Date: Tue, 29 Sep 2015 11:40:36 +0100	[thread overview]
Message-ID: <560A6AA4.1050204@citrix.com> (raw)
In-Reply-To: <56096C5702000078000A63D6@prv-mh.provo.novell.com>

On 28/09/15 15:35, Jan Beulich wrote:
> The function returns a boolean and its current and target level inputs
> are unsigned (which in turn allows simplifying the early-out check).
> Also convert a non-standard loop variable to an ordinary function scope
> one, at once making it unsigned too.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: George Dunlap <george.dunlap@citrix.com>

> 
> --- a/xen/arch/x86/mm/p2m-ept.c
> +++ b/xen/arch/x86/mm/p2m-ept.c
> @@ -266,16 +266,18 @@ static void ept_free_entry(struct p2m_do
>      p2m_free_ptp(p2m, mfn_to_page(ept_entry->mfn));
>  }
>  
> -static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
> -                                int level, int target)
> +static bool_t ept_split_super_page(struct p2m_domain *p2m,
> +                                   ept_entry_t *ept_entry,
> +                                   unsigned int level, unsigned int target)
>  {
>      ept_entry_t new_ept, *table;
>      uint64_t trunk;
> -    int rv = 1;
> +    unsigned int i;
> +    bool_t rv = 1;
>  
>      /* End if the entry is a leaf entry or reaches the target level. */
> -    if ( level == 0 || level == target )
> -        return rv;
> +    if ( level <= target )
> +        return 1;
>  
>      ASSERT(is_epte_superpage(ept_entry));
>  
> @@ -285,7 +287,7 @@ static int ept_split_super_page(struct p
>      table = map_domain_page(_mfn(new_ept.mfn));
>      trunk = 1UL << ((level - 1) * EPT_TABLE_ORDER);
>  
> -    for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
> +    for ( i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
>      {
>          ept_entry_t *epte = table + i;
>  
> 
> 
> 

      parent reply	other threads:[~2015-09-29 10:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 14:35 [PATCH] x86/EPT: adjust types in ept_split_super_page() Jan Beulich
2015-09-28 14:46 ` Andrew Cooper
2015-09-29 10:40 ` George Dunlap [this message]

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=560A6AA4.1050204@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.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.