Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
qemu-kvm pass thru mode
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 378
Location: Canada

PostPosted: Tue Apr 08, 2014 1:12 am    Post subject: qemu-kvm pass thru mode Reply with quote

I wish to use qemu-kvm in pci pass thru mode so that I can used virtual machines to write to dvd's.

The initial test will be on a virtual debian 7 run in a gentoo host.
Ultimately the guest will be windows xp and or windows 7.

I am have great difficulties as I don't understand scsi bus numbers, amongst other things.

I have been guided by

(1) http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.qemu.running.html#cha.qemu.running.devices

and

(2) http://pve.proxmox.com/wiki/CD/DVD_Writer

Report on Partial Progress.

Code:
dmesg | grep AMD-Vi



yields
Quote:
[ 0.894599] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
[ 0.902674] AMD-Vi: Lazy IO/TLB flushing enabled


so I believe that the host is capable of supporting this feature.

Reference (1) suggest getting pci info with
Code:
lspci -nn


but that yields
Quote:
00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B) [1002:5a14] (rev 02)
00:00.2 IOMMU [0806]: Advanced Micro Devices, Inc. [AMD/ATI] RD990 I/O Memory Management Unit (IOMMU) [1002:5a23]
00:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B) [1002:5a16]
00:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port D) [1002:5a18]
00:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port E) [1002:5a19]
00:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port G) [1002:5a1b]
00:11.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] [1002:4391] (rev 40)
00:12.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397]
00:12.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396]
00:13.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397]
00:13.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396]
00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller [1002:4385] (rev 42)
00:14.2 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) [1002:4383] (rev 40)
00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller [1002:439d] (rev 40)
00:14.4 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge [1002:4384] (rev 40)
00:14.5 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller [1002:4399]
00:16.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397]
00:16.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396]
00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0 [1022:1600]
00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1 [1022:1601]
00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2 [1022:1602]
00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3 [1022:1603]
00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4 [1022:1604]
00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5 [1022:1605]
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF119 [GeForce GT 610] [10de:104a] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GF119 HDMI Audio Controller [10de:0e08] (rev a1)
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 09)
03:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller [1b21:1042]
04:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller [1b21:1042]

but in my ignorance I do not even know what line refers to my cd device, which is /dev/sr0

The output of
Code:
lshw

includes
Quote:
*-scsi:3
physical id: 5
logical name: scsi3
capabilities: emulated
*-cdrom
description: DVD-RAM writer
product: BW-14D1XT
vendor: ASUS
physical id: 0.0.0
bus info: scsi@3:0.0.0
logical name: /dev/cdrom
logical name: /dev/dvd
logical name: /dev/sr0
version: 1.00
capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
configuration: ansiversion=5 status=ready
*-medium
physical id: 0
logical name: /dev/cdrom


[code]The output of [code]hwinfo|grep -30 sr0[/code]


includes the following:

Quote:
59: SCSI 300.0: 10602 CD-ROM (DVD)
[Created at block.249]
Unique ID: KD9E.kX14zcc0kg3
Parent ID: 7EWs._PBwrxA5iH7
SysFS ID: /class/block/sr0
SysFS BusID: 3:0:0:0
SysFS Device Link: /devices/pci0000:00/0000:00:11.0/ata4/host3/target3:0:0/3:0:0:0
Hardware Class: cdrom
Model: "ASUS BW-14D1XT"
Vendor: "ASUS"
Device: "BW-14D1XT"
Revision: "1.00"
Driver: "ahci", "sr"
Driver Modules: "ahci"
Device File: /dev/sr0 (/dev/sg3)
Device Number: block 11:0 (char 21:3)
Features: CD-R, CD-RW, DVD, DVD-R, DVD-RW, DVD-R DL, DVD+R, DVD+RW, DVD+R DL, BD, BD-R, BD-RE, DVD-RAM, MRW, MRW-W
Drive status: no medium
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #24 (SATA controller)
Drive Speed: 125


Can some kind and knowledgeable person give me any advice as to how to proceed?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6042

PostPosted: Tue Apr 08, 2014 2:06 am    Post subject: Reply with quote

Quote:
Code:
00:11.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] [1002:4391]
(rev 40)

Code:
SysFS Device Link: /devices/pci0000:00/0000:00:11.0/ata4/host3/target3:0:0/3:0:0:0

The PCI devices here match, and you have all the proper hardware virtualisation support to pass the entire device to the VM.

BUT: Your boot disk is probably on that SATA controller too, so you can't do that.

There's "scsi-generic" and "scsi-block" drivers in qemu that are labelled "passthrough", so you could try to set the disk up as one of those instead.
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 378
Location: Canada

PostPosted: Wed Apr 09, 2014 4:26 am    Post subject: Reply with quote

Many thanks to Ant P for his comments.

Quote:
BUT: Your boot disk is probably on that SATA controller too, so you can't do that.

No doubt this is why I crashed my host attempting pass thru to /dev/sr0 using the instructions from:http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.qemu.running.html

Quote:
There's "scsi-generic" and "scsi-block" drivers in qemu that are labelled "passthrough", so you could try to set the disk up as one of those instead

Thanks for the suggestion.
Do you know if this approach require something like sys-block/open-iscsi?

I shall try this approach but unless I come upon a "recipe" it will probably be a few weeks until a get around to it.

I shall post here after I have either succeeded or given up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum