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

[Xen-devel] [PATCH RFC 03/13] x86/mm: export vcpumask_to_pcpumask



Prefix it with "mm_". No functional change.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
It used to be a inline function, but I don't think there is no point in
making it inline because PV mmu operations are already expensive. Having
a callq to another function won't make noticeable difference.

It is not annotated as always_inline, so the compiler might not inline
it.  Gcc 6.3 inlines it, but clang 4 doesn't.

Let me know if you want me to make it an inline function.
---
 xen/arch/x86/mm.c        | 17 ++++++++++-------
 xen/include/asm-x86/mm.h |  4 ++++
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index a1d867bd94..4bf94227cc 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3071,8 +3071,9 @@ void mm_put_pg_owner(struct domain *pg_owner)
     rcu_unlock_domain(pg_owner);
 }
 
-static inline int vcpumask_to_pcpumask(
-    struct domain *d, XEN_GUEST_HANDLE_PARAM(const_void) bmap, cpumask_t 
*pmask)
+int mm_vcpumask_to_pcpumask(struct domain *d,
+                            XEN_GUEST_HANDLE_PARAM(const_void) bmap,
+                            cpumask_t *pmask)
 {
     unsigned int vcpu_id, vcpu_bias, offs;
     unsigned long vmask;
@@ -3422,7 +3423,7 @@ long do_mmuext_op(
 
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( unlikely(vcpumask_to_pcpumask(d,
+            else if ( unlikely(mm_vcpumask_to_pcpumask(d,
                                    guest_handle_to_param(op.arg2.vcpumask,
                                                          const_void),
                                    mask)) )
@@ -4523,9 +4524,10 @@ static int __do_update_va_mapping(
             break;
         default:
             mask = this_cpu(scratch_cpumask);
-            rc = vcpumask_to_pcpumask(d, const_guest_handle_from_ptr(bmap_ptr,
+            rc = mm_vcpumask_to_pcpumask(d,
+                                         const_guest_handle_from_ptr(bmap_ptr,
                                                                      void),
-                                      mask);
+                                         mask);
             break;
         }
         if ( mask )
@@ -4543,9 +4545,10 @@ static int __do_update_va_mapping(
             break;
         default:
             mask = this_cpu(scratch_cpumask);
-            rc = vcpumask_to_pcpumask(d, const_guest_handle_from_ptr(bmap_ptr,
+            rc = mm_vcpumask_to_pcpumask(d,
+                                         const_guest_handle_from_ptr(bmap_ptr,
                                                                      void),
-                                      mask);
+                                         mask);
             break;
         }
         if ( mask )
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 6bc9866359..2bcf5514e9 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -606,6 +606,10 @@ void write_32bit_pse_identmap(uint32_t *l2);
 struct domain *mm_get_pg_owner(domid_t domid);
 void mm_put_pg_owner(struct domain *pg_owner);
 
+int mm_vcpumask_to_pcpumask(struct domain *d,
+                            XEN_GUEST_HANDLE_PARAM(const_void) bmap,
+                            cpumask_t *pmask);
+
 #define MEM_LOG(_f, _a...) gdprintk(XENLOG_WARNING , _f "\n" , ## _a)
 
 #endif /* __ASM_X86_MM_H__ */
-- 
2.11.0


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

 


Rackspace

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