qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Farhan Ali <alifm@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Thomas Huth <thuth@redhat.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] s390-ccw: force diag 308 subcode to unsigned long
Date: Thu, 3 May 2018 12:05:28 -0400	[thread overview]
Message-ID: <5baae3f1-07ff-3ba0-fb83-81e0eb9a0240@linux.ibm.com> (raw)
In-Reply-To: <20180503174412.359494fb.cohuck@redhat.com>



On 05/03/2018 11:44 AM, Cornelia Huck wrote:
> On Thu, 3 May 2018 11:25:08 -0400
> Farhan Ali <alifm@linux.ibm.com> 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:qemu-stable@nongnu.org
>>> Signed-off-by: Cornelia Huck<cohuck@redhat.com>
>>
>> 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	other threads:[~2018-05-03 16:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 12:52 [Qemu-devel] [PATCH] s390-ccw: force diag 308 subcode to unsigned long Cornelia Huck
2018-05-02 12:56 ` Christian Borntraeger
2018-05-02 13:32 ` Thomas Huth
2018-05-03 15:20 ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
2018-05-03 15:25 ` [Qemu-devel] " Farhan Ali
2018-05-03 15:44   ` Cornelia Huck
2018-05-03 16:05     ` Farhan Ali [this message]
2018-05-03 15:48   ` Eric Blake
2018-05-03 16:03     ` Farhan Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5baae3f1-07ff-3ba0-fb83-81e0eb9a0240@linux.ibm.com \
    --to=alifm@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).