From: Jason Wang <jasowang@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: qemu-devel@nongnu.org, Wei Huang <wehuang@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] e1000: work around win 8.0 boot hang
Date: Wed, 01 Apr 2015 09:44:29 +0800 [thread overview]
Message-ID: <1427852669.4678.0@smtp.corp.redhat.com> (raw)
In-Reply-To: <20150331101726.GB14262@potion.brq.redhat.com>
On Tue, Mar 31, 2015 at 6:17 PM, Radim Krčmář <rkrcmar@redhat.com>
wrote:
> 2015-03-31 13:26+0800, Jason Wang:
>> On 02/20/2015 03:24 AM, Radim Krčmář wrote:
>> > Window 8.0 driver has a particular behavior for a small time
>> frame after
>> > it enables rx interrupts: the interrupt handler never clears
>> > E1000_ICR_RXT0. The handler does this something like this:
>> > set_imc(-1) (1) disable all interrupts
>> > val = read_icr() (2) clear ICR
>> > handled = magic(val) (3) do nothing to E1000_ICR_RXT0
>> > set_ics(val & ~handled) (4) set unhandled interrupts back to
>> ICR
>> > set_ims(157) (5) enable some interrupts
>> >
>> > so if we started with RXT0, then every time the handler
>> re-enables e1000
>> > interrupts, it receives one. This likely wouldn't matter in real
>> > hardware, because it is slow enough to make some progress between
>> > interrupts, but KVM instantly interrupts it, and boot hangs.
>> > (If we have multiple VCPUs, the interrupt gets load-balanced and
>> > everything is fine.)
>> >
>> > I haven't found any problem in earlier phase of initialization and
>> > windows writes 0 to RADV and RDTR, so some workaround looks like
>> the
>> > only way if we want to support win8.0 on uniprocessors. (I vote
>> NO.)
>> >
>> > This workaround uses the fact that a constant is cleared from ICR
>> and
>> > later set back to it. After detecting this situation, we reuse
>> the
>> > mitigation framework to inject an interrupt 10 microseconds later.
>> > (It's not exactly 10 microseconds, to keep the existing logic
>> intact.)
>> >
>> > The detection is done by checking at (1), (2), and (5). (2) and
>> (5)
>> > require that the only bit in ICR is RXT0. We could also check at
>> (4),
>> > and on writes to any other register, but it would most likely
>> only add
>> > more useless code, because normal operations shouldn't behave
>> like that
>> > anyway. (An OS that deliberately keeps bits in ICR to notify
>> itself
>> > that there are more packets, or for more creative reasons, is
>> nothing we
>> > should care about.)
>> >
>> > Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
>> > ---
>> > The patch is still untested -- it only approximates the behavior
>> of RHEL
>> > patches that worked, I'll try to get a reproducer ...
>>
>> Hi:
>>
>> Two questions:
>>
>> - Does Win8 still support 82540EM. According to
>>
>> https://downloadcenter.intel.com/download/23071/Network-Adapter-Driver-for-Windows-8-1-
>> , it was not in the supported list. As a reference, 82540EM was in
>> the
>> list of win2008:
>>
>> https://downloadcenter.intel.com/download/18720/Network-Adapter-Driver-for-Windows-Server-2008-Final-Release.
>> If it was not supported officially, there's probably no need to
>> workaround a buggy driver in guest.
>
> Probably not:
> http://www.intel.com/support/network/adapter/pro100/sb/CS-033693.htm
> https://downloadcenter.intel.com/download/21642/Network-Adapter-Driver-for-Windows-8-
>
> That makes things simple, thank you.
> I see no reason to sabotage QEMU with this patch now.
>
>> - The issue looks similar to the one that has been addressed by
>> kernel
>> commit 184564efae4d775225c8fe3b762a56956fb1f827. Is this still
>> reproducible with this commit?
>
> Windows issues EOI between steps (1) and (2), while the line is down,
> so
> the patch doesn't recognize it as EOI storm.
I see.
> It's another problem with
> zero latencies ... we could workaround it in the kernel by remembering
> last interrupts and delaying down the injection a bit if the same one
> is
> injected too often within some time frame; I wouldn't do that either.
Agree, thanks for the explanation.
prev parent reply other threads:[~2015-04-01 1:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 19:24 [Qemu-devel] [PATCH] e1000: work around win 8.0 boot hang Radim Krčmář
2015-02-19 20:37 ` Radim Krčmář
2015-02-23 10:45 ` Stefan Hajnoczi
2015-02-23 13:45 ` Radim Krčmář
2015-02-23 14:39 ` Stefan Hajnoczi
2015-02-23 16:07 ` Radim Krčmář
2015-02-23 16:13 ` Wei Huang
2015-02-24 11:35 ` Stefan Hajnoczi
2015-02-24 11:46 ` Stefan Hajnoczi
2015-03-20 15:10 ` Wei Huang
2015-03-31 5:26 ` Jason Wang
2015-03-31 10:17 ` Radim Krčmář
2015-04-01 1:44 ` Jason Wang [this message]
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=1427852669.4678.0@smtp.corp.redhat.com \
--to=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=wehuang@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).