All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make all (native) hypercalls consistently have "long" return type
@ 2012-08-08 16:05 Jan Beulich
  2012-08-10  7:34 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2012-08-08 16:05 UTC (permalink / raw)
  To: xen-devel; +Cc: dgdegra

[-- Attachment #1: Type: text/plain, Size: 4387 bytes --]

for common and x86 ones at least, to address the problem of storing
zero-extended values into the multicall result field otherwise.

Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2973,7 +2973,7 @@ static inline void fixunmap_domain_page(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 #endif
 
-int do_mmuext_op(
+long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -3437,7 +3437,7 @@ int do_mmuext_op(
     return rc;
 }
 
-int do_mmu_update(
+long do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -4285,15 +4285,15 @@ static int __do_update_va_mapping(
     return rc;
 }
 
-int do_update_va_mapping(unsigned long va, u64 val64,
-                         unsigned long flags)
+long do_update_va_mapping(unsigned long va, u64 val64,
+                          unsigned long flags)
 {
     return __do_update_va_mapping(va, val64, flags, current->domain);
 }
 
-int do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
-                                     unsigned long flags,
-                                     domid_t domid)
+long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
+                                      unsigned long flags,
+                                      domid_t domid)
 {
     struct domain *pg_owner;
     int rc;
--- a/xen/common/compat/xenoprof.c
+++ b/xen/common/compat/xenoprof.c
@@ -5,6 +5,7 @@
 #include <compat/xenoprof.h>
 
 #define COMPAT
+#define ret_t int
 
 #define do_xenoprof_op compat_xenoprof_op
 
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -845,8 +845,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
-                           int compat)
+static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+                                bool_t compat)
 {
     unsigned long flags;
     int ret = -EINVAL;
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -607,6 +607,8 @@ static int xenoprof_op_init(XEN_GUEST_HA
     return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
 }
 
+#define ret_t long
+
 #endif /* !COMPAT */
 
 static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
@@ -660,7 +662,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int ret = 0;
     
@@ -904,6 +906,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
 }
 
 #if defined(CONFIG_COMPAT) && !defined(COMPAT)
+#undef ret_t
 #include "compat/xenoprof.c"
 #endif
 
--- a/xen/include/asm-x86/hypercall.h
+++ b/xen/include/asm-x86/hypercall.h
@@ -24,7 +24,7 @@ extern long
 do_set_trap_table(
     XEN_GUEST_HANDLE(const_trap_info_t) traps);
 
-extern int
+extern long
 do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
@@ -62,7 +62,7 @@ do_update_descriptor(
 extern long
 do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
 
-extern int
+extern long
 do_update_va_mapping(
     unsigned long va,
     u64 val64,
@@ -72,14 +72,14 @@ extern long
 do_physdev_op(
     int cmd, XEN_GUEST_HANDLE(void) arg);
 
-extern int
+extern long
 do_update_va_mapping_otherdomain(
     unsigned long va,
     u64 val64,
     unsigned long flags,
     domid_t domid);
 
-extern int
+extern long
 do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
@@ -90,10 +90,6 @@ extern unsigned long
 do_iret(
     void);
 
-extern int
-do_kexec(
-    unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
-
 #ifdef __x86_64__
 
 extern long
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -137,7 +137,7 @@ extern long
 do_tmem_op(
     XEN_GUEST_HANDLE(tmem_op_t) uops);
 
-extern int
+extern long
 do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
 
 #ifdef CONFIG_COMPAT



[-- Attachment #2: hypercall-return-long.patch --]
[-- Type: text/plain, Size: 4452 bytes --]

make all (native) hypercalls consistently have "long" return type

for common and x86 ones at least, to address the problem of storing
zero-extended values into the multicall result field otherwise.

Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2973,7 +2973,7 @@ static inline void fixunmap_domain_page(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 #endif
 
-int do_mmuext_op(
+long do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -3437,7 +3437,7 @@ int do_mmuext_op(
     return rc;
 }
 
-int do_mmu_update(
+long do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
     XEN_GUEST_HANDLE(uint) pdone,
@@ -4285,15 +4285,15 @@ static int __do_update_va_mapping(
     return rc;
 }
 
-int do_update_va_mapping(unsigned long va, u64 val64,
-                         unsigned long flags)
+long do_update_va_mapping(unsigned long va, u64 val64,
+                          unsigned long flags)
 {
     return __do_update_va_mapping(va, val64, flags, current->domain);
 }
 
-int do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
-                                     unsigned long flags,
-                                     domid_t domid)
+long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
+                                      unsigned long flags,
+                                      domid_t domid)
 {
     struct domain *pg_owner;
     int rc;
--- a/xen/common/compat/xenoprof.c
+++ b/xen/common/compat/xenoprof.c
@@ -5,6 +5,7 @@
 #include <compat/xenoprof.h>
 
 #define COMPAT
+#define ret_t int
 
 #define do_xenoprof_op compat_xenoprof_op
 
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -845,8 +845,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
-                           int compat)
+static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+                                bool_t compat)
 {
     unsigned long flags;
     int ret = -EINVAL;
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -607,6 +607,8 @@ static int xenoprof_op_init(XEN_GUEST_HA
     return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
 }
 
+#define ret_t long
+
 #endif /* !COMPAT */
 
 static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
@@ -660,7 +662,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
 {
     int ret = 0;
     
@@ -904,6 +906,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
 }
 
 #if defined(CONFIG_COMPAT) && !defined(COMPAT)
+#undef ret_t
 #include "compat/xenoprof.c"
 #endif
 
--- a/xen/include/asm-x86/hypercall.h
+++ b/xen/include/asm-x86/hypercall.h
@@ -24,7 +24,7 @@ extern long
 do_set_trap_table(
     XEN_GUEST_HANDLE(const_trap_info_t) traps);
 
-extern int
+extern long
 do_mmu_update(
     XEN_GUEST_HANDLE(mmu_update_t) ureqs,
     unsigned int count,
@@ -62,7 +62,7 @@ do_update_descriptor(
 extern long
 do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
 
-extern int
+extern long
 do_update_va_mapping(
     unsigned long va,
     u64 val64,
@@ -72,14 +72,14 @@ extern long
 do_physdev_op(
     int cmd, XEN_GUEST_HANDLE(void) arg);
 
-extern int
+extern long
 do_update_va_mapping_otherdomain(
     unsigned long va,
     u64 val64,
     unsigned long flags,
     domid_t domid);
 
-extern int
+extern long
 do_mmuext_op(
     XEN_GUEST_HANDLE(mmuext_op_t) uops,
     unsigned int count,
@@ -90,10 +90,6 @@ extern unsigned long
 do_iret(
     void);
 
-extern int
-do_kexec(
-    unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
-
 #ifdef __x86_64__
 
 extern long
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -137,7 +137,7 @@ extern long
 do_tmem_op(
     XEN_GUEST_HANDLE(tmem_op_t) uops);
 
-extern int
+extern long
 do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
 
 #ifdef CONFIG_COMPAT

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] make all (native) hypercalls consistently have "long" return type
  2012-08-08 16:05 [PATCH] make all (native) hypercalls consistently have "long" return type Jan Beulich
@ 2012-08-10  7:34 ` Keir Fraser
  2012-08-10  7:54   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2012-08-10  7:34 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: dgdegra

On 08/08/2012 17:05, "Jan Beulich" <JBeulich@suse.com> wrote:

> for common and x86 ones at least, to address the problem of storing
> zero-extended values into the multicall result field otherwise.
> 
> Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

Of course this should go in for the next 4.2 RC.

 -- Keir

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -2973,7 +2973,7 @@ static inline void fixunmap_domain_page(
>  #define fixunmap_domain_page(ptr) ((void)(ptr))
>  #endif
>  
> -int do_mmuext_op(
> +long do_mmuext_op(
>      XEN_GUEST_HANDLE(mmuext_op_t) uops,
>      unsigned int count,
>      XEN_GUEST_HANDLE(uint) pdone,
> @@ -3437,7 +3437,7 @@ int do_mmuext_op(
>      return rc;
>  }
>  
> -int do_mmu_update(
> +long do_mmu_update(
>      XEN_GUEST_HANDLE(mmu_update_t) ureqs,
>      unsigned int count,
>      XEN_GUEST_HANDLE(uint) pdone,
> @@ -4285,15 +4285,15 @@ static int __do_update_va_mapping(
>      return rc;
>  }
>  
> -int do_update_va_mapping(unsigned long va, u64 val64,
> -                         unsigned long flags)
> +long do_update_va_mapping(unsigned long va, u64 val64,
> +                          unsigned long flags)
>  {
>      return __do_update_va_mapping(va, val64, flags, current->domain);
>  }
>  
> -int do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
> -                                     unsigned long flags,
> -                                     domid_t domid)
> +long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
> +                                      unsigned long flags,
> +                                      domid_t domid)
>  {
>      struct domain *pg_owner;
>      int rc;
> --- a/xen/common/compat/xenoprof.c
> +++ b/xen/common/compat/xenoprof.c
> @@ -5,6 +5,7 @@
>  #include <compat/xenoprof.h>
>  
>  #define COMPAT
> +#define ret_t int
>  
>  #define do_xenoprof_op compat_xenoprof_op
>  
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -845,8 +845,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
>      return -EINVAL; /* never reached */
>  }
>  
> -int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
> -                           int compat)
> +static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void)
> uarg,
> +                                bool_t compat)
>  {
>      unsigned long flags;
>      int ret = -EINVAL;
> --- a/xen/common/xenoprof.c
> +++ b/xen/common/xenoprof.c
> @@ -607,6 +607,8 @@ static int xenoprof_op_init(XEN_GUEST_HA
>      return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
>  }
>  
> +#define ret_t long
> +
>  #endif /* !COMPAT */
>  
>  static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
> @@ -660,7 +662,7 @@ static int xenoprof_op_get_buffer(XEN_GU
>                        || (op == XENOPROF_disable_virq)  \
>                        || (op == XENOPROF_get_buffer))
>   
> -int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
> +ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
>  {
>      int ret = 0;
>      
> @@ -904,6 +906,7 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN
>  }
>  
>  #if defined(CONFIG_COMPAT) && !defined(COMPAT)
> +#undef ret_t
>  #include "compat/xenoprof.c"
>  #endif
>  
> --- a/xen/include/asm-x86/hypercall.h
> +++ b/xen/include/asm-x86/hypercall.h
> @@ -24,7 +24,7 @@ extern long
>  do_set_trap_table(
>      XEN_GUEST_HANDLE(const_trap_info_t) traps);
>  
> -extern int
> +extern long
>  do_mmu_update(
>      XEN_GUEST_HANDLE(mmu_update_t) ureqs,
>      unsigned int count,
> @@ -62,7 +62,7 @@ do_update_descriptor(
>  extern long
>  do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
>  
> -extern int
> +extern long
>  do_update_va_mapping(
>      unsigned long va,
>      u64 val64,
> @@ -72,14 +72,14 @@ extern long
>  do_physdev_op(
>      int cmd, XEN_GUEST_HANDLE(void) arg);
>  
> -extern int
> +extern long
>  do_update_va_mapping_otherdomain(
>      unsigned long va,
>      u64 val64,
>      unsigned long flags,
>      domid_t domid);
>  
> -extern int
> +extern long
>  do_mmuext_op(
>      XEN_GUEST_HANDLE(mmuext_op_t) uops,
>      unsigned int count,
> @@ -90,10 +90,6 @@ extern unsigned long
>  do_iret(
>      void);
>  
> -extern int
> -do_kexec(
> -    unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
> -
>  #ifdef __x86_64__
>  
>  extern long
> --- a/xen/include/xen/hypercall.h
> +++ b/xen/include/xen/hypercall.h
> @@ -137,7 +137,7 @@ extern long
>  do_tmem_op(
>      XEN_GUEST_HANDLE(tmem_op_t) uops);
>  
> -extern int
> +extern long
>  do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
>  
>  #ifdef CONFIG_COMPAT
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] make all (native) hypercalls consistently have "long" return type
  2012-08-10  7:34 ` Keir Fraser
@ 2012-08-10  7:54   ` Jan Beulich
  2012-08-10  8:35     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2012-08-10  7:54 UTC (permalink / raw)
  To: Keir Fraser; +Cc: dgdegra, xen-devel

>>> On 10.08.12 at 09:34, Keir Fraser <keir.xen@gmail.com> wrote:
> On 08/08/2012 17:05, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> for common and x86 ones at least, to address the problem of storing
>> zero-extended values into the multicall result field otherwise.
>> 
>> Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Keir Fraser <keir@xen.org>
> 
> Of course this should go in for the next 4.2 RC.

And I had hoped to also get this into 4.x.y, but I see that you
tagged the release already (and 4.1 also got pushed from
staging). So with 4.0.x now presumably dead, I'd just like to
ask to apply this to 4.1-testing then.

Jan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] make all (native) hypercalls consistently have "long" return type
  2012-08-10  7:54   ` Jan Beulich
@ 2012-08-10  8:35     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2012-08-10  8:35 UTC (permalink / raw)
  To: Jan Beulich; +Cc: dgdegra, xen-devel

On 10/08/2012 08:54, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 10.08.12 at 09:34, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 08/08/2012 17:05, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>> for common and x86 ones at least, to address the problem of storing
>>> zero-extended values into the multicall result field otherwise.
>>> 
>>> Reported-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> Acked-by: Keir Fraser <keir@xen.org>
>> 
>> Of course this should go in for the next 4.2 RC.
> 
> And I had hoped to also get this into 4.x.y, but I see that you
> tagged the release already (and 4.1 also got pushed from
> staging). So with 4.0.x now presumably dead, I'd just like to
> ask to apply this to 4.1-testing then.

I'm happy to apply it to both, with a 4.x.next-rc1-pre tag. We may never
actually do another release from 4.0 branch however!

Since there's no rush, it can sit in xen-4.2-rc for a short while and then
get backported as part of a batch.

 -- Keir

> Jan
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-10  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-08 16:05 [PATCH] make all (native) hypercalls consistently have "long" return type Jan Beulich
2012-08-10  7:34 ` Keir Fraser
2012-08-10  7:54   ` Jan Beulich
2012-08-10  8:35     ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.