diff mbox

[PULL,00/20] s390x/kvm: Features and fixes for 2.3

Message ID 54FF6F98.4080102@de.ibm.com
State New
Headers show

Commit Message

Christian Borntraeger March 10, 2015, 10:26 p.m. UTC
Am 10.03.2015 um 19:01 schrieb Peter Maydell:
> On 10 March 2015 at 08:37, Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>> Peter,
>>
>> this pull reuqest contains a header sync to 4.0-rc3. This should cause
>> no merge conflicts with other header syncs against 4.0-rc2. So here
>> is the s390 pull request.
>>
>> The following changes since commit 277263e1b320d759a760ba6c5ea75ec268f929e5:
>>
>>   Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging (2015-03-09 14:04:14 +0000)
>>
>> are available in the git repository at:
>>
>>   git://github.com/borntraeger/qemu.git tags/s390x-20150310
>>
>> for you to fetch changes up to 6342cb1443b37d249a0e2005128ade07a80a97f5:
>>
>>   s390-ccw: rebuild BIOS (2015-03-10 09:26:33 +0100)
> 
> Unfortunately I see build failures on 32 bit hosts:
> 
> /root/qemu/hw/s390x/ipl.c: In function ‘bios_translate_addr’:
> /root/qemu/hw/s390x/ipl.c:101:24: error: cast from pointer to integer
> of different size [-Werror=pointer-to-int-cast]
> /root/qemu/hw/s390x/ipl.c: In function ‘s390_ipl_init’:
> /root/qemu/hw/s390x/ipl.c:135:30: error: cast to pointer from integer
> of different size [-Werror=int-to-pointer-cast]
> 

O dear. Seems that every pull request after your vacation is somewhat broken.
I fixed up patch 19 (" s390/bios: Make the s390-ccw.img relocatable") as
such




Updated pull request will follow.

Comments

Markus Armbruster March 11, 2015, 7:57 a.m. UTC | #1
Christian Borntraeger <borntraeger@de.ibm.com> writes:

