diff mbox series

[for-next,v3,6/9] x86: rename hypervisor_{alloc, free}_unused_page

Message ID 20191021155718.28653-7-liuwe@microsoft.com (mailing list archive)
State Superseded
Headers show
Series Port Xen to Hyper-V | expand

Commit Message

Wei Liu Oct. 21, 2019, 3:57 p.m. UTC
They are used in Xen code only.

No functional change.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/guest/xen/xen.c    | 6 +++---
 xen/arch/x86/pv/shim.c          | 4 ++--
 xen/include/asm-x86/guest/xen.h | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Jan Beulich Nov. 15, 2019, 1:49 p.m. UTC | #1
On 21.10.2019 17:57, Wei Liu wrote:
> --- a/xen/arch/x86/guest/xen/xen.c
> +++ b/xen/arch/x86/guest/xen/xen.c
> @@ -97,7 +97,7 @@ static void map_shared_info(void)
>      unsigned int i;
>      unsigned long rc;
>  
> -    if ( hypervisor_alloc_unused_page(&mfn) )
> +    if ( xen_alloc_unused_page(&mfn) )

But is just "xen_" as a prefix a good name in Xen code? Perhaps
"xen_guest_" or (shorter) "xg_"?

Jan
Wei Liu Nov. 21, 2019, 4:27 p.m. UTC | #2
On Fri, Nov 15, 2019 at 02:49:57PM +0100, Jan Beulich wrote:
> On 21.10.2019 17:57, Wei Liu wrote:
> > --- a/xen/arch/x86/guest/xen/xen.c
> > +++ b/xen/arch/x86/guest/xen/xen.c
> > @@ -97,7 +97,7 @@ static void map_shared_info(void)
> >      unsigned int i;
> >      unsigned long rc;
> >  
> > -    if ( hypervisor_alloc_unused_page(&mfn) )
> > +    if ( xen_alloc_unused_page(&mfn) )
> 
> But is just "xen_" as a prefix a good name in Xen code? Perhaps
> "xen_guest_" or (shorter) "xg_"?

That's fine by me.

Wei.

> 
> Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 78fc603996..9895025d02 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -97,7 +97,7 @@  static void map_shared_info(void)
     unsigned int i;
     unsigned long rc;
 
-    if ( hypervisor_alloc_unused_page(&mfn) )
+    if ( xen_alloc_unused_page(&mfn) )
         panic("unable to reserve shared info memory page\n");
 
     xatp.gpfn = mfn_x(mfn);
@@ -284,7 +284,7 @@  void hypervisor_ap_setup(void)
     init_evtchn();
 }
 
-int hypervisor_alloc_unused_page(mfn_t *mfn)
+int xen_alloc_unused_page(mfn_t *mfn)
 {
     unsigned long m;
     int rc;
@@ -296,7 +296,7 @@  int hypervisor_alloc_unused_page(mfn_t *mfn)
     return rc;
 }
 
-int hypervisor_free_unused_page(mfn_t mfn)
+int xen_free_unused_page(mfn_t mfn)
 {
     return rangeset_remove_range(mem, mfn_x(mfn), mfn_x(mfn));
 }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 5441e89de2..41b4665649 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -739,7 +739,7 @@  static long pv_shim_grant_table_op(unsigned int cmd,
                 };
                 mfn_t mfn;
 
-                rc = hypervisor_alloc_unused_page(&mfn);
+                rc = xen_alloc_unused_page(&mfn);
                 if ( rc )
                 {
                     gprintk(XENLOG_ERR,
@@ -751,7 +751,7 @@  static long pv_shim_grant_table_op(unsigned int cmd,
                 rc = xen_hypercall_memory_op(XENMEM_add_to_physmap, &xatp);
                 if ( rc )
                 {
-                    hypervisor_free_unused_page(mfn);
+                    xen_free_unused_page(mfn);
                     break;
                 }
 
diff --git a/xen/include/asm-x86/guest/xen.h b/xen/include/asm-x86/guest/xen.h
index 3145f75361..8221fc1325 100644
--- a/xen/include/asm-x86/guest/xen.h
+++ b/xen/include/asm-x86/guest/xen.h
@@ -33,8 +33,8 @@  extern bool pv_console;
 extern uint32_t xen_cpuid_base;
 
 void probe_hypervisor(void);
-int hypervisor_alloc_unused_page(mfn_t *mfn);
-int hypervisor_free_unused_page(mfn_t mfn);
+int xen_alloc_unused_page(mfn_t *mfn);
+int xen_free_unused_page(mfn_t mfn);
 
 DECLARE_PER_CPU(unsigned int, vcpu_id);
 DECLARE_PER_CPU(struct vcpu_info *, vcpu_info);