All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype
@ 2017-06-05  8:41 Sergey Dyasli
  2017-06-06  8:03 ` [Xen-devel] " Jan Beulich
  2017-06-06  8:03 ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Sergey Dyasli @ 2017-06-05  8:41 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: Paul Durrant, Stefano Stabellini, Boris Ostrovsky, Juergen Gross,
	Julien Grall, Marc Zyngier, Sergey Dyasli

Change the third parameter to be the required struct xen_dm_op_buf *
instead of a generic void * (which blindly accepts any pointer).

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
---
 arch/x86/include/asm/xen/hypercall.h | 3 ++-
 include/xen/arm/hypercall.h          | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index f6d20f6cca12..e111ae874647 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -49,6 +49,7 @@
 #include <xen/interface/physdev.h>
 #include <xen/interface/platform.h>
 #include <xen/interface/xen-mca.h>
+#include <xen/interface/hvm/dm_op.h>
 
 /*
  * The hypercall asms have to meet several constraints:
@@ -474,7 +475,7 @@ HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
 
 static inline int
 HYPERVISOR_dm_op(
-	domid_t dom, unsigned int nr_bufs, void *bufs)
+	domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs)
 {
 	return _hypercall3(int, dm_op, dom, nr_bufs, bufs);
 }
diff --git a/include/xen/arm/hypercall.h b/include/xen/arm/hypercall.h
index 73db4b2eeb89..d3a732d1ede8 100644
--- a/include/xen/arm/hypercall.h
+++ b/include/xen/arm/hypercall.h
@@ -38,6 +38,7 @@
 #include <xen/interface/xen.h>
 #include <xen/interface/sched.h>
 #include <xen/interface/platform.h>
+#include <xen/interface/hvm/dm_op.h>
 
 long privcmd_call(unsigned call, unsigned long a1,
 		unsigned long a2, unsigned long a3,
@@ -53,7 +54,8 @@ int HYPERVISOR_physdev_op(int cmd, void *arg);
 int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
 int HYPERVISOR_tmem_op(void *arg);
 int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
-int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs, void *bufs);
+int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
+		     struct xen_dm_op_buf *bufs);
 int HYPERVISOR_platform_op_raw(void *arg);
 static inline int HYPERVISOR_platform_op(struct xen_platform_op *op)
 {
-- 
2.11.0

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

* Re: [Xen-devel] [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype
  2017-06-05  8:41 [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype Sergey Dyasli
@ 2017-06-06  8:03 ` Jan Beulich
  2017-06-06  9:43   ` Sergey Dyasli
  2017-06-06  9:43   ` [Xen-devel] " Sergey Dyasli
  2017-06-06  8:03 ` Jan Beulich
  1 sibling, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2017-06-06  8:03 UTC (permalink / raw)
  To: Sergey Dyasli
  Cc: Julien Grall, Marc Zyngier, Paul Durrant, Stefano Stabellini,
	xen-devel, Boris Ostrovsky, Juergen Gross, linux-kernel

>>> On 05.06.17 at 10:41, <sergey.dyasli@citrix.com> wrote:
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -49,6 +49,7 @@
>  #include <xen/interface/physdev.h>
>  #include <xen/interface/platform.h>
>  #include <xen/interface/xen-mca.h>
> +#include <xen/interface/hvm/dm_op.h>

Why?

> @@ -474,7 +475,7 @@ HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
>  
>  static inline int
>  HYPERVISOR_dm_op(
> -	domid_t dom, unsigned int nr_bufs, void *bufs)
> +	domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs)

All you need above here is a forward declaration of the structure.
We should really avoid forcing source files to include all sorts of
headers without actually needing anything from them.

> --- a/include/xen/arm/hypercall.h
> +++ b/include/xen/arm/hypercall.h
> @@ -38,6 +38,7 @@
>  #include <xen/interface/xen.h>
>  #include <xen/interface/sched.h>
>  #include <xen/interface/platform.h>
> +#include <xen/interface/hvm/dm_op.h>

Same here.

> @@ -53,7 +54,8 @@ int HYPERVISOR_physdev_op(int cmd, void *arg);
>  int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
>  int HYPERVISOR_tmem_op(void *arg);
>  int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
> -int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs, void *bufs);
> +int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
> +		     struct xen_dm_op_buf *bufs);

How come you get away with changing a declaration without
also changing the matching definition?

Jan

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

* Re: [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype
  2017-06-05  8:41 [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype Sergey Dyasli
  2017-06-06  8:03 ` [Xen-devel] " Jan Beulich
