All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
@ 2018-03-19 21:53 Eric Blake
  2018-03-19 22:08 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Eric Blake @ 2018-03-19 21:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Yuval Shaia, Marcel Apfelbaum

Use the correct printf formats, so that a 32-bit compile doesn't
spit out lots of warnings about %lx being incompatible with uint64_t.
Broken since initial commit ef6d4ccd.

Signed-off-by: Eric Blake <eblake@redhat.com>
---

I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
for me for other reasons); I found it via a 32-bit rawhide VM.

 hw/rdma/rdma_backend.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
index e306fba5344..89020fdcf62 100644
--- a/hw/rdma/rdma_backend.c
+++ b/hw/rdma/rdma_backend.c
@@ -656,7 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp)
 #define CHK_ATTR(req, dev, member, fmt) ({ \
     pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \
     if (req->member > dev.member) { \
-        warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \
+        warn_report("%s = 0x%" PRIx64 " is higher than host device " \
+                    "capability 0x%" PRIx64, \
                     #member, (uint64_t)req->member, (uint64_t)dev.member); \
         req->member = dev.member; \
     } \
-- 
2.14.3

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-19 21:53 [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation Eric Blake
@ 2018-03-19 22:08 ` Eric Blake
  2018-03-20 10:36   ` Marcel Apfelbaum
  2018-03-20 10:30 ` Marcel Apfelbaum
  2018-03-20 10:43 ` Yuval Shaia
  2 siblings, 1 reply; 10+ messages in thread
From: Eric Blake @ 2018-03-19 22:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Marcel Apfelbaum, Yuval Shaia

On 03/19/2018 04:53 PM, Eric Blake wrote:
> Use the correct printf formats, so that a 32-bit compile doesn't
> spit out lots of warnings about %lx being incompatible with uint64_t.
> Broken since initial commit ef6d4ccd.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 
> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> for me for other reasons); I found it via a 32-bit rawhide VM.

That fixes most of the warnings, but not:

/home/dummy/qemu/hw/rdma/rdma_backend.c: In function 
'rdma_backend_create_mr':
/home/dummy/qemu/hw/rdma/rdma_backend.c:409:37: error: cast to pointer 
from integer of different size [-Werror=int-to-pointer-cast]
      m4->ibmr = ibv_reg_m4(pd->ibpd, (void *)addr, length, access);
                                      ^

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-19 21:53 [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation Eric Blake
  2018-03-19 22:08 ` Eric Blake
@ 2018-03-20 10:30 ` Marcel Apfelbaum
  2018-03-21  1:46   ` Fam Zheng
  2018-03-21  2:07   ` Fam Zheng
  2018-03-20 10:43 ` Yuval Shaia
  2 siblings, 2 replies; 10+ messages in thread
From: Marcel Apfelbaum @ 2018-03-20 10:30 UTC (permalink / raw)
  To: Eric Blake, qemu-devel, Fam Zheng; +Cc: qemu-trivial, Yuval Shaia

Hi Eric,

On 19/03/2018 23:53, Eric Blake wrote:
> Use the correct printf formats, so that a 32-bit compile doesn't
> spit out lots of warnings about %lx being incompatible with uint64_t.
> Broken since initial commit ef6d4ccd.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 
> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> for me for other reasons); I found it via a 32-bit rawhide VM.
> 

I couldn't run 'make vm-build-ubuntu.i368' either. (Stuck on "Booting from Hard Disk...")

I run make docker-test-build@debian-win32-cross to be sure it compiles on 32bit arch,
however I found out the docker configuration results in 'RDMA support no', so it will not help.

Fam, is there any way the docker image can be updated with the RDMA libraries
so we can check this too?

>  hw/rdma/rdma_backend.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
> index e306fba5344..89020fdcf62 100644
> --- a/hw/rdma/rdma_backend.c
> +++ b/hw/rdma/rdma_backend.c
> @@ -656,7 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp)
>  #define CHK_ATTR(req, dev, member, fmt) ({ \
>      pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \
>      if (req->member > dev.member) { \
> -        warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \
> +        warn_report("%s = 0x%" PRIx64 " is higher than host device " \
> +                    "capability 0x%" PRIx64, \
>                      #member, (uint64_t)req->member, (uint64_t)dev.member); \
>          req->member = dev.member; \
>      } \
> 

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>


Thanks,
Marcel

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-19 22:08 ` Eric Blake
@ 2018-03-20 10:36   ` Marcel Apfelbaum
  0 siblings, 0 replies; 10+ messages in thread
From: Marcel Apfelbaum @ 2018-03-20 10:36 UTC (permalink / raw)
  To: Eric Blake, qemu-devel; +Cc: qemu-trivial, Yuval Shaia

On 20/03/2018 0:08, Eric Blake wrote:
> On 03/19/2018 04:53 PM, Eric Blake wrote:
>> Use the correct printf formats, so that a 32-bit compile doesn't
>> spit out lots of warnings about %lx being incompatible with uint64_t.
>> Broken since initial commit ef6d4ccd.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>
>> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
>> for me for other reasons); I found it via a 32-bit rawhide VM.
> 
> That fixes most of the warnings,

Thanks!

> but not:
> 
> /home/dummy/qemu/hw/rdma/rdma_backend.c: In function 'rdma_backend_create_mr':
> /home/dummy/qemu/hw/rdma/rdma_backend.c:409:37: error: cast to pointer from integer of different size
> [-Werror=int-to-pointer-cast]
>      m4->ibmr = ibv_reg_m4(pd->ibpd, (void *)addr, length, access);
>                                      ^
> 

So the compilation actually brakes on 32bit machines?
I'll create a VM.

Thanks,
Marcel

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-19 21:53 [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation Eric Blake
  2018-03-19 22:08 ` Eric Blake
  2018-03-20 10:30 ` Marcel Apfelbaum
@ 2018-03-20 10:43 ` Yuval Shaia
  2018-03-21 16:52   ` Marcel Apfelbaum
  2 siblings, 1 reply; 10+ messages in thread
From: Yuval Shaia @ 2018-03-20 10:43 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, qemu-trivial, Marcel Apfelbaum, yuval.shaia

On Mon, Mar 19, 2018 at 04:53:35PM -0500, Eric Blake wrote:
> Use the correct printf formats, so that a 32-bit compile doesn't
> spit out lots of warnings about %lx being incompatible with uint64_t.
> Broken since initial commit ef6d4ccd.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 
> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> for me for other reasons); I found it via a 32-bit rawhide VM.
> 
>  hw/rdma/rdma_backend.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
> index e306fba5344..89020fdcf62 100644
> --- a/hw/rdma/rdma_backend.c
> +++ b/hw/rdma/rdma_backend.c
> @@ -656,7 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp)
>  #define CHK_ATTR(req, dev, member, fmt) ({ \
>      pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \
>      if (req->member > dev.member) { \
> -        warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \
> +        warn_report("%s = 0x%" PRIx64 " is higher than host device " \
> +                    "capability 0x%" PRIx64, \
>                      #member, (uint64_t)req->member, (uint64_t)dev.member); \

Hmmm, interesting.
I wonder why in first place to cast all members to uint64_t.
Can you try the method that is used above in the call to pr_dbg, i.e. to
use the given argument fmt?

Something like this:
	warn_report("%s = "fmt" is higher than host device capability "fmt, \
	            #member, req->member, dev.member); \

>          req->member = dev.member; \
>      } \
> -- 
> 2.14.3
> 

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-20 10:30 ` Marcel Apfelbaum
@ 2018-03-21  1:46   ` Fam Zheng
  2018-03-21  2:07   ` Fam Zheng
  1 sibling, 0 replies; 10+ messages in thread
From: Fam Zheng @ 2018-03-21  1:46 UTC (permalink / raw)
  To: Marcel Apfelbaum
  Cc: Eric Blake, qemu-devel, qemu-trivial, Yuval Shaia,
	Philippe Mathieu-Daudé,
	Alex Bennée

On Tue, 03/20 12:30, Marcel Apfelbaum wrote:
> Hi Eric,
> 
> On 19/03/2018 23:53, Eric Blake wrote:
> > Use the correct printf formats, so that a 32-bit compile doesn't
> > spit out lots of warnings about %lx being incompatible with uint64_t.
> > Broken since initial commit ef6d4ccd.
> > 
> > Signed-off-by: Eric Blake <eblake@redhat.com>
> > ---
> > 
> > I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> > for me for other reasons); I found it via a 32-bit rawhide VM.
> > 
> 
> I couldn't run 'make vm-build-ubuntu.i368' either. (Stuck on "Booting from Hard Disk...")
> 
> I run make docker-test-build@debian-win32-cross to be sure it compiles on 32bit arch,
> however I found out the docker configuration results in 'RDMA support no', so it will not help.

Cc'ing Phil and Alex who know this image better than me. Meanwhile I'll take a
look at why make vm-build-ubuntu.i386 is broken. Thanks.

Fam

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-20 10:30 ` Marcel Apfelbaum
  2018-03-21  1:46   ` Fam Zheng
@ 2018-03-21  2:07   ` Fam Zheng
  2018-03-21  9:20     ` Marcel Apfelbaum
  1 sibling, 1 reply; 10+ messages in thread
From: Fam Zheng @ 2018-03-21  2:07 UTC (permalink / raw)
  To: Marcel Apfelbaum; +Cc: Eric Blake, qemu-devel, qemu-trivial, Yuval Shaia

On Tue, 03/20 12:30, Marcel Apfelbaum wrote:
> Hi Eric,
> 
> On 19/03/2018 23:53, Eric Blake wrote:
> > Use the correct printf formats, so that a 32-bit compile doesn't
> > spit out lots of warnings about %lx being incompatible with uint64_t.
> > Broken since initial commit ef6d4ccd.
> > 
> > Signed-off-by: Eric Blake <eblake@redhat.com>
> > ---
> > 
> > I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> > for me for other reasons); I found it via a 32-bit rawhide VM.
> > 
> 
> I couldn't run 'make vm-build-ubuntu.i368' either. (Stuck on "Booting from Hard Disk...")

