]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: move guest_get_eff_l1e to pv/mm.h
authorWei Liu <wei.liu2@citrix.com>
Wed, 13 Sep 2017 14:32:04 +0000 (15:32 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 22 Sep 2017 15:31:50 +0000 (16:31 +0100)
Make it static inline. It will be used by map_ldt_shadow_page and ro
page fault emulation code later.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c
xen/arch/x86/pv/mm.h [new file with mode: 0644]

index 67f583e3a7cba224f4f68b372472bc43065529ce..5fb60b642d63c92b4244c1d75d53de0fed9b7e77 100644 (file)
 #include <asm/pv/grant_table.h>
 
 #include "pv/emulate.h"
+#include "pv/mm.h"
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_page
@@ -564,23 +565,6 @@ static l1_pgentry_t *map_guest_l1e(unsigned long linear, mfn_t *gl1mfn)
     return (l1_pgentry_t *)map_domain_page(*gl1mfn) + l1_table_offset(linear);
 }
 
-/* Read a PV guest's l1e that maps this linear address. */
-static l1_pgentry_t guest_get_eff_l1e(unsigned long linear)
-{
-    l1_pgentry_t l1e;
-
-    ASSERT(!paging_mode_translate(current->domain));
-    ASSERT(!paging_mode_external(current->domain));
-
-    if ( unlikely(!__addr_ok(linear)) ||
-         __copy_from_user(&l1e,
-                          &__linear_l1_table[l1_linear_offset(linear)],
-                          sizeof(l1_pgentry_t)) )
-        l1e = l1e_empty();
-
-    return l1e;
-}
-
 /*
  * Read the guest's l1e that maps this address, from the kernel-mode
  * page tables.
diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
new file mode 100644 (file)
index 0000000..5b5dbff
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __PV_MM_H__
+#define __PV_MM_H__
+
+/* Read a PV guest's l1e that maps this linear address. */
+static inline l1_pgentry_t guest_get_eff_l1e(unsigned long linear)
+{
+    l1_pgentry_t l1e;
+
+    ASSERT(!paging_mode_translate(current->domain));
+    ASSERT(!paging_mode_external(current->domain));
+
+    if ( unlikely(!__addr_ok(linear)) ||
+         __copy_from_user(&l1e,
+                          &__linear_l1_table[l1_linear_offset(linear)],
+                          sizeof(l1_pgentry_t)) )
+        l1e = l1e_empty();
+
+    return l1e;
+}
+
+#endif /* __PV_MM_H__ */