All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
@ 2016-07-29  9:06 Vitaly Kuznetsov
  2016-07-29 17:13 ` Stefano Stabellini
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Vitaly Kuznetsov @ 2016-07-29  9:06 UTC (permalink / raw)
  To: xen-devel
  Cc: linux-kernel, Boris Ostrovsky, David Vrabel, Juergen Gross,
	Stefano Stabellini, Julien Grall

We pass xen_vcpu_id mapping information to hypercalls which require
uint32_t type so it would be cleaner to have it as uint32_t. The
initializer to -1 can be dropped as we always do the mapping before using
it and we never check the 'not set' value anyway.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
Changes since v2:
- Change the return value type of xen_vcpu_nr to uint32_t [David Vrabel]
---
 arch/arm/xen/enlighten.c | 2 +-
 arch/x86/xen/enlighten.c | 2 +-
 include/xen/xen-ops.h    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 6d3a171..1752116 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
 static struct vcpu_info __percpu *xen_vcpu_info;
 
 /* Linux <-> Xen vCPU id mapping */
-DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
 
 /* These are unused until we support booting "pre-ballooned" */
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 54eef1a..78a14a0 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
 
 /* Linux <-> Xen vCPU id mapping */
-DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
 
 enum xen_domain_type xen_domain_type = XEN_NATIVE;
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index a4926f1..aac1be8 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -9,8 +9,8 @@
 
 DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
 
-DECLARE_PER_CPU(int, xen_vcpu_id);
-static inline int xen_vcpu_nr(int cpu)
+DECLARE_PER_CPU(uint32_t, xen_vcpu_id);
+static inline uint32_t xen_vcpu_nr(int cpu)
 {
 	return per_cpu(xen_vcpu_id, cpu);
 }
-- 
2.7.4

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

* Re: [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
  2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
  2016-07-29 17:13 ` Stefano Stabellini
@ 2016-07-29 17:13 ` Stefano Stabellini
  2016-08-02  7:08   ` Juergen Gross
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2016-07-29 17:13 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: xen-devel, linux-kernel, Boris Ostrovsky, David Vrabel,
	Juergen Gross, Stefano Stabellini, Julien Grall

On Fri, 29 Jul 2016, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

It would probably be better to keep the initializer and add an assert to
xen_vcpu_nr. But I don't want to be too picky, so:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> Changes since v2:
> - Change the return value type of xen_vcpu_nr to uint32_t [David Vrabel]
> ---
>  arch/arm/xen/enlighten.c | 2 +-
>  arch/x86/xen/enlighten.c | 2 +-
>  include/xen/xen-ops.h    | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 6d3a171..1752116 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  static struct vcpu_info __percpu *xen_vcpu_info;
>  
>  /* Linux <-> Xen vCPU id mapping */
> -DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
> +DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
>  EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
>  
>  /* These are unused until we support booting "pre-ballooned" */
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 54eef1a..78a14a0 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
>  
>  /* Linux <-> Xen vCPU id mapping */
> -DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
> +DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
>  EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
>  
>  enum xen_domain_type xen_domain_type = XEN_NATIVE;
> diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
> index a4926f1..aac1be8 100644
> --- a/include/xen/xen-ops.h
> +++ b/include/xen/xen-ops.h
> @@ -9,8 +9,8 @@
>  
>  DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  
> -DECLARE_PER_CPU(int, xen_vcpu_id);
> -static inline int xen_vcpu_nr(int cpu)
> +DECLARE_PER_CPU(uint32_t, xen_vcpu_id);
> +static inline uint32_t xen_vcpu_nr(int cpu)
>  {
>  	return per_cpu(xen_vcpu_id, cpu);
>  }
> -- 
> 2.7.4
> 

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