I tried this now and it works for me. Could you delete "$HOME/.cache/qemu-vm"
and do it again from a git tree, then pastbin the full log?

Fam

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-21  2:07   ` Fam Zheng
@ 2018-03-21  9:20     ` Marcel Apfelbaum
  2018-03-21  9:34       ` Fam Zheng
  0 siblings, 1 reply; 10+ messages in thread
From: Marcel Apfelbaum @ 2018-03-21  9:20 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Eric Blake, qemu-devel, qemu-trivial, Yuval Shaia

On 21/03/2018 4:07, Fam Zheng wrote:
> On Tue, 03/20 12:30, Marcel Apfelbaum wrote:
>> Hi Eric,
>>
>> On 19/03/2018 23:53, Eric Blake wrote:
>>> Use the correct printf formats, so that a 32-bit compile doesn't
>>> spit out lots of warnings about %lx being incompatible with uint64_t.
>>> Broken since initial commit ef6d4ccd.
>>>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>> ---
>>>
>>> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
>>> for me for other reasons); I found it via a 32-bit rawhide VM.
>>>
>>
>> I couldn't run 'make vm-build-ubuntu.i368' either. (Stuck on "Booting from Hard Disk...")
> 
> I tried this now and it works for me. Could you delete "$HOME/.cache/qemu-vm"
> and do it again from a git tree, then pastbin the full log?
> 

Hi Fam,
I did that but it didn't help.

Here is the log: https://da.gd/8wJHj
I try to run the same command line, and it still stuck in the boot process.
Problem is, the command line looks fine, may be another issue with my PC...
I'll continue to debug it.

Thanks for the help,
Marcel

> Fam
> 

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-21  9:20     ` Marcel Apfelbaum
@ 2018-03-21  9:34       ` Fam Zheng
  0 siblings, 0 replies; 10+ messages in thread
From: Fam Zheng @ 2018-03-21  9:34 UTC (permalink / raw)
  To: Marcel Apfelbaum; +Cc: Eric Blake, qemu-devel, qemu-trivial, Yuval Shaia

On Wed, 03/21 11:20, Marcel Apfelbaum wrote:
> On 21/03/2018 4:07, Fam Zheng wrote:
> > On Tue, 03/20 12:30, Marcel Apfelbaum wrote:
> >> Hi Eric,
> >>
> >> On 19/03/2018 23:53, Eric Blake wrote:
> >>> Use the correct printf formats, so that a 32-bit compile doesn't
> >>> spit out lots of warnings about %lx being incompatible with uint64_t.
> >>> Broken since initial commit ef6d4ccd.
> >>>
> >>> Signed-off-by: Eric Blake <eblake@redhat.com>
> >>> ---
> >>>
> >>> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
> >>> for me for other reasons); I found it via a 32-bit rawhide VM.
> >>>
> >>
> >> I couldn't run 'make vm-build-ubuntu.i368' either. (Stuck on "Booting from Hard Disk...")
> > 
> > I tried this now and it works for me. Could you delete "$HOME/.cache/qemu-vm"
> > and do it again from a git tree, then pastbin the full log?
> > 
> 
> Hi Fam,
> I did that but it didn't help.
> 
> Here is the log: https://da.gd/8wJHj
> I try to run the same command line, and it still stuck in the boot process.
> Problem is, the command line looks fine, may be another issue with my PC...
> I'll continue to debug it.

Maybe we are using different QEMU/seabios. What I used is built from qemu.git.
The log has the QEMU arguments which you can try manually for debug.

Fam

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

* Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation
  2018-03-20 10:43 ` Yuval Shaia
