You are not logged in.

#1 2015-12-20 22:05:59

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

qemu/kvm Use the pci sata controller instead of use the disk emulation

Hi

i want use a external sata controller (Asus u3s6) connected to a single SSD instead of add to virtualization the same disk throught a qemu emulation (virtio, sata, etc)

I added the controller ID to vfio and can use with qemu (like a graphic card and USB ports)

when install windows 10 pro (iso) can detect the disk and can install without problems.

but when reboot, the UEFI (edk2.git-ovmf-20151218.b1389.gdf56e80) can't reconized that disk and can't boot that installation with nothing (I have created a disk (virtio drive) with only grub2, but at the moment, can't boot (some failures, i don't know if I making the correct steps)

my specs:

Dual xeon x5650@2.70GHz
Evga SR-2
Nvidia GTX 770 2Gb (host)
Nvidia GTX Titan Black (guest)
Crucial MX100  - 256Gb (connected to onboard sata3 controller)(host)
Asus U3S3 + Kingston ssdnow 300 - 250Gb (guest)
Archlinux 64bits
Win10 pro

my xml: http://sl1pkn07.wtf/paste/view/561b3ad0
my qemu.conf: http://sl1pkn07.wtf/paste/view/10537c97 (tweaked like the Wiki)

yes, i've tested without passthrought the controller, adding the disk like a virtual device. but the I/O performance is a disaster. tried wih SATA, Virtio, IDE... nothing works decently. inclusive this: http://wiki.mikejung.biz/KVM_/_Xen. my last hope is with pci passthrought. but can't boot hmm

any help?

BTW. anyone have a dualboot with windows10, grub2 and uefi? can post the grub windows menuentry?

