[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] ept mtrr: replace unsigned long with mfn_t for mfns.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1249546542 -3600
# Node ID f57cc4a7c8537aab0fab5077d8d31e8879b472d2
# Parent  40394af1155482ada63e6cb09819d11bba4db248
ept mtrr: replace unsigned long with mfn_t for mfns.

Signed-off-by: Patrick Colp <Patrick.Colp@xxxxxxxxxx>
---
 xen/arch/x86/hvm/mtrr.c       |    7 ++++---
 xen/arch/x86/mm/hap/p2m-ept.c |    8 ++++----
 xen/include/asm-x86/mtrr.h    |    3 ++-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff -r 40394af11554 -r f57cc4a7c853 xen/arch/x86/hvm/mtrr.c
--- a/xen/arch/x86/hvm/mtrr.c   Thu Aug 06 09:15:24 2009 +0100
+++ b/xen/arch/x86/hvm/mtrr.c   Thu Aug 06 09:15:42 2009 +0100
@@ -20,6 +20,7 @@
 #include <public/hvm/e820.h>
 #include <xen/types.h>
 #include <asm/e820.h>
+#include <asm/mm.h>
 #include <asm/paging.h>
 #include <asm/p2m.h>
 #include <xen/domain_page.h>
@@ -712,7 +713,7 @@ HVM_REGISTER_SAVE_RESTORE(MTRR, hvm_save
 
 uint8_t epte_get_entry_emt(
     struct domain *d, unsigned long gfn, 
-    unsigned long mfn, uint8_t *igmt, int direct_mmio)
+    mfn_t mfn, uint8_t *igmt, int direct_mmio)
 {
     uint8_t gmtrr_mtype, hmtrr_mtype;
     uint32_t type;
@@ -730,7 +731,7 @@ uint8_t epte_get_entry_emt(
     if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
         return MTRR_TYPE_UNCACHABLE;
 
-    if ( !mfn_valid(mfn) )
+    if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
     if ( hvm_get_mem_pinned_cacheattr(d, gfn, &type) )
@@ -752,6 +753,6 @@ uint8_t epte_get_entry_emt(
     }
 
     gmtrr_mtype = get_mtrr_type(&v->arch.hvm_vcpu.mtrr, (gfn << PAGE_SHIFT));
-    hmtrr_mtype = get_mtrr_type(&mtrr_state, (mfn << PAGE_SHIFT));
+    hmtrr_mtype = get_mtrr_type(&mtrr_state, (mfn_x(mfn) << PAGE_SHIFT));
     return ((gmtrr_mtype <= hmtrr_mtype) ? gmtrr_mtype : hmtrr_mtype);
 }
diff -r 40394af11554 -r f57cc4a7c853 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Thu Aug 06 09:15:24 2009 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Thu Aug 06 09:15:42 2009 +0100
@@ -168,7 +168,7 @@ ept_set_entry(struct domain *d, unsigned
     {
         if ( mfn_valid(mfn_x(mfn)) || (p2mt == p2m_mmio_direct) )
         {
-            ept_entry->emt = epte_get_entry_emt(d, gfn, mfn_x(mfn),
+            ept_entry->emt = epte_get_entry_emt(d, gfn, mfn,
                                 &igmt, direct_mmio);
             ept_entry->igmt = igmt;
             ept_entry->sp_avail = walk_level ? 1 : 0;
@@ -230,7 +230,7 @@ ept_set_entry(struct domain *d, unsigned
         {
             split_ept_entry = split_table + i;
             split_ept_entry->emt = epte_get_entry_emt(d,
-                                        gfn-offset+i, split_mfn+i, 
+                                        gfn-offset+i, _mfn(split_mfn+i), 
                                         &igmt, direct_mmio);
             split_ept_entry->igmt = igmt;
 
@@ -247,7 +247,7 @@ ept_set_entry(struct domain *d, unsigned
 
         /* Set the destinated 4k page as normal */
         split_ept_entry = split_table + offset;
-        split_ept_entry->emt = epte_get_entry_emt(d, gfn, mfn_x(mfn), 
+        split_ept_entry->emt = epte_get_entry_emt(d, gfn, mfn,
                                                 &igmt, direct_mmio);
         split_ept_entry->igmt = igmt;
 
@@ -406,7 +406,7 @@ static int need_modify_ept_entry(struct 
                                     uint8_t o_emt, p2m_type_t p2mt)
 {
     uint8_t igmt, emt;
-    emt = epte_get_entry_emt(d, gfn, mfn_x(mfn), &igmt, 
+    emt = epte_get_entry_emt(d, gfn, mfn, &igmt, 
                                 (p2mt == p2m_mmio_direct));
     if ( (emt == o_emt) && (igmt == o_igmt) )
         return 0;
diff -r 40394af11554 -r f57cc4a7c853 xen/include/asm-x86/mtrr.h
--- a/xen/include/asm-x86/mtrr.h        Thu Aug 06 09:15:24 2009 +0100
+++ b/xen/include/asm-x86/mtrr.h        Thu Aug 06 09:15:42 2009 +0100
@@ -2,6 +2,7 @@
 #define __ASM_X86_MTRR_H__
 
 #include <xen/config.h>
+#include <asm/mm.h>
 
 /* These are the region types. They match the architectural specification. */
 #define MTRR_TYPE_UNCACHABLE 0
@@ -66,7 +67,7 @@ extern u32 get_pat_flags(struct vcpu *v,
 extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
                   paddr_t spaddr, uint8_t gmtrr_mtype);
 extern uint8_t epte_get_entry_emt(
-    struct domain *d, unsigned long gfn, unsigned long mfn,
+    struct domain *d, unsigned long gfn, mfn_t mfn,
     uint8_t *igmt, int direct_mmio);
 extern void ept_change_entry_emt_with_range(
     struct domain *d, unsigned long start_gfn, unsigned long end_gfn);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.