Patchwork [FOR,0.12] fix undefined shifts by >32

login
register
mail settings
Submitter Paolo Bonzini
Date Jan. 28, 2010, 10:04 a.m.
Message ID <1264673094-18238-1-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/43855/
State New
Headers show

Comments

Paolo Bonzini - Jan. 28, 2010, 10:04 a.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Aurelien Jarno - Feb. 27, 2010, 6:50 p.m.
I have actually cherry-picked the commit from HEAD.

On Thu, Jan 28, 2010 at 11:04:54AM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  vl.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 5e8c775..d9f1ccb 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2373,9 +2373,9 @@ static void numa_add(const char *optarg)
>                          fprintf(stderr,
>                              "only 63 CPUs in NUMA mode supported.\n");
>                      }
> -                    value = (1 << (endvalue + 1)) - (1 << value);
> +                    value = (2ULL << endvalue) - (1ULL << value);
>                  } else {
> -                    value = 1 << value;
> +                    value = 1ULL << value;
>                  }
>              }
>              node_cpumask[nodenr] = value;
> -- 
> 1.6.6
> 
> 
> 
> 
>

Patch

diff --git a/vl.c b/vl.c
index 5e8c775..d9f1ccb 100644
--- a/vl.c
+++ b/vl.c
@@ -2373,9 +2373,9 @@  static void numa_add(const char *optarg)
                         fprintf(stderr,
                             "only 63 CPUs in NUMA mode supported.\n");
                     }
-                    value = (1 << (endvalue + 1)) - (1 << value);
+                    value = (2ULL << endvalue) - (1ULL << value);
                 } else {
-                    value = 1 << value;
+                    value = 1ULL << value;
                 }
             }
             node_cpumask[nodenr] = value;