Also tested with supergrubdisk iso. no sucess (don't detect the disk), but when booting into archlinux iso(livecd), can view the disk



greetings

edit: update xml

Last edited by sl1pkn07 (2015-12-28 22:35:47)

Offline

#2 2015-12-21 01:55:01

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

I guess OVMF simply doesn't support booting from a PCI(-E) controller, or does not have the "driver" for it? Never tried that before so I am not sure. Only know that it doesn't support NVMe drive yet.

Using the block device directly works pretty fine for me, e.g. `-drive file=/dev/foo,if=virtio,cache=none,aio=native`(viostor) or `-device virtio-scsi-pci -drive /dev/foo,if=none,format=raw,cache=none,aio=native,id=foo -device scsi-block,drive=foo`(vioscsi).

There you go for the grub entry: https://wiki.archlinux.org/index.php/GR … menu_entry

You can indeed try to have a little grub image and see if the SATA drive shows up on grub shell (`ls`), e.g. `grub-install --efi-directory /mnt --boot-directory /mnt --removable`, assuming the virtual drive/partition is FAT-formatted and mounted to /mnt. If it's there you might be able to chainload the physical drive there.

Last edited by tom.ty89 (2015-12-21 01:59:58)

Offline

#3 2015-12-21 20:56:19

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

nope. not detect with grub. only detect if a any system (linux or windowsISO) is launched before

i'm back to virtualize the drive, but in this try I tried with LUM passthrought

the performace is better, but not at all

http://wstaw.org/m/2015/12/21/Captura.PNG
http://wstaw.org/m/2015/12/21/Captura1.PNG
http://wstaw.org/m/2015/12/21/photo_201 … -49-37.jpg

some trick to improve it?

the controller, Asus U3S6 rev1.03G, with Marvell 8120 chip  don't have any downloadable firmware, but the rev2xx (Marvel 8123) It has it. tsk

greetings

Last edited by sl1pkn07 (2015-12-21 21:43:18)

Offline

#4 2015-12-21 21:36:40

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

Go to "Advanced options" (Opciones avanzadas) -> "Performance options", try setting:
"Cache mode": "none" or "directsync"
"IO mode": "native"

Offline

#5 2015-12-21 21:42:37

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

conected to sata2 (intel ICH10)

http://wstaw.org/m/2015/12/21/Captura2.PNG

Offline

#6 2015-12-21 21:54:03

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

With the options set?

I don't know. Maybe I can do some test with my Intel 530 + H87 AHCI here later. I don't have Windows installed on it currently.

Offline

#7 2015-12-21 22:00:34

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

no, without options. I now trying with your options

EDIT: with

"Cache mode": "directsync"
"IO mode": "native"

up to 99MB/s

EDIT2: with

"Cache mode": "none"
"IO mode": "native"

up to 100(.4)MB/s

EDIT3:

i don't know what FFFFF happend

http://wstaw.org/m/2015/12/22/Captura3.PNG
O_o
and second try
http://wstaw.org/m/2015/12/22/Captura4.PNG
o_O


changed to virtio (vda), cache=none and io=native

i don't know why, but i tried this before and give me about 55MB/s in same test in a same controller (Asus)

why god, why...

greetings

EDIT4: I know what happend

before set all my cores (24) to guest (2sockets - 6 cores - 2 threads), now reduce to 12 (2sockets - 6 cores - 1thread). now all machine working (guest and host) sweetly

case closed

now tried with games...

greetings and sorry for the edits

Last edited by sl1pkn07 (2015-12-22 11:35:23)

Offline

#8 2015-12-22 04:13:28

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

I found your sequential result a bit unreal though. 1TB/s Read and Write on an ~200GiB SATA3 SSD? And your random read/write is not quite on par.

Anyway if you're interested here is my result:

Physical:
Write Cache On: https://ptpb.pw/f8J-.PNG
Write Cache Off: https://ptpb.pw/EQAX.PNG

cache=none:
Write Cache On: https://ptpb.pw/ZZJZ.PNG
Write Cache Off: https://ptpb.pw/Oi97.PNG

cache=directsync:
Write Cache On: https://ptpb.pw/3CFv.PNG
Write Cache Off: https://ptpb.pw/Q79T.PNG

Not exceptional, but acceptable.

vioscsi Driver Version: https://ptpb.pw/oGhK.PNG (virtio-win-0.1.112.iso) on Win10 Pro 1511

qemu command:

qemu-system-x86_64 -enable-kvm -cpu host -m 4G -drive file=.local/share/ovmf/ovmf_x64.bin,if=pflash,format=raw -drive file=/dev/sdb,if=none,format=raw,cache=[none|directsync],aio=native,id=win -device virtio-scsi-pci -device scsi-block,drive=win -full-screen

(rootless with with ACLs set on the block device, should be equivalent to SCSI LUN passthrough with filtered SG_IO in virt-manager)

Motherboard: ASUS H87-PRO
CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz (4 core, no HT, no -smp set as shown above)
RAM: 2GBx4 1066MHz
SSD: Intel 530 240GB, Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]

Last edited by tom.ty89 (2015-12-22 04:26:02)

Offline

#9 2015-12-22 07:01:52

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

FWIW viostor (if=virtio) indeed seem to perform better than vioscsi, at least in Windows. Here is a set of benchmark with Write Cache on:

cache=none: https://ptpb.pw/UI0u.PNG
cache=directsync: https://ptpb.pw/Pc9-.PNG

Sequential R/W almost shows no overhead, Random R/W has around 30-50% of the physical performance.

Offline

#10 2015-12-22 08:16:28

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: qemu/kvm Use the pci sata controller instead of use the disk emulation

Just tried passing through the SATA controller with vfio-pci (-device vfio-pci,host=00:1f.2):

00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)

It actually works with seabios. I can install and boot Windows and benchmark the SSD just fine. OVMF does not detect the drive though, can't see it with grub there either.

However, its performance is not as good as viostor, which is a bit surprising to me. Not far behind though:
https://ptpb.pw/23Qb.PNG

Also the following error always pop up in pair when the guest is (re)started:

qemu-system-x86_64: vfio: Cannot reset device 0000:00:1f.2, no available reset mechanism.
qemu-system-x86_64: vfio: Cannot reset device 0000:00:1f.2, no available reset mechanism.

So far it seem to be harmless though.

Offline

Board footer

Powered by FluxBB