[xen master] x86/mm: Use mfn_t for make_cr3()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86/mm: Use mfn_t for make_cr3()

patchbot
commit ee2c1fc666648ac14a4c8b9eb9224753591fa5e7
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Wed Aug 30 12:41:40 2017 +0100
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Fri Sep 1 18:33:06 2017 +0100

    x86/mm: Use mfn_t for make_cr3()
   
    No functional change.
   
    Signed-off-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Wei Liu <[hidden email]>
    Acked-by: Jan Beulich <[hidden email]>
    Acked-by: Tim Deegan <[hidden email]>
    Acked-by: George Dunlap <[hidden email]>
---
 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 4d76319..e5b0cce 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 97647dc..bef45e8 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -537,7 +537,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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog