diff mbox

[PULL,00/15] tb hash improvements

Message ID 20160610163432.GA22231@flamenco (mailing list archive)
State New, archived
Headers show

Commit Message

Emilio Cota June 10, 2016, 4:34 p.m. UTC
On Fri, Jun 10, 2016 at 16:33:10 +0100, Peter Maydell wrote:
> Fails to build on ppc64be :-(
> 
> In file included from /home/pm215/qemu/include/qemu/thread.h:4:0,
>                  from /home/pm215/qemu/include/block/aio.h:20,
>                  from /home/pm215/qemu/include/block/block.h:4,
>                  from /home/pm215/qemu/include/monitor/monitor.h:6,
>                  from /home/pm215/qemu/trace/control.c:23:
> /home/pm215/qemu/include/qemu/processor.h:24:35: error: expected
> identifier or ‘(’ before string constant
>                                    "or 2, 2, 2;" ::: "memory")

On Fri, Jun 10, 2016 at 16:57:19 +0100, Peter Maydell wrote:
> Also fails trying to build a test on 32-bit:
> 
> /home/petmay01/qemu/tests/qht-bench.c: In function 'pr_params':
> /home/petmay01/qemu/tests/qht-bench.c:270:5: error: format '%zu'
> expects argument of type 'size_t', but argument 2 has type 'long
> unsigned int' [-Werror=format=]
>      printf(" lookup range:      %zu\n", lookup_range);

Can you please test again after applying the appended delta?

Thanks,

		Emilio

Comments

Peter Maydell June 10, 2016, 4:41 p.m. UTC | #1
On 10 June 2016 at 17:34, Emilio G. Cota <cota@braap.org> wrote:
> On Fri, Jun 10, 2016 at 16:33:10 +0100, Peter Maydell wrote:
>> Fails to build on ppc64be :-(
>>
>> In file included from /home/pm215/qemu/include/qemu/thread.h:4:0,
>>                  from /home/pm215/qemu/include/block/aio.h:20,
>>                  from /home/pm215/qemu/include/block/block.h:4,
>>                  from /home/pm215/qemu/include/monitor/monitor.h:6,
>>                  from /home/pm215/qemu/trace/control.c:23:
>> /home/pm215/qemu/include/qemu/processor.h:24:35: error: expected
>> identifier or ‘(’ before string constant
>>                                    "or 2, 2, 2;" ::: "memory")
>
> On Fri, Jun 10, 2016 at 16:57:19 +0100, Peter Maydell wrote:
>> Also fails trying to build a test on 32-bit:
>>
>> /home/petmay01/qemu/tests/qht-bench.c: In function 'pr_params':
>> /home/petmay01/qemu/tests/qht-bench.c:270:5: error: format '%zu'
>> expects argument of type 'size_t', but argument 2 has type 'long
>> unsigned int' [-Werror=format=]
>>      printf(" lookup range:      %zu\n", lookup_range);
>
> Can you please test again after applying the appended delta?

I will test.

For the PPC asm, is it not just wanting the "\n" between instructions?
Shouldn't be necessary to use two separate asm() lines...

thanks
-- PMM
Emilio Cota June 10, 2016, 7:24 p.m. UTC | #2
On Fri, Jun 10, 2016 at 17:41:26 +0100, Peter Maydell wrote:
> On 10 June 2016 at 17:34, Emilio G. Cota <cota@braap.org> wrote:
> > On Fri, Jun 10, 2016 at 16:33:10 +0100, Peter Maydell wrote:
> >> Fails to build on ppc64be :-(
> >>
> >> In file included from /home/pm215/qemu/include/qemu/thread.h:4:0,
> >>                  from /home/pm215/qemu/include/block/aio.h:20,
> >>                  from /home/pm215/qemu/include/block/block.h:4,
> >>                  from /home/pm215/qemu/include/monitor/monitor.h:6,
> >>                  from /home/pm215/qemu/trace/control.c:23:
> >> /home/pm215/qemu/include/qemu/processor.h:24:35: error: expected
> >> identifier or ‘(’ before string constant
> >>                                    "or 2, 2, 2;" ::: "memory")
> >
> > On Fri, Jun 10, 2016 at 16:57:19 +0100, Peter Maydell wrote:
> >> Also fails trying to build a test on 32-bit:
> >>
> >> /home/petmay01/qemu/tests/qht-bench.c: In function 'pr_params':
> >> /home/petmay01/qemu/tests/qht-bench.c:270:5: error: format '%zu'
> >> expects argument of type 'size_t', but argument 2 has type 'long
> >> unsigned int' [-Werror=format=]
> >>      printf(" lookup range:      %zu\n", lookup_range);
> >
> > Can you please test again after applying the appended delta?
> 
> I will test.
> 
> For the PPC asm, is it not just wanting the "\n" between instructions?
> Shouldn't be necessary to use two separate asm() lines...

I can't test on ppc so I was just being paranoid to avoid
wasting your time :-)

		E.
Richard Henderson June 11, 2016, 11:09 p.m. UTC | #3
On 06/10/2016 09:41 AM, Peter Maydell wrote:
> On 10 June 2016 at 17:34, Emilio G. Cota <cota@braap.org> wrote:
>> On Fri, Jun 10, 2016 at 16:33:10 +0100, Peter Maydell wrote:
>>> Fails to build on ppc64be :-(
>>>
>>> In file included from /home/pm215/qemu/include/qemu/thread.h:4:0,
>>>                  from /home/pm215/qemu/include/block/aio.h:20,
>>>                  from /home/pm215/qemu/include/block/block.h:4,
>>>                  from /home/pm215/qemu/include/monitor/monitor.h:6,
>>>                  from /home/pm215/qemu/trace/control.c:23:
>>> /home/pm215/qemu/include/qemu/processor.h:24:35: error: expected
>>> identifier or ‘(’ before string constant
>>>                                    "or 2, 2, 2;" ::: "memory")
>>
>> On Fri, Jun 10, 2016 at 16:57:19 +0100, Peter Maydell wrote:
>>> Also fails trying to build a test on 32-bit:
>>>
>>> /home/petmay01/qemu/tests/qht-bench.c: In function 'pr_params':
>>> /home/petmay01/qemu/tests/qht-bench.c:270:5: error: format '%zu'
>>> expects argument of type 'size_t', but argument 2 has type 'long
>>> unsigned int' [-Werror=format=]
>>>      printf(" lookup range:      %zu\n", lookup_range);
>>
>> Can you please test again after applying the appended delta?
>
> I will test.
>
> For the PPC asm, is it not just wanting the "\n" between instructions?
> Shouldn't be necessary to use two separate asm() lines...

It has a ; between instructions.  That's not the problem.

What it needs is a \ to continue the macro to the second line.

I've just finished a build on ppc64 with that one character fix.


r~
diff mbox

Patch

diff --git a/include/qemu/processor.h b/include/qemu/processor.h
index 42bcc99..c28d7e3 100644
--- a/include/qemu/processor.h
+++ b/include/qemu/processor.h
@@ -20,8 +20,12 @@ 
 
 #elif defined(__powerpc64__)
 /* set Hardware Multi-Threading (HMT) priority to low; then back to medium */
-# define cpu_relax() asm volatile("or 1, 1, 1;"
-                                  "or 2, 2, 2;" ::: "memory")
+# define cpu_relax()                            \
+    do {                                        \
+        asm volatile("or 1,1,1");               \
+        asm volatile("or 2,2,2");               \
+        barrier();                              \
+    } while (0)
 
 #else
 # define cpu_relax() barrier()
diff --git a/tests/qht-bench.c b/tests/qht-bench.c
index c7f73b4..ad8efbc 100644
--- a/tests/qht-bench.c
+++ b/tests/qht-bench.c
@@ -267,8 +267,8 @@  static void pr_params(void)
     printf(" update rate:       %f%%\n", update_rate * 100.0);
     printf(" offset:            %ld\n", populate_offset);
     printf(" initial key range: %zu\n", init_range);
-    printf(" lookup range:      %zu\n", lookup_range);
-    printf(" update range:      %zu\n", update_range);
+    printf(" lookup range:      %lu\n", lookup_range);
+    printf(" update range:      %lu\n", update_range);
 }
 
 static void do_threshold(double rate, uint64_t *threshold)