On 3/23/20 8:37 AM, Christian Borntraeger wrote:
> 
> 
> On 23.03.20 08:15, Christian Borntraeger wrote:
>> [...]
>>
>>>> +int s390_ipl_prepare_pv_header(void)
>>>> +{
>>>> +    IplParameterBlock *ipib = s390_ipl_get_iplb_pv();
>>>> +    IPLBlockPV *ipib_pv = &ipib->pv;
>>>> +    void *hdr = g_malloc(ipib_pv->pv_header_len);
>>>> +    int rc;
>>>> +
>>>> +    cpu_physical_memory_read(ipib_pv->pv_header_addr, hdr,
>>>> +                             ipib_pv->pv_header_len);
>>>> +    rc = s390_pv_set_sec_parms((uint64_t)hdr,
>>>> +                               ipib_pv->pv_header_len);
>>> This causes a compiler issue when building for 32 bit x86 as follows:
>>>
>>> /home/abuild/rpmbuild/BUILD/qemu-4.2.0/hw/s390x/ipl.c: In function
>>> 's390_ipl_prepare_pv_header':
>>> /home/abuild/rpmbuild/BUILD/qemu-4.2.0/hw/s390x/ipl.c:659:32: error:
>>> cast from pointer to integer of different size [-Werror=pointer-to-int-
>>> cast]
>>>   659 |     rc = s390_pv_set_sec_parms((uint64_t)hdr,
>>>       |                                ^
>>
>> Interesting. It seems that there is no travis-ci coverage for this
>> case.
>>
>> I guess we need something like this.
>>
>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>> index 1d04cd5..01bdf81 100644
>> --- a/hw/s390x/ipl.c
>> +++ b/hw/s390x/ipl.c
>> @@ -656,7 +656,7 @@ int s390_ipl_prepare_pv_header(void)
>>  
>>      cpu_physical_memory_read(ipib_pv->pv_header_addr, hdr,
>>                               ipib_pv->pv_header_len);
>> -    rc = s390_pv_set_sec_parms((uint64_t)hdr,
>> +    rc = s390_pv_set_sec_parms((uint64_t)(unsigned long) hdr,
>>                                 ipib_pv->pv_header_len);
> 
> uint_ptr instead of long is probably even better (for Windows).
> 

Yeah, I was wondering why you did a double cast instead of uintptr_t. ;-)

I'll send out a revised version soon.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to