qemu-s390x
[Top][All Lists]
Advanced

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

Re: [qemu-s390x] [Qemu-devel] [PATCH] s390-ccw: force diag 308 subcode t


From: Farhan Ali
Subject: Re: [qemu-s390x] [Qemu-devel] [PATCH] s390-ccw: force diag 308 subcode to unsigned long
Date: Thu, 3 May 2018 12:05:28 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0



On 05/03/2018 11:44 AM, Cornelia Huck wrote:
On Thu, 3 May 2018 11:25:08 -0400
Farhan Ali <address@hidden> wrote:

On 05/02/2018 08:52 AM, Cornelia Huck wrote:
We currently pass an integer as the subcode parameter. However,
the upper bits of the register containing the subcode need to
be 0, which is not guaranteed unless we explicitly specify the
subcode to be an unsigned long value.

Fixes: d046c51dad3 ("pc-bios/s390-ccw: Get device address via diag 308/6")
Cc:address@hidden
Signed-off-by: Cornelia Huck<address@hidden>

Sorry for my ignorance, but is there a C standard that says upper bits
of an int is not guaranteed to be 0?

The value (5 resp. 6) is small enough to fit into a regular integer,
and the compiler generated a lhi for the load, which did not change any
upper values that might have been in the register previously. Telling
the compiler to treat the value as an unsigned long makes it generate a
lghi.


This makes sense now. Thanks for the explanation :)




reply via email to

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