> Am 10.03.2015 um 19:01 schrieb Peter Maydell:
>> On 10 March 2015 at 08:37, Christian Borntraeger
>> <borntraeger@de.ibm.com> wrote:
>>> Peter,
>>>
>>> this pull reuqest contains a header sync to 4.0-rc3. This should cause
>>> no merge conflicts with other header syncs against 4.0-rc2. So here
>>> is the s390 pull request.
>>>
>>> The following changes since commit 277263e1b320d759a760ba6c5ea75ec268f929e5:
>>>
>>>   Merge remote-tracking branch
>>> remotes/agraf/tags/signed-ppc-for-upstream' into staging
>>> (2015-03-09 14:04:14 +0000)
>>>
>>> are available in the git repository at:
>>>
>>>   git://github.com/borntraeger/qemu.git tags/s390x-20150310
>>>
>>> for you to fetch changes up to 6342cb1443b37d249a0e2005128ade07a80a97f5:
>>>
>>>   s390-ccw: rebuild BIOS (2015-03-10 09:26:33 +0100)
>> 
>> Unfortunately I see build failures on 32 bit hosts:
>> 
>> /root/qemu/hw/s390x/ipl.c: In function ‘bios_translate_addr’:
>> /root/qemu/hw/s390x/ipl.c:101:24: error: cast from pointer to integer
>> of different size [-Werror=pointer-to-int-cast]
>> /root/qemu/hw/s390x/ipl.c: In function ‘s390_ipl_init’:
>> /root/qemu/hw/s390x/ipl.c:135:30: error: cast to pointer from integer
>> of different size [-Werror=int-to-pointer-cast]
>> 
>
> O dear. Seems that every pull request after your vacation is somewhat broken.
> I fixed up patch 19 (" s390/bios: Make the s390-ccw.img relocatable") as
> such
>
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index ab7fd8a..6ed18d3 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -98,7 +98,7 @@ static const VMStateDescription vmstate_ipl = {
>  
>  static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
>  {
> -    uint64_t dstaddr = (uint64_t)opaque;
> +    uint64_t dstaddr = (uint64_t) (unsigned long) opaque;
>      /*
>       * Assuming that our s390-ccw.img was linked for starting at address 0,
>       * we can simply add the destination address for the final location

Won't this shift the warning from hosts where sizeof(void *) !=
sizeof(uint64_t) to hosts where it's != sizeof(unsigned long)?

What about using uintptr_t instead?

[...]
Thomas Huth March 11, 2015, 8:08 a.m. UTC | #2
On Wed, 11 Mar 2015 08:57:34 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Christian Borntraeger <borntraeger@de.ibm.com> writes:
> 
> > Am 10.03.2015 um 19:01 schrieb Peter Maydell:
> >> On 10 March 2015 at 08:37, Christian Borntraeger
> >> <borntraeger@de.ibm.com> wrote:
> >>> Peter,
> >>>
> >>> this pull reuqest contains a header sync to 4.0-rc3. This should cause
> >>> no merge conflicts with other header syncs against 4.0-rc2. So here
> >>> is the s390 pull request.
> >>>
> >>> The following changes since commit 277263e1b320d759a760ba6c5ea75ec268f929e5:
> >>>
> >>>   Merge remote-tracking branch
> >>> remotes/agraf/tags/signed-ppc-for-upstream' into staging
> >>> (2015-03-09 14:04:14 +0000)
> >>>
> >>> are available in the git repository at:
> >>>
> >>>   git://github.com/borntraeger/qemu.git tags/s390x-20150310
> >>>
> >>> for you to fetch changes up to 6342cb1443b37d249a0e2005128ade07a80a97f5:
> >>>
> >>>   s390-ccw: rebuild BIOS (2015-03-10 09:26:33 +0100)
> >> 
> >> Unfortunately I see build failures on 32 bit hosts:
> >> 
> >> /root/qemu/hw/s390x/ipl.c: In function ‘bios_translate_addr’:
> >> /root/qemu/hw/s390x/ipl.c:101:24: error: cast from pointer to integer
> >> of different size [-Werror=pointer-to-int-cast]
> >> /root/qemu/hw/s390x/ipl.c: In function ‘s390_ipl_init’:
> >> /root/qemu/hw/s390x/ipl.c:135:30: error: cast to pointer from integer
> >> of different size [-Werror=int-to-pointer-cast]
> >> 
> >
> > O dear. Seems that every pull request after your vacation is somewhat broken.
> > I fixed up patch 19 (" s390/bios: Make the s390-ccw.img relocatable") as
> > such

Oops, sorry, should have tested my patch with -m32 as well :-/
Thanks for fixing, Christian!

> > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> > index ab7fd8a..6ed18d3 100644
> > --- a/hw/s390x/ipl.c
> > +++ b/hw/s390x/ipl.c
> > @@ -98,7 +98,7 @@ static const VMStateDescription vmstate_ipl = {
> >  
> >  static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
> >  {
> > -    uint64_t dstaddr = (uint64_t)opaque;
> > +    uint64_t dstaddr = (uint64_t) (unsigned long) opaque;
> >      /*
> >       * Assuming that our s390-ccw.img was linked for starting at address 0,
> >       * we can simply add the destination address for the final location
> 
> Won't this shift the warning from hosts where sizeof(void *) !=
> sizeof(uint64_t) to hosts where it's != sizeof(unsigned long)?
> 
> What about using uintptr_t instead?

uintptr_t sounds also like the better solution to me.

 Thomas
Christian Borntraeger March 11, 2015, 8:09 a.m. UTC | #3
Am 11.03.2015 um 08:57 schrieb Markus Armbruster:
> Christian Borntraeger <borntraeger@de.ibm.com> writes:
> 
>> Am 10.03.2015 um 19:01 schrieb Peter Maydell:
>>> On 10 March 2015 at 08:37, Christian Borntraeger
>>> <borntraeger@de.ibm.com> wrote:
>>>> Peter,
>>>>
>>>> this pull reuqest contains a header sync to 4.0-rc3. This should cause
>>>> no merge conflicts with other header syncs against 4.0-rc2. So here
>>>> is the s390 pull request.
>>>>
>>>> The following changes since commit 277263e1b320d759a760ba6c5ea75ec268f929e5:
>>>>
>>>>   Merge remote-tracking branch
>>>> remotes/agraf/tags/signed-ppc-for-upstream' into staging
>>>> (2015-03-09 14:04:14 +0000)
>>>>
>>>> are available in the git repository at:
>>>>
>>>>   git://github.com/borntraeger/qemu.git tags/s390x-20150310
>>>>
>>>> for you to fetch changes up to 6342cb1443b37d249a0e2005128ade07a80a97f5:
>>>>
>>>>   s390-ccw: rebuild BIOS (2015-03-10 09:26:33 +0100)
>>>
>>> Unfortunately I see build failures on 32 bit hosts:
>>>
>>> /root/qemu/hw/s390x/ipl.c: In function ‘bios_translate_addr’:
>>> /root/qemu/hw/s390x/ipl.c:101:24: error: cast from pointer to integer
>>> of different size [-Werror=pointer-to-int-cast]
>>> /root/qemu/hw/s390x/ipl.c: In function ‘s390_ipl_init’:
>>> /root/qemu/hw/s390x/ipl.c:135:30: error: cast to pointer from integer
>>> of different size [-Werror=int-to-pointer-cast]
>>>
>>
>> O dear. Seems that every pull request after your vacation is somewhat broken.
>> I fixed up patch 19 (" s390/bios: Make the s390-ccw.img relocatable") as
>> such
>>
>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>> index ab7fd8a..6ed18d3 100644
>> --- a/hw/s390x/ipl.c
>> +++ b/hw/s390x/ipl.c
>> @@ -98,7 +98,7 @@ static const VMStateDescription vmstate_ipl = {
>>  
>>  static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
>>  {
>> -    uint64_t dstaddr = (uint64_t)opaque;
>> +    uint64_t dstaddr = (uint64_t) (unsigned long) opaque;
>>      /*
>>       * Assuming that our s390-ccw.img was linked for starting at address 0,
>>       * we can simply add the destination address for the final location
> 
> Won't this shift the warning from hosts where sizeof(void *) !=
> sizeof(uint64_t) to hosts where it's != sizeof(unsigned long)?

Indeed. I was only thinking about Linux, where sizeof(unsigned long) == sizeof(void*).
But Windows has a different model. We have to cover all kind of lp64, llp64 and friends.

> What about using uintptr_t instead?

Should work. Will have a try on Linux 32bit/64bit..no way to test on windows, though :-(
diff mbox

Patch

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index ab7fd8a..6ed18d3 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -98,7 +98,7 @@  static const VMStateDescription vmstate_ipl = {
 
 static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
 {
-    uint64_t dstaddr = (uint64_t)opaque;
+    uint64_t dstaddr = (uint64_t) (unsigned long) opaque;
     /*
      * Assuming that our s390-ccw.img was linked for starting at address 0,
      * we can simply add the destination address for the final location
@@ -132,9 +132,9 @@  static int s390_ipl_init(SysBusDevice *dev)
         }
 
         bios_size = load_elf(bios_filename, bios_translate_addr,
-                             (void *)fwbase, &ipl->bios_start_addr,
-                             NULL, NULL, 1, ELF_MACHINE, 0);
-
+                             (void *) (unsigned long) fwbase,
+                             &ipl->bios_start_addr, NULL, NULL, 1,
+                             ELF_MACHINE, 0);
         if (bios_size > 0) {
             /* Adjust ELF start address to final location */
             ipl->bios_start_addr += fwbase;