qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v11 03/16] s390x: protvirt: Support unpack facility


From: Christian Borntraeger
Subject: Re: [PATCH v11 03/16] s390x: protvirt: Support unpack facility
Date: Mon, 23 Mar 2020 08:37:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0


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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]