* Re: [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
  2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
@ 2016-07-29 17:13 ` Stefano Stabellini
  2016-07-29 17:13 ` Stefano Stabellini
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2016-07-29 17:13 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: Juergen Gross, Stefano Stabellini, linux-kernel, Julien Grall,
	David Vrabel, xen-devel, Boris Ostrovsky

On Fri, 29 Jul 2016, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

It would probably be better to keep the initializer and add an assert to
xen_vcpu_nr. But I don't want to be too picky, so:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> Changes since v2:
> - Change the return value type of xen_vcpu_nr to uint32_t [David Vrabel]
> ---
>  arch/arm/xen/enlighten.c | 2 +-
>  arch/x86/xen/enlighten.c | 2 +-
>  include/xen/xen-ops.h    | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 6d3a171..1752116 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  static struct vcpu_info __percpu *xen_vcpu_info;
>  
>  /* Linux <-> Xen vCPU id mapping */
> -DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
> +DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
>  EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
>  
>  /* These are unused until we support booting "pre-ballooned" */
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 54eef1a..78a14a0 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
>  
>  /* Linux <-> Xen vCPU id mapping */
> -DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
> +DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
>  EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
>  
>  enum xen_domain_type xen_domain_type = XEN_NATIVE;
> diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
> index a4926f1..aac1be8 100644
> --- a/include/xen/xen-ops.h
> +++ b/include/xen/xen-ops.h
> @@ -9,8 +9,8 @@
>  
>  DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
>  
> -DECLARE_PER_CPU(int, xen_vcpu_id);
> -static inline int xen_vcpu_nr(int cpu)
> +DECLARE_PER_CPU(uint32_t, xen_vcpu_id);
> +static inline uint32_t xen_vcpu_nr(int cpu)
>  {
>  	return per_cpu(xen_vcpu_id, cpu);
>  }
> -- 
> 2.7.4
> 

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

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

* Re: [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
  2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
@ 2016-08-02  7:08   ` Juergen Gross
  2016-07-29 17:13 ` Stefano Stabellini
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2016-08-02  7:08 UTC (permalink / raw)
  To: Vitaly Kuznetsov, xen-devel
  Cc: linux-kernel, Boris Ostrovsky, David Vrabel, Stefano Stabellini,
	Julien Grall

On 29/07/16 11:06, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Thanks,

Juergen

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

* Re: [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
@ 2016-08-02  7:08   ` Juergen Gross
  0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2016-08-02  7:08 UTC (permalink / raw)
  To: Vitaly Kuznetsov, xen-devel
  Cc: Boris Ostrovsky, Stefano Stabellini, Julien Grall, linux-kernel,
	David Vrabel

On 29/07/16 11:06, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Thanks,

Juergen

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

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

* Re: [Xen-devel] [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
  2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
                   ` (2 preceding siblings ...)
  2016-08-02  7:08   ` Juergen Gross
@ 2016-08-24 17:43 ` David Vrabel
  2016-08-24 17:43 ` David Vrabel
  4 siblings, 0 replies; 8+ messages in thread
From: David Vrabel @ 2016-08-24 17:43 UTC (permalink / raw)
  To: Vitaly Kuznetsov, xen-devel
  Cc: Juergen Gross, Stefano Stabellini, linux-kernel, Julien Grall,
	David Vrabel, Boris Ostrovsky

On 29/07/16 10:06, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.

Applied to for-linus-4.8b, thanks.

David

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

* Re: [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
  2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
                   ` (3 preceding siblings ...)
  2016-08-24 17:43 ` [Xen-devel] " David Vrabel
@ 2016-08-24 17:43 ` David Vrabel
  4 siblings, 0 replies; 8+ messages in thread
From: David Vrabel @ 2016-08-24 17:43 UTC (permalink / raw)
  To: Vitaly Kuznetsov, xen-devel
  Cc: Juergen Gross, Stefano Stabellini, linux-kernel, Julien Grall,
	David Vrabel, Boris Ostrovsky

On 29/07/16 10:06, Vitaly Kuznetsov wrote:
> We pass xen_vcpu_id mapping information to hypercalls which require
> uint32_t type so it would be cleaner to have it as uint32_t. The
> initializer to -1 can be dropped as we always do the mapping before using
> it and we never check the 'not set' value anyway.

Applied to for-linus-4.8b, thanks.

David

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

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

* [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t
@ 2016-07-29  9:06 Vitaly Kuznetsov
  0 siblings, 0 replies; 8+ messages in thread
From: Vitaly Kuznetsov @ 2016-07-29  9:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, linux-kernel, Julien Grall,
	David Vrabel, Boris Ostrovsky

We pass xen_vcpu_id mapping information to hypercalls which require
uint32_t type so it would be cleaner to have it as uint32_t. The
initializer to -1 can be dropped as we always do the mapping before using
it and we never check the 'not set' value anyway.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
Changes since v2:
- Change the return value type of xen_vcpu_nr to uint32_t [David Vrabel]
---
 arch/arm/xen/enlighten.c | 2 +-
 arch/x86/xen/enlighten.c | 2 +-
 include/xen/xen-ops.h    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 6d3a171..1752116 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
 static struct vcpu_info __percpu *xen_vcpu_info;
 
 /* Linux <-> Xen vCPU id mapping */
-DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
 
 /* These are unused until we support booting "pre-ballooned" */
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 54eef1a..78a14a0 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
 
 /* Linux <-> Xen vCPU id mapping */
-DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
 
 enum xen_domain_type xen_domain_type = XEN_NATIVE;
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index a4926f1..aac1be8 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -9,8 +9,8 @@
 
 DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
 
-DECLARE_PER_CPU(int, xen_vcpu_id);
-static inline int xen_vcpu_nr(int cpu)
+DECLARE_PER_CPU(uint32_t, xen_vcpu_id);
+static inline uint32_t xen_vcpu_nr(int cpu)
 {
 	return per_cpu(xen_vcpu_id, cpu);
 }
-- 
2.7.4


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

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

end of thread, other threads:[~2016-08-24 17:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-29  9:06 [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t Vitaly Kuznetsov
2016-07-29 17:13 ` Stefano Stabellini
2016-07-29 17:13 ` Stefano Stabellini
2016-08-02  7:08 ` Juergen Gross
2016-08-02  7:08   ` Juergen Gross
2016-08-24 17:43 ` [Xen-devel] " David Vrabel
2016-08-24 17:43 ` David Vrabel
2016-07-29  9:06 Vitaly Kuznetsov

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.