@ 2017-06-06  8:03 ` Jan Beulich
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2017-06-06  8:03 UTC (permalink / raw)
  To: Sergey Dyasli
  Cc: Juergen Gross, Stefano Stabellini, Marc Zyngier, linux-kernel,
	Julien Grall, Paul Durrant, xen-devel, Boris Ostrovsky

>>> On 05.06.17 at 10:41, <sergey.dyasli@citrix.com> wrote:
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -49,6 +49,7 @@
>  #include <xen/interface/physdev.h>
>  #include <xen/interface/platform.h>
>  #include <xen/interface/xen-mca.h>
> +#include <xen/interface/hvm/dm_op.h>

Why?

> @@ -474,7 +475,7 @@ HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
>  
>  static inline int
>  HYPERVISOR_dm_op(
> -	domid_t dom, unsigned int nr_bufs, void *bufs)
> +	domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs)

All you need above here is a forward declaration of the structure.
We should really avoid forcing source files to include all sorts of
headers without actually needing anything from them.

> --- a/include/xen/arm/hypercall.h
> +++ b/include/xen/arm/hypercall.h
> @@ -38,6 +38,7 @@
>  #include <xen/interface/xen.h>
>  #include <xen/interface/sched.h>
>  #include <xen/interface/platform.h>
> +#include <xen/interface/hvm/dm_op.h>

Same here.

> @@ -53,7 +54,8 @@ int HYPERVISOR_physdev_op(int cmd, void *arg);
>  int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
>  int HYPERVISOR_tmem_op(void *arg);
>  int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
> -int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs, void *bufs);
> +int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
> +		     struct xen_dm_op_buf *bufs);

How come you get away with changing a declaration without
also changing the matching definition?

Jan


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

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

* Re: [Xen-devel] [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype
  2017-06-06  8:03 ` [Xen-devel] " Jan Beulich
  2017-06-06  9:43   ` Sergey Dyasli
@ 2017-06-06  9:43   ` Sergey Dyasli
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey Dyasli @ 2017-06-06  9:43 UTC (permalink / raw)
  To: JBeulich
  Cc: boris.ostrovsky, linux-kernel, sstabellini, Paul Durrant,
	Sergey Dyasli, jgross, marc.zyngier, xen-devel, julien.grall

On Tue, 2017-06-06 at 02:03 -0600, Jan Beulich wrote:
> > > > On 05.06.17 at 10:41, <sergey.dyasli@citrix.com> wrote:
> > 
> > --- a/arch/x86/include/asm/xen/hypercall.h
> > +++ b/arch/x86/include/asm/xen/hypercall.h
> > @@ -49,6 +49,7 @@
> >  #include <xen/interface/physdev.h>
> >  #include <xen/interface/platform.h>
> >  #include <xen/interface/xen-mca.h>
> > +#include <xen/interface/hvm/dm_op.h>
> 
> Why?
> 
> > @@ -474,7 +475,7 @@ HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
> >  
> >  static inline int
> >  HYPERVISOR_dm_op(
> > -	domid_t dom, unsigned int nr_bufs, void *bufs)
> > +	domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs)
> 
> All you need above here is a forward declaration of the structure.
> We should really avoid forcing source files to include all sorts of
> headers without actually needing anything from them.

