diff mbox series

[v5,2/2] hw: hyperv: vmbus: Fix 32bit compilation

Message ID 20200715084326.678715-3-arilou@gmail.com
State New
Headers show
Series hyperv: vmbus: ACPI various corrections | expand

Commit Message

Jon Doron July 15, 2020, 8:43 a.m. UTC
Signed-off-by: Jon Doron <arilou@gmail.com>
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Aleksandar Markovic July 25, 2020, 12:16 p.m. UTC | #1
On Wednesday, July 15, 2020, Jon Doron <arilou@gmail.com> wrote:

> Signed-off-by: Jon Doron <arilou@gmail.com>
> ---
>  hw/hyperv/vmbus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
> index 34392e892a..c28bb4201b 100644
> --- a/hw/hyperv/vmbus.c
> +++ b/hw/hyperv/vmbus.c
> @@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void
> *buf, uint32_t len)
>              }
>          }
>
> -        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
> off_in_page);
> +        p = (void *)(uintptr_t)(((uintptr_t)iter->map &
> TARGET_PAGE_MASK) |
> +                off_in_page);
>          if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
>              memcpy(p, buf, cplen);
>          } else {
> --
> 2.24.1
>
>
>
Tested-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>

It looks to me this patch should definitely be selected for 5.1.?
Igor Mammedov July 29, 2020, 2:15 p.m. UTC | #2
On Sat, 25 Jul 2020 14:16:08 +0200
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> wrote:

> On Wednesday, July 15, 2020, Jon Doron <arilou@gmail.com> wrote:

Michael,

could you merge it via your tree please?

> 
> > Signed-off-by: Jon Doron <arilou@gmail.com>
> > ---
> >  hw/hyperv/vmbus.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
> > index 34392e892a..c28bb4201b 100644
> > --- a/hw/hyperv/vmbus.c
> > +++ b/hw/hyperv/vmbus.c
> > @@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void
> > *buf, uint32_t len)
> >              }
> >          }
> >
> > -        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
> > off_in_page);
> > +        p = (void *)(uintptr_t)(((uintptr_t)iter->map &
> > TARGET_PAGE_MASK) |
> > +                off_in_page);
> >          if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
> >              memcpy(p, buf, cplen);
> >          } else {
> > --
> > 2.24.1
> >
> >
> >  
> Tested-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
> Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
> 
> It looks to me this patch should definitely be selected for 5.1.?
Philippe Mathieu-Daudé Sept. 6, 2020, 10:14 a.m. UTC | #3
Cc'ing qemu-trivial@

Can we add the commit description Richard wrote?

---
Fix 32-bit build error for vmbus:

  hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
  hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of
different size [-Werror=int-to-pointer-cast]
  383 |         p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
off_in_page);
      |             ^
  cc1: all warnings being treated as errors

Fixes: 0d71f7082d7 ("vmbus: vmbus implementation")
---

On 7/15/20 10:43 AM, Jon Doron wrote:
> Signed-off-by: Jon Doron <arilou@gmail.com>
> ---
>  hw/hyperv/vmbus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
> index 34392e892a..c28bb4201b 100644
> --- a/hw/hyperv/vmbus.c
> +++ b/hw/hyperv/vmbus.c
> @@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
>              }
>          }
>  
> -        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
> +        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
> +                off_in_page);
>          if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
>              memcpy(p, buf, cplen);
>          } else {
>
Laurent Vivier Sept. 9, 2020, 1:56 p.m. UTC | #4
Le 06/09/2020 à 12:14, Philippe Mathieu-Daudé a écrit :
> Cc'ing qemu-trivial@
> 
> Can we add the commit description Richard wrote?

I have no message from Richard regarding this patch.

Thanks,
Laurent
> 
> ---
> Fix 32-bit build error for vmbus:
> 
>   hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
>   hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of
> different size [-Werror=int-to-pointer-cast]
>   383 |         p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
> off_in_page);
>       |             ^
>   cc1: all warnings being treated as errors
> 
> Fixes: 0d71f7082d7 ("vmbus: vmbus implementation")
> ---
> 
> On 7/15/20 10:43 AM, Jon Doron wrote:
>> Signed-off-by: Jon Doron <arilou@gmail.com>
>> ---
>>  hw/hyperv/vmbus.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
>> index 34392e892a..c28bb4201b 100644
>> --- a/hw/hyperv/vmbus.c
>> +++ b/hw/hyperv/vmbus.c
>> @@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
>>              }
>>          }
>>  
>> -        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
>> +        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
>> +                off_in_page);
>>          if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
>>              memcpy(p, buf, cplen);
>>          } else {
>>
> 
>
Richard Henderson Sept. 9, 2020, 4:18 p.m. UTC | #5
On 9/9/20 6:56 AM, Laurent Vivier wrote:
> Le 06/09/2020 à 12:14, Philippe Mathieu-Daudé a écrit :
>> Cc'ing qemu-trivial@
>>
>> Can we add the commit description Richard wrote?
> 
> I have no message from Richard regarding this patch.

https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg02283.html

Different thread, same problem.


r~
Laurent Vivier Sept. 9, 2020, 4:30 p.m. UTC | #6
Le 09/09/2020 à 18:18, Richard Henderson a écrit :
> On 9/9/20 6:56 AM, Laurent Vivier wrote:
>> Le 06/09/2020 à 12:14, Philippe Mathieu-Daudé a écrit :
>>> Cc'ing qemu-trivial@
>>>
>>> Can we add the commit description Richard wrote?
>>
>> I have no message from Richard regarding this patch.
> 
> https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg02283.html
> 
> Different thread, same problem.

Thank you.

Applied to my trivial-patches branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 34392e892a..c28bb4201b 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -383,7 +383,8 @@  static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {