1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
Only one NVMe device is usable in Windows (10) guest
Full command: qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m 4G -net bridge -net nic -full-screen -drive file=ovmf_x64.bin,format=raw,if=pflash -drive file=disks/win16_ide.img,format=raw,cache=none,aio=native -drive file=disks/one.img,if=none,format=qcow2,id=one -drive file=disks/two.img,if=none,format=qcow2,id=two -device nvme,drive=one,serial=E86C3CFC43518D6F -device nvme,drive=two,serial=2BDAC262CF831698
QEMU version: 2.5.0
Kernel: 4.5.1 (Arch Linux)
When there are two NVMe devices specified, only the second one will be usable in Windows. The following error is shown under "Device status" of the failed NVMe controller in Device Manager:
"This device cannot start. (Code 10)
The I/O device is configured incorrectly or the configuration parameters to the driver are incorrect."
The only thing seems suspicious to me is that the nvme emulation in qemu does not have WWN/EUI-64 set for the devices, though I have no idea at all whether that is mandatory:
"C:\Windows\system32>sg_vpd -i PD1
Device Identification VPD page:
Addressed logical unit:
designator type: SCSI name string, code set: UTF-8
SCSI name string:
8086QEMU NVMe Ctrl 00012BDAC262CF831698
C:\Windows\system32>sg_vpd -p sn PD1
Unit serial number VPD page:
Unit serial number: 0000_0000_0000_0000."
You can see from the "SCSI name string" that the working NVMe device is the second one specified in the command.
"if=virtio" (which similarly has one controller per drive and has each controller occupies a pci slot as the nvme emulation) works fine:
qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m 4G -net bridge -net nic -full-screen -drive file=ovmf_x64.bin,format=raw,if=pflash -drive file=disks/win16_ide.img,format=raw,cache=none,aio=native -drive file=disks/one.img,if=virtio,format=qcow2,id=one -drive file=disks/two.img,if=virtio,format=qcow2,id=two
Apparently it works fine in Linux though:
qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m 4G -net bridge -net nic -full-screen -drive file=ovmf_x64.bin,format=raw,if=pflash -drive file=Downloads/archlinux-2016.04.01-dual.iso,media=cdrom -drive file=disks/one.img,if=none,format=qcow2,id=one -drive file=disks/two.img,if=none,format=qcow2,id=two -device nvme,drive=one,serial=E86C3CFC43518D6F -device nvme,drive=two,serial=2BDAC262CF831698
I also tested WIndows installation ISOs instead as well.
Windows 10 Enterprise 10586:
qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m 4G -net bridge -net nic -full-screen -drive file=ovmf_x64.bin,format=raw,if=pflash -drive file=Downloads/10586.0.151029-1700.TH2_RELEASE_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_EN-US.ISO,media=cdrom -drive file=disks/one.img,if=none,format=qcow2,id=one -drive file=disks/two.img,if=none,format=qcow2,id=two -device nvme,drive=one,serial=E86C3CFC43518D6F -device nvme,drive=two,serial=2BDAC262CF831698
Windows Server 2016 Technical Preview 5:
qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m 4G -net bridge -net nic -full-screen -drive file=ovmf_x64.bin,format=raw,if=pflash -drive file=Downloads/14300.1000.160324-1723.RS1_RELEASE_SVC_SERVER_OEMRET_X64FRE_EN-US.ISO,media=cdrom -drive file=disks/one.img,if=none,format=qcow2,id=one -drive file=disks/two.img,if=none,format=qcow2,id=two -device nvme,drive=one,serial=E86C3CFC43518D6F -device nvme,drive=two,serial=2BDAC262CF831698
Both of them shows only one of the NVMe drives.
I also tested with two versions of OVMF, which are "18419" (https://github.com/tianocore/edk2/commit/ddd097e33f6e6829dc0413820e9971f3bf025f87) and "18455" (https://github.com/tianocore/edk2/commit/59844e126614fc8275aab083fafa5818cde0901c).
On Thu, Apr 28, 2016 at 05:44:21PM -0000, Tom Yan wrote:
CCing Keith Busch <email address hidden>, maintainer of QEMU NVMe.
Maybe he has an idea.
> Public bug reported:
>
> Full command: qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m
> 4G -net bridge -net nic -full-screen -drive
> file=ovmf_x64.bin,format=raw,if=pflash -drive
> file=disks/win16_ide.img,format=raw,cache=none,aio=native -drive
> file=disks/one.img,if=none,format=qcow2,id=one -drive
> file=disks/two.img,if=none,format=qcow2,id=two -device
> nvme,drive=one,serial=E86C3CFC43518D6F -device
> nvme,drive=two,serial=2BDAC262CF831698
>
> QEMU version: 2.5.0
>
> Kernel: 4.5.1 (Arch Linux)
>
> When there are two NVMe devices specified, only the second one will be
> usable in Windows. The following error is shown under "Device status" of
> the failed NVMe controller in Device Manager:
>
> "This device cannot start. (Code 10)
>
> The I/O device is configured incorrectly or the configuration parameters
> to the driver are incorrect."
>
> The only thing seems suspicious to me is that the nvme emulation in qemu
> does not have WWN/EUI-64 set for the devices, though I have no idea at
> all whether that is mandatory:
>
> "C:\Windows\system32>sg_vpd -i PD1
> Device Identification VPD page:
> Addressed logical unit:
> designator type: SCSI name string, code set: UTF-8
> SCSI name string:
> 8086QEMU NVMe Ctrl 00012BDAC262CF831698
>
> C:\Windows\system32>sg_vpd -p sn PD1
> Unit serial number VPD page:
> Unit serial number: 0000_0000_0000_0000."
>
> ** Affects: qemu
> Importance: Undecided
> Status: New
>
> ** Attachment added: "Screenshot of Device Manager and the error."
> https://bugs.launchpad.net/bugs/1576347/+attachment/4650548/+files/01.PNG
>
> --
> You received this bug notification because you are a member of qemu-
> devel-ml, which is subscribed to QEMU.
> https://bugs.launchpad.net/bugs/1576347
>
> Title:
> Only one NVMe device is usable in Windows (10) guest
>
> Status in QEMU:
> New
>
> Bug description:
> Full command: qemu-system-x86_64 -enable-kvm -cpu host -smp cores=4 -m
> 4G -net bridge -net nic -full-screen -drive
> file=ovmf_x64.bin,format=raw,if=pflash -drive
> file=disks/win16_ide.img,format=raw,cache=none,aio=native -drive
> file=disks/one.img,if=none,format=qcow2,id=one -drive
> file=disks/two.img,if=none,format=qcow2,id=two -device
> nvme,drive=one,serial=E86C3CFC43518D6F -device
> nvme,drive=two,serial=2BDAC262CF831698
>
> QEMU version: 2.5.0
>
> Kernel: 4.5.1 (Arch Linux)
>
> When there are two NVMe devices specified, only the second one will be
> usable in Windows. The following error is shown under "Device status"
> of the failed NVMe controller in Device Manager:
>
> "This device cannot start. (Code 10)
>
> The I/O device is configured incorrectly or the configuration
> parameters to the driver are incorrect."
>
> The only thing seems suspicious to me is that the nvme emulation in
> qemu does not have WWN/EUI-64 set for the devices, though I have no
> idea at all whether that is mandatory:
>
> "C:\Windows\system32>sg_vpd -i PD1
> Device Identification VPD page:
> Addressed logical unit:
> designator type: SCSI name string, code set: UTF-8
> SCSI name string:
> 8086QEMU NVMe Ctrl 00012BDAC262CF831698
>
> C:\Windows\system32>sg_vpd -p sn PD1
> Unit serial number VPD page:
> Unit serial number: 0000_0000_0000_0000."
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/1576347/+subscriptions
>
On Fri, Apr 29, 2016 at 10:10:39AM +0100, Stefan Hajnoczi wrote:
> On Thu, Apr 28, 2016 at 05:44:21PM -0000, Tom Yan wrote:
>
> CCing Keith Busch <email address hidden>, maintainer of QEMU NVMe.
> Maybe he has an idea.
Thanks for the report. Sounds like a Windows specific issue as I have no
problem with multiple nvme drives on my dev machines:
[Host]
# uname -r
4.6.0-rc5+
# qemu-system-x86_64 --version
QEMU emulator version 2.5.50, Copyright (c) 2003-2008 Fabrice Bellard
# qemu-system-x86_64 -m 4096 -smp 4 -enable-kvm debian.img \
-drive file=nvme.1.img,if=none,id=one -device nvme,drive=one,serial=foo \
-drive file=nvme.2.img,if=none,id=two -device nvme,drive=two,serial=bar
[Guest]
# uname -r
4.5.0
# ls /dev/nvme*
/dev/nvme0 /dev/nvme0n1 /dev/nvme1 /dev/nvme1n1
# nvme id-ctrl /dev/nvme0 | grep sn
sn : foo
# nvme id-ctrl /dev/nvme1 | grep sn
sn : bar
> > When there are two NVMe devices specified, only the second one will be
> > usable in Windows. The following error is shown under "Device status" of
> > the failed NVMe controller in Device Manager:
> >
> > "This device cannot start. (Code 10)
> >
> > The I/O device is configured incorrectly or the configuration parameters
> > to the driver are incorrect."
> >
> > The only thing seems suspicious to me is that the nvme emulation in qemu
> > does not have WWN/EUI-64 set for the devices, though I have no idea at
> > all whether that is mandatory:
These are not mandatory. They were only introduced in the 1.1 and 1.2 versions
of the NVMe spec, though we only cared to emulate the 1.0 portions rather than
provide a full featured NVMe controller.
That said, there needs to be care in the host OS to provide an appropriate
translation IF it is using a SCSI stack to talk to NVMe. Linux doesn't care,
but Windows does.
> > "C:\Windows\system32>sg_vpd -i PD1
> > Device Identification VPD page:
> > Addressed logical unit:
> > designator type: SCSI name string, code set: UTF-8
> > SCSI name string:
> > 8086QEMU NVMe Ctrl 00012BDAC262CF831698
The above looks reasonable for your second controller that had serial
2BDAC262CF831698.
> > C:\Windows\system32>sg_vpd -p sn PD1
> > Unit serial number VPD page:
> > Unit serial number: 0000_0000_0000_0000."
This doesn't look like a very good SCSI-NVMe translation and possibly
suspicious. But I don't know the first thing about windows; does it care about
unique unit serial numbers in order to surface a "SCSI" disk?
> > C:\Windows\system32>sg_vpd -p sn PD1
> > Unit serial number VPD page:
> > Unit serial number: 0000_0000_0000_0000."
I checked your serial number against the SNT refernce on nvmexpress.org and
it's definitely the wrong translation, so that has to be a guest OS driver bug
(Linux has the right translation if interested, but it's use is deprecated).
I pinged some Windows comrades to see if a potential serial conflict prevents
both disks from surfacing.
I'm surprised to see this bad translation as I know of folks successfully
testing multiple nvme drives in various versions of Windows with both the OFA
and Microsoft drivers. An emulated NVMe is no different than real h/w for
namespace identification from the host's perspective.
The problem still exists with qemu 2.7.0 and Windows 10 RS1. Btw I just did one more test, that I disable the working nvme controller in Device Manager to see if it makes the non-working one comes alive, but it does not, even if I reboot the virtual machine.
For the record, the serial number translation is not fixed in RS1 either.
Trying it on Windows 10 guest and QEMU 2.8.0 has the same issue. However, I noticed that:
Supplying 1 NVMe drive -> Win10 sees it.
Supplying 2 NVMe drives -> Win10 sees only one of them.
Supplying 3 NVMe drives -> Win10 sees only two of them.
So I still have been able to create a ReFS mirrored storage space with two NVMe disks under QEMU, I just had to pass three drives instead of two:
qemu-system-x86_64 -enable-kvm <...> -drive file=/media/ssd/NVMe_drvA.qcow2,id=diskNVMeA,format=qcow2,if=none -drive file=/media/ssd/NVMe_drvB.qcow2,id=diskNVMeB,format=qcow2,if=none -drive file=/media/ssd/NVMe_drvC.qcow2,id=diskNVMeC,format=qcow2,if=none -device nvme,drive=diskNVMeA,serial=foo -device nvme,drive=diskNVMeB,serial=foo -device nvme,drive=diskNVMeC,serial=foo
Hope this helps,
--Sergey
Hello, I can also confirm that if you have a series of NVMe devices, at first when just the OVMF boot menu has loaded, using qemu with a -monitor and typing 'info pci', it appears that all are given valid bus addresses.
However, once the Windows 10 x64 installer iso loads, it seems that every other NVMe device stays initialized correctly, but the ones in-between switch to a 0xfffff... bus address. So, for example, with 6 devices, numbers 1,3,5 will get initialized and recognized by the Windows installer, and 2,4,6 will not. Not sure if this clue helps identify this a qemu or Windows issue or not, but I thought it was worth noting.
Also, I found that an alternative way to getting two or more NVMe devices successfully recognized by Windows is to use multiple root PCIe devices like so:
qemu-system-x86_64 \
-enable-kvm \
-machine pc-q35-2.11,accel=kvm \
-nodefaults \
...
-device pcie-root-port,id=pcie_r0,bus=pcie.0,chassis=0,slot=0 \
-device nvme,drive=disk0,serial=serial0,bus=pcie_r0 \
-drive id=disk0,if=none,media=disk,cache=none,aio=native,format=raw,discard=unmap,file=/opt/os.raw \
-device pcie-root-port,id=pcie_r1,bus=pcie.0,chassis=0,slot=1 \
-device nvme,drive=disk1,serial=serial1,bus=pcie_r1 \
-drive id=disk1,if=none,media=disk,cache=none,aio=native,format=raw,discard=unmap,file=/opt/data.raw \
The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.
[Expired for QEMU because there has been no activity for 60 days.]
|