Thank you for the good suggestion. I will fix this in v2.

> 
> > --- a/include/xen/arm/hypercall.h
> > +++ b/include/xen/arm/hypercall.h
> > @@ -38,6 +38,7 @@
> >  #include <xen/interface/xen.h>
> >  #include <xen/interface/sched.h>
> >  #include <xen/interface/platform.h>
> > +#include <xen/interface/hvm/dm_op.h>
> 
> Same here.
> 
> > @@ -53,7 +54,8 @@ int HYPERVISOR_physdev_op(int cmd, void *arg);
> >  int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
> >  int HYPERVISOR_tmem_op(void *arg);
> >  int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
> > -int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs, void *bufs);
> > +int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
> > +		     struct xen_dm_op_buf *bufs);
> 
> How come you get away with changing a declaration without
> also changing the matching definition?

The definition of HYPERVISOR_dm_op() is in arch/arm/xen/hypercall.S

-- 
Thanks,
Sergey

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

* Re: [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype
  2017-06-06  8:03 ` [Xen-devel] " Jan Beulich
@ 2017-06-06  9:43   ` Sergey Dyasli
  2017-06-06  9:43   ` [Xen-devel] " Sergey Dyasli
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey Dyasli @ 2017-06-06  9:43 UTC (permalink / raw)
  To: JBeulich
  Cc: jgross, Sergey Dyasli, sstabellini, marc.zyngier, linux-kernel,
	julien.grall, Paul Durrant, xen-devel, boris.ostrovsky

On Tue, 2017-06-06 at 02:03 -0600, Jan Beulich wrote:
> > > > On 05.06.17 at 10:41, <sergey.dyasli@citrix.com> wrote:
> > 
> > --- a/arch/x86/include/asm/xen/hypercall.h
> > +++ b/arch/x86/include/asm/xen/hypercall.h
> > @@ -49,6 +49,7 @@
> >  #include <xen/interface/physdev.h>
> >  #include <xen/interface/platform.h>
> >  #include <xen/interface/xen-mca.h>
> > +#include <xen/interface/hvm/dm_op.h>
> 
> Why?
> 
> > @@ -474,7 +475,7 @@ HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
> >  
> >  static inline int
> >  HYPERVISOR_dm_op(
> > -	domid_t dom, unsigned int nr_bufs, void *bufs)
> > +	domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs)
> 
> All you need above here is a forward declaration of the structure.
> We should really avoid forcing source files to include all sorts of
> headers without actually needing anything from them.

Thank you for the good suggestion. I will fix this in v2.

> 
> > --- a/include/xen/arm/hypercall.h
> > +++ b/include/xen/arm/hypercall.h
> > @@ -38,6 +38,7 @@
> >  #include <xen/interface/xen.h>
> >  #include <xen/interface/sched.h>
> >  #include <xen/interface/platform.h>
> > +#include <xen/interface/hvm/dm_op.h>
> 
> Same here.
> 
> > @@ -53,7 +54,8 @@ int HYPERVISOR_physdev_op(int cmd, void *arg);
> >  int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
> >  int HYPERVISOR_tmem_op(void *arg);
> >  int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
> > -int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs, void *bufs);
> > +int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
> > +		     struct xen_dm_op_buf *bufs);
> 
> How come you get away with changing a declaration without
> also changing the matching definition?

The definition of HYPERVISOR_dm_op() is in arch/arm/xen/hypercall.S

-- 
Thanks,
Sergey
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-06-06  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05  8:41 [PATCH v1] xen: fix HYPERVISOR_dm_op() prototype Sergey Dyasli
2017-06-06  8:03 ` [Xen-devel] " Jan Beulich
2017-06-06  9:43   ` Sergey Dyasli
2017-06-06  9:43   ` [Xen-devel] " Sergey Dyasli
2017-06-06  8:03 ` Jan Beulich

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.