@ 2018-03-21 16:52   ` Marcel Apfelbaum
  0 siblings, 0 replies; 10+ messages in thread
From: Marcel Apfelbaum @ 2018-03-21 16:52 UTC (permalink / raw)
  To: Yuval Shaia, Eric Blake; +Cc: qemu-devel, qemu-trivial

On 20/03/2018 12:43, Yuval Shaia wrote:
> On Mon, Mar 19, 2018 at 04:53:35PM -0500, Eric Blake wrote:
>> Use the correct printf formats, so that a 32-bit compile doesn't
>> spit out lots of warnings about %lx being incompatible with uint64_t.
>> Broken since initial commit ef6d4ccd.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>
>> I don't know if 'make vm-build-ubuntu.i368' would catch this (it failed
>> for me for other reasons); I found it via a 32-bit rawhide VM.
>>
>>  hw/rdma/rdma_backend.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
>> index e306fba5344..89020fdcf62 100644
>> --- a/hw/rdma/rdma_backend.c
>> +++ b/hw/rdma/rdma_backend.c
>> @@ -656,7 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp)
>>  #define CHK_ATTR(req, dev, member, fmt) ({ \
>>      pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \
>>      if (req->member > dev.member) { \
>> -        warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \
>> +        warn_report("%s = 0x%" PRIx64 " is higher than host device " \
>> +                    "capability 0x%" PRIx64, \
>>                      #member, (uint64_t)req->member, (uint64_t)dev.member); \
> 
> Hmmm, interesting.
> I wonder why in first place to cast all members to uint64_t.
> Can you try the method that is used above in the call to pr_dbg, i.e. to
> use the given argument fmt?
> > Something like this:
> 	warn_report("%s = "fmt" is higher than host device capability "fmt, \
> 	            #member, req->member, dev.member); \
> 
>>          req->member = dev.member; \
>>      } \


Right, it seems to be a better solution.

Eric/Yuval, will you send a patch for it?

Thanks!
Marcel


>> -- 
>> 2.14.3
>>

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

end of thread, other threads:[~2018-03-21 16:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 21:53 [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation Eric Blake
2018-03-19 22:08 ` Eric Blake
2018-03-20 10:36   ` Marcel Apfelbaum
2018-03-20 10:30 ` Marcel Apfelbaum
2018-03-21  1:46   ` Fam Zheng
2018-03-21  2:07   ` Fam Zheng
2018-03-21  9:20     ` Marcel Apfelbaum
2018-03-21  9:34       ` Fam Zheng
2018-03-20 10:43 ` Yuval Shaia
2018-03-21 16:52   ` Marcel Apfelbaum

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.