All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] x86/mm: Use mfn_t for make_cr3()
Date: Fri, 1 Sep 2017 18:30:59 +0100	[thread overview]
Message-ID: <CAFLBxZbyqJPuz9xeknh3wy=QFJPB_do3dO6kFzNWp+Ef467uwg@mail.gmail.com> (raw)
In-Reply-To: <1504095573-14153-2-git-send-email-andrew.cooper3@citrix.com>

On Wed, Aug 30, 2017 at 1:19 PM, Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Tim Deegan <tim@xen.org>
> CC: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  xen/arch/x86/mm.c               | 10 +++++-----
>  xen/arch/x86/mm/hap/hap.c       |  2 +-
>  xen/arch/x86/mm/shadow/common.c |  8 ++++----
>  xen/arch/x86/mm/shadow/multi.c  |  4 ++--
>  xen/include/asm-x86/mm.h        |  2 +-
>  5 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> index dc07b4f..f0c81e7 100644
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -498,9 +498,9 @@ void free_shared_domheap_page(struct page_info *page)
>      free_domheap_page(page);
>  }
>
> -void make_cr3(struct vcpu *v, unsigned long mfn)
> +void make_cr3(struct vcpu *v, mfn_t mfn)
>  {
> -    v->arch.cr3 = mfn << PAGE_SHIFT;
> +    v->arch.cr3 = mfn_x(mfn) << PAGE_SHIFT;
>  }
>
>  void write_ptbase(struct vcpu *v)
> @@ -518,7 +518,7 @@ void write_ptbase(struct vcpu *v)
>   */
>  void update_cr3(struct vcpu *v)
>  {
> -    unsigned long cr3_mfn;
> +    mfn_t cr3_mfn;
>
>      if ( paging_mode_enabled(v->domain) )
>      {
> @@ -527,9 +527,9 @@ void update_cr3(struct vcpu *v)
>      }
>
>      if ( !(v->arch.flags & TF_kernel_mode) )
> -        cr3_mfn = pagetable_get_pfn(v->arch.guest_table_user);
> +        cr3_mfn = pagetable_get_mfn(v->arch.guest_table_user);
>      else
> -        cr3_mfn = pagetable_get_pfn(v->arch.guest_table);
> +        cr3_mfn = pagetable_get_mfn(v->arch.guest_table);
>
>      make_cr3(v, cr3_mfn);
>  }
> diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
> index 15e4877..6946fde 100644
> --- a/xen/arch/x86/mm/hap/hap.c
> +++ b/xen/arch/x86/mm/hap/hap.c
> @@ -719,7 +719,7 @@ static void hap_update_paging_modes(struct vcpu *v)
>      {
>          mfn_t mmfn = hap_make_monitor_table(v);
>          v->arch.monitor_table = pagetable_from_mfn(mmfn);
> -        make_cr3(v, mfn_x(mmfn));
> +        make_cr3(v, mmfn);
>          hvm_update_host_cr3(v);
>      }
>
> diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
> index e8ee6db..3926ed6 100644
> --- a/xen/arch/x86/mm/shadow/common.c
> +++ b/xen/arch/x86/mm/shadow/common.c
> @@ -2961,7 +2961,7 @@ static void sh_update_paging_modes(struct vcpu *v)
>          {
>              mfn_t mmfn = v->arch.paging.mode->shadow.make_monitor_table(v);
>              v->arch.monitor_table = pagetable_from_mfn(mmfn);
> -            make_cr3(v, mfn_x(mmfn));
> +            make_cr3(v, mmfn);
>              hvm_update_host_cr3(v);
>          }
>
> @@ -3004,7 +3004,7 @@ static void sh_update_paging_modes(struct vcpu *v)
>                  /* Don't be running on the old monitor table when we
>                   * pull it down!  Switch CR3, and warn the HVM code that
>                   * its host cr3 has changed. */
> -                make_cr3(v, mfn_x(new_mfn));
> +                make_cr3(v, new_mfn);
>                  if ( v == current )
>                      write_ptbase(v);
>                  hvm_update_host_cr3(v);
> @@ -3380,9 +3380,9 @@ static int shadow_one_bit_disable(struct domain *d, u32 mode)
>              if ( v->arch.paging.mode )
>                  v->arch.paging.mode->shadow.detach_old_tables(v);
>              if ( !(v->arch.flags & TF_kernel_mode) )
> -                make_cr3(v, pagetable_get_pfn(v->arch.guest_table_user));
> +                make_cr3(v, pagetable_get_mfn(v->arch.guest_table_user));
>              else
> -                make_cr3(v, pagetable_get_pfn(v->arch.guest_table));
> +                make_cr3(v, pagetable_get_mfn(v->arch.guest_table));
>
>  #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
>              {
> diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
> index c5c0af8..f7efe66 100644
> --- a/xen/arch/x86/mm/shadow/multi.c
> +++ b/xen/arch/x86/mm/shadow/multi.c
> @@ -4273,7 +4273,7 @@ sh_update_cr3(struct vcpu *v, int do_locking)
>      ///
>      if ( shadow_mode_external(d) )
>      {
> -        make_cr3(v, pagetable_get_pfn(v->arch.monitor_table));
> +        make_cr3(v, pagetable_get_mfn(v->arch.monitor_table));
>      }
>      else // not shadow_mode_external...
>      {
> @@ -4287,7 +4287,7 @@ sh_update_cr3(struct vcpu *v, int do_locking)
>          v->arch.cr3 = virt_to_maddr(&v->arch.paging.shadow.l3table);
>  #else
>          /* 4-on-4: Just use the shadow top-level directly */
> -        make_cr3(v, pagetable_get_pfn(v->arch.shadow_table[0]));
> +        make_cr3(v, pagetable_get_mfn(v->arch.shadow_table[0]));
>  #endif
>      }
>
> diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
> index 4c03a33..dce3f16 100644
> --- a/xen/include/asm-x86/mm.h
> +++ b/xen/include/asm-x86/mm.h
> @@ -540,7 +540,7 @@ void audit_domains(void);
>  #endif
>
>  int new_guest_cr3(mfn_t mfn);
> -void make_cr3(struct vcpu *v, unsigned long mfn);
> +void make_cr3(struct vcpu *v, mfn_t mfn);
>  void update_cr3(struct vcpu *v);
>  int vcpu_destroy_pagetables(struct vcpu *);
>  void *do_page_walk(struct vcpu *v, unsigned long addr);
> --
> 2.1.4
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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

  parent reply	other threads:[~2017-09-01 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 12:19 [PATCH 1/2] x86/mm: Use mfn_t for new_guest_cr3() Andrew Cooper
2017-08-30 12:19 ` [PATCH 2/2] x86/mm: Use mfn_t for make_cr3() Andrew Cooper
2017-08-30 13:08   ` Wei Liu
2017-08-30 15:47     ` Jan Beulich
2017-08-30 18:59   ` Tim Deegan
2017-09-01 17:30   ` George Dunlap [this message]
2017-08-30 13:08 ` [PATCH 1/2] x86/mm: Use mfn_t for new_guest_cr3() Wei Liu
2017-08-30 15:45 ` Jan Beulich
2017-08-30 15:57   ` Andrew Cooper
2017-08-30 16:04     ` Jan Beulich
2017-09-01 17:29 ` George Dunlap

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='CAFLBxZbyqJPuz9xeknh3wy=QFJPB_do3dO6kFzNWp+Ef467uwg@mail.gmail.com' \
    --to=george.dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --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.