QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: John Snow <jsnow@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, Eric Blake <eblake@redhat.com>
Cc: Stefan Fritsch <sf@sfritsch.de>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 2/3] ahci: Force ICC bits in PxCMD to zero
Date: Tue, 21 Jul 2015 13:41:40 -0400
Message-ID: <55AE8454.6050604@redhat.com> (raw)
In-Reply-To: <CAFEAcA9k28cE7BW06=KQeNrgURGSGin_P5ocHBx9TobrTZ3kJA@mail.gmail.com>



On 07/21/2015 09:02 AM, Peter Maydell wrote:
> On 21 July 2015 at 13:55, Eric Blake <eblake@redhat.com> wrote:
>> On 07/21/2015 05:38 AM, Peter Maydell wrote:
>>> On 20 July 2015 at 19:29, John Snow <jsnow@redhat.com> wrote:
>>>> From: Stefan Fritsch <sf@sfritsch.de>
>>>>
>>>> The AHCI spec requires that the HBA sets the ICC bits to zero after the
>>>> ICC change is done. Since we don't do any ICC change, force the bits to
>>>> zero all the time.
>>>>
>>>> This fixes delays with some OSs (e.g. OpenBSD) waiting for the ICC bits
>>>> to change to 0.
>>>
>>> This change provokes a lot of clang sanitizer warnings:
>>>
>>> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:288:49: runtime
>>> error: left shift of 15 by 28 places cannot be represented in type
>>> 'int'
>>>
>>> PORT_CMD_ICC_MASK is defined as
>>>
>>>  #define PORT_CMD_ICC_MASK         (0xf << 28) /* i/f ICC state mask */
>>>
>>> which shifts into the sign bit of a signed integer.
>>
>> Should be fixable by using (0xfU << 28), right?
> 
> Yes, though it assumes that if you say "~PORT_CMD_ICC_MASK"
> you're happy to only get a 32-bit mask. 0xfULL would avoid
> that (see discussion on the other thread with Paolo about
> the PPC similar issue.)
> 

I think we're happy to admit it's a simple 32bit mask, since it's just a
32bit field and I can't imagine us needing it for any other purpose
right now.

I'd be worried that ~(0xfULL) would be pretty much the wrong thing in
nearly all cases. Same for ~..UL.

I'll send a quick patch for Eric's suggestion.

> -- PMM
> 

Thanks,
--js

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 18:29 [Qemu-devel] [PULL 0/3] Ide patches John Snow
2015-07-20 18:29 ` [Qemu-devel] [PULL 1/3] qtest/ide: add another short PRDT test flavor John Snow
2015-07-20 18:29 ` [Qemu-devel] [PULL 2/3] ahci: Force ICC bits in PxCMD to zero John Snow
2015-07-21 11:38   ` Peter Maydell
2015-07-21 12:55     ` Eric Blake
2015-07-21 13:02       ` Peter Maydell
2015-07-21 17:41         ` John Snow [this message]
2015-07-20 18:29 ` [Qemu-devel] [PULL 3/3] tests: Fix broken targets check-report-qtest-* John Snow
2015-07-21 10:18 ` [Qemu-devel] [PULL 0/3] Ide patches Peter Maydell

Reply instructions:

You may reply publically 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=55AE8454.6050604@redhat.com \
    --to=jsnow@redhat.com \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sf@sfritsch.de \
    /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

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git