From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 7/7] Enable NVMe start controller for Windows guest.
Date: Thu, 30 Apr 2015 21:10:16 +0200 [thread overview]
Message-ID: <1430421016-13158-8-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1430421016-13158-1-git-send-email-kwolf@redhat.com>
From: Daniel Stekloff <dan@wendan.org>
Windows seems to send two separate calls to NVMe controller configuration. The
first sends configuration info and the second the enable bit. I couldn't
enable the Windows 8.1 in-box NVMe driver with base Qemu. I made the
following change to store the configuration data and then handle enable and
NVMe driver works on Windows 8.1.
I am not a Windows expert and I'm not entirely sure this is the correct
approach. I'm offering it for anyone who wishes to use NVMe on Windows 8.1
using Qemu.
I have tested this change with Linux and Windows guests with NVMe devices.
Signed-off-by: Daniel Stekloff <dan@wendan.org>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
hw/block/nvme.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 1e07166..ad988d7 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -615,6 +615,13 @@ static void nvme_write_bar(NvmeCtrl *n, hwaddr offset, uint64_t data,
n->bar.intmc = n->bar.intms;
break;
case 0x14:
+ /* Windows first sends data, then sends enable bit */
+ if (!NVME_CC_EN(data) && !NVME_CC_EN(n->bar.cc) &&
+ !NVME_CC_SHN(data) && !NVME_CC_SHN(n->bar.cc))
+ {
+ n->bar.cc = data;
+ }
+
if (NVME_CC_EN(data) && !NVME_CC_EN(n->bar.cc)) {
n->bar.cc = data;
if (nvme_start_ctrl(n)) {
--
1.8.3.1
next prev parent reply other threads:[~2015-04-30 19:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 19:10 [Qemu-devel] [PULL 0/7] Block patches Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 1/7] MAINTAINERS: make virtio-blk Stefan Hajnoczi's responsibility Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 2/7] MAINTAINERS: split out image formats Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 3/7] MAINTAINERS: make block I/O path Stefan Hajnoczi's responsibility Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 4/7] MAINTAINERS: make image fuzzer " Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 5/7] MAINTAINERS: make block layer core Kevin Wolf's responsibility Kevin Wolf
2015-04-30 19:10 ` [Qemu-devel] [PULL 6/7] MAINTAINERS: Add qemu-block list where missing Kevin Wolf
2015-04-30 19:10 ` Kevin Wolf [this message]
2015-05-01 8:59 ` [Qemu-devel] [PULL 0/7] Block patches Peter Maydell
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=1430421016-13158-8-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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).