xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "Keir (Xen.org)" <keir@xen.org>, "Tim (Xen.org)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2 of 5] rombios/ata: Do not wait for BSY to be set
Date: Tue, 27 Nov 2012 17:22:52 +0000	[thread overview]
Message-ID: <50B4F6EC.3050300@citrix.com> (raw)
In-Reply-To: <20121127170844.536be218@pyramind.ukuu.org.uk>


On 27/11/12 17:08, Alan Cox wrote:
>> Does this actually do anything useful?  I'd guess that on qemu the extra
>> outb has no effect and on real hardware that needed a delay here, one
>> I/O cycle would not be enough.
> It ought to be plenty - the time before the response is valid from an ATA
> command is very short but in the real hardware world most definitely
> present and important.
>
> However you also need to think about the state of the device registers
> after the second outb. If you don't wait for BSY and for some reason it's
> delayed in the emulation or on a multiprocessor what occurs.
>
> Might be safer to do
>
> 	outb(0x80,0x00)
> 	await_ide(...)
>
> at which point the await_ide would run once in the usual case.
>
> Alan

No - this is what we are trying to avoid.

SEABios has explicitly removed the wait for the BSY bit to be set.  We
want to remove it because Qemu will not set the BSY bit, resulting in
42k needless polled IO traps while we wait for the timeout (which is, if
I remember correctly, based on a loop counter rather than any notion of
actual time)

We can certainly argue about the outb(0x80,0x00).  When I was comparing
ROMBios with SEABios, this outb was the closest I could easily get to a
udelay(5) without implement udelay() in ROMBios.  Xen will execute an
outb(0x80, 0x00) on the real hardware if a guest executes it; It will
never result in a trap to qemu.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

  reply	other threads:[~2012-11-27 17:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 16:41 [PATCH 0 of 5] HVM performance improvements Andrew Cooper
2012-11-26 16:41 ` [PATCH 1 of 5] rombios/keyboard: Don't needlessly poll the status register Andrew Cooper
2012-11-26 16:48   ` Ian Campbell
2012-11-26 16:53     ` Andrew Cooper
2012-11-27 16:33   ` Tim Deegan
2012-11-27 17:08     ` Andrew Cooper
2012-11-26 16:41 ` [PATCH 2 of 5] rombios/ata: Do not wait for BSY to be set Andrew Cooper
2012-11-27 16:46   ` Tim Deegan
2012-11-27 17:02     ` Mats Petersson
2012-11-27 17:08     ` Alan Cox
2012-11-27 17:22       ` Andrew Cooper [this message]
2012-11-27 17:49         ` Alan Cox
2012-11-27 18:24           ` Andrew Cooper
2012-11-26 16:41 ` [PATCH 3 of 5] rombios/ata: Reading this status register has no relevant side effects Andrew Cooper
2012-11-26 16:51   ` Ian Campbell
2012-11-26 16:56     ` Andrew Cooper
2012-11-26 17:01       ` Ian Campbell
2012-11-26 16:41 ` [PATCH 4 of 5] rombios/ata Remove more needless traps from the int 0x13 path Andrew Cooper
2012-11-26 16:41 ` [PATCH 5 of 5] rombios/debug: Reduce verbosity of rombios Andrew Cooper
2012-11-27 17:07   ` Tim Deegan
2013-05-09 14:07 ` [PATCH 0 of 5] HVM performance improvements Pasi Kärkkäinen
2013-08-05 16:31   ` Pasi Kärkkäinen
2013-08-05 17:10     ` Andrew Cooper
2013-08-06  9:57       ` George Dunlap
2013-08-06  9:59         ` Andrew Cooper
  -- strict thread matches above, loose matches on Subject: below --
2012-07-30 19:47 [PATCH 0 of 5] Rombios PIO performance Andrew Cooper
2012-07-30 19:47 ` [PATCH 2 of 5] rombios/ata: Do not wait for BSY to be set Andrew Cooper
2012-07-30 20:18   ` Pasi Kärkkäinen

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=50B4F6EC.3050300@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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).