xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Pasi Kärkkäinen" <pasik@iki.fi>
Cc: "Keir (Xen.org)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2 of 5] (V2) rombios/ata: Do not wait for BSY to be set
Date: Tue, 31 Jul 2012 10:37:16 +0100	[thread overview]
Message-ID: <5017A74C.6090006@citrix.com> (raw)
In-Reply-To: <20120730201857.GZ19851@reaktio.net>

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]


On 30/07/12 21:18, Pasi Kärkkäinen wrote:
> On Mon, Jul 30, 2012 at 08:47:21PM +0100, Andrew Cooper wrote:
>> I can't find any guarantee in the ATA specification that this will happen, and it
>> certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
>> instead.
>>
>> As rombios does not have an equivalent udelay(), so replace the wait with a write
>> to port 0x80 which is whilelisted by Xen for 'a small delay'.
>>                          ^
> a small typo probably.. I think it should say "whitelisted".
>
> -- Pasi
>
 D'oh - yes.  Attached is version 2 which corrects this, and another
grammatical error in the sentence.

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


[-- Attachment #2: rombios-ata_reset.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

# HG changeset patch
# Parent 2c92985dc53fbc62d1a2975aed968a8bb021c8ef
rombios/ata: Do not wait for BSY to be set

I can't find any guarantee in the ATA specification that this will happen, and it
certainly does not with Qemu.  SeaBIOS has replaced it with a call to udelay(5)
instead.

As rombios does not have an equivalent udelay(), replace the wait with a write
to port 0x80 which is whitelisted by Xen for 'a small delay'.

This causes roughly 42k fewer traps to Qemu, which is very roughly 10% of the
number of traps during boot of a Win7 guest.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 2c92985dc53f tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -2914,8 +2914,8 @@ Bit16u device;
 // 8.2.1 (a) -- set SRST in DC
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
 
-// 8.2.1 (b) -- wait for BSY
-  await_ide(BSY, iobase1, 20);
+// 8.2.1 (b) -- wait
+  outb(0x80, 0x00);
 
 // 8.2.1 (f) -- clear SRST
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-07-31  9:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 19:47 [PATCH 0 of 5] Rombios PIO performance Andrew Cooper
2012-07-30 19:47 ` [PATCH 1 of 5] rombios/keyboard: Don't needlessly poll the status register 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
2012-07-31  9:37     ` Andrew Cooper [this message]
2012-07-30 19:47 ` [PATCH 3 of 5] rombios/ata: Reading this status register has no relevant side effects Andrew Cooper
2012-07-30 21:57   ` Alan Cox
2012-07-31 10:08     ` David Vrabel
2012-07-31 10:28     ` Andrew Cooper
2012-07-30 19:47 ` [PATCH 4 of 5] rombios/ata Remove more needless traps from the int 0x13 path Andrew Cooper
2012-07-30 19:47 ` [PATCH 5 of 5] rombios/debug: Reduce verbosity of rombios Andrew Cooper

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=5017A74C.6090006@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=pasik@iki.fi \
    --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).