Skip to contentSkip to conversation

xen/sched_rt: Use the correct type for _cpumask_scratch

PATCH In review Julien Grall 2 participants 3 messages Jun 2, 2015 – Jun 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/sched_rt: Use the correct type for _cpumask_scratch

The commit 376bbbabbda607d2039b8f839f15ff02721597d2 "sched_rt: print useful affinity info when dumping" breaks build on ARM64:

sched_rt.c: In function ‘rt_init’:
sched_rt.c:442:26: error: assignment from incompatible pointer type [-Werror]

         _cpumask_scratch = xmalloc_array(cpumask_var_t, nr_cpu_ids);
                          ^

sched_rt.c: In function ‘rt_alloc_pdata’:
sched_rt.c:489:29: error: passing argument 1 of ‘alloc_cpumask_var’ from incompatible pointer type [-Werror]
if ( !alloc_cpumask_var(&_cpumask_scratch[cpu]) )

This is because cpumask_var_t is not a type alias to cpumask_t** when the number of CPU > 2 * BITS_PER_LONG. The correct type for _cpumask_scratch should be cpumask_var_t.

Cc Dario Faggioli <[email protected]>
Cc George Dunlap <[email protected]>
---
 xen/common/sched_rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/sched_rt.c +1 -1
index 59ead57..5836d27 100644
@@ -127,7 +127,7 @@
  /*
   * Useful to avoid too many cpumask_var_t on the stack.
   */
-static cpumask_t **_cpumask_scratch;
+static cpumask_var_t *_cpumask_scratch;
 #define cpumask_scratch _cpumask_scratch[smp_processor_id()]
 
 /*
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 7 lines · Julien Grall

The commit 376bbbabbda607d2039b8f839f15ff02721597d2 "sched_rt: print useful affinity info when dumping" breaks build on ARM64:

sched_rt.c: In function ‘rt_init’:
sched_rt.c:442:26: error: assignment from incompatible pointer type [-Werror]

         _cpumask_scratch = xmalloc_array(cpumask_var_t, nr_cpu_ids);
                          ^
Quoted 8 lines

sched_rt.c: In function ‘rt_alloc_pdata’:
sched_rt.c:489:29: error: passing argument 1 of ‘alloc_cpumask_var’ from incompatible pointer type [-Werror]
if ( !alloc_cpumask_var(&_cpumask_scratch[cpu]) )

This is because cpumask_var_t is not a type alias to cpumask_t** when the number of CPU > 2 * BITS_PER_LONG. The correct type for _cpumask_scratch should be cpumask_var_t.

Oh, right.

Sorry for this, I didn't have an ARM build test sat up when working on this patch and, although now I have it, I did not run it through it when resending the patch (although, this is probably not only ARM related!).

Sorry also for not replying to this promptly, I was on leave until today (good that this has been picked already anyway :-)).

Dario

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Hi Dario,

Quoted 16 lines · Dario Faggioli
Quoted 7 lines · Julien Grall

The commit 376bbbabbda607d2039b8f839f15ff02721597d2 "sched_rt: print useful affinity info when dumping" breaks build on ARM64:

sched_rt.c: In function ‘rt_init’:
sched_rt.c:442:26: error: assignment from incompatible pointer type [-Werror]

          _cpumask_scratch = xmalloc_array(cpumask_var_t, nr_cpu_ids);
                           ^
Quoted 8 lines

sched_rt.c: In function ‘rt_alloc_pdata’:
sched_rt.c:489:29: error: passing argument 1 of ‘alloc_cpumask_var’ from incompatible pointer type [-Werror]
if ( !alloc_cpumask_var(&_cpumask_scratch[cpu]) )

This is because cpumask_var_t is not a type alias to cpumask_t** when the number of CPU > 2 * BITS_PER_LONG. The correct type for _cpumask_scratch should be cpumask_var_t.

Quoted 5 lines

Oh, right.

Sorry for this, I didn't have an ARM build test sat up when working on this patch and, although now I have it, I did not run it through it when resending the patch (although, this is probably not only ARM related!).

It's only present on ARM64 build. ARM32 build perfectly fine.

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel