Bug 511833 - Assigning PCI device to vm: create_userspace_phys_mem: Invalid argument
Summary: Assigning PCI device to vm: create_userspace_phys_mem: Invalid argument
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 11
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Glauber Costa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-15 10:05 UTC by Jón Fairbairn
Modified: 2009-08-11 09:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-11 09:14:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Qemu-kvm log file (1.78 KB, text/plain)
2009-07-15 10:05 UTC, Jón Fairbairn
no flags Details
/proc/cpuinfo (1.45 KB, text/plain)
2009-08-11 07:55 UTC, Jón Fairbairn
no flags Details

Description Jón Fairbairn 2009-07-15 10:05:37 UTC
Created attachment 353802 [details]
Qemu-kvm log file

Description of problem:
If I attempt to assign a PCI network card directly to a virtual machine
(using virt-manager => Details => Add Hardware => Physical Host Device
{PCI Device, 00:09:0 MCP55 Ethernet}, when I then boot the vm:

(a) I get selinux avcs; might be bug #499259, but that's
supposed to be closed, fixed in selinux-policy-3.6.12-29,
but I have selinux-policy-3.6.12-62.fc11.noarch and
virt_manage_sysfs --> on (should I report this on that bug
or elsewhere?)

(b) If I do setenforce permissive and try again,
virt-manager flickers briefly and the virtual console goes
back to saying "Guest not running" (reckon this is a bug in
virt-manager: it should say something helpful -- shall I
raise a separate bug for that too?). Looking at
/var/log/libvirt/qemu/$vm.log, I see:

create_userspace_phys_mem: Invalid argument
assigned_dev_iomem_map: Error: create new mapping failed

Version-Release number of selected component (if applicable):
qemu-0.10.5-3.fc11.x86_64

How reproducible:
Completely

Steps to Reproduce:
1. copy minimal kickstart
$ cp /usr/share/doc/livecd-tools-024/livecd-fedora-minimal.ks .

2. edit that so that it refers to fedora 11:
repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=$basearch
(at time of writing adding the updates repo makes no difference)

3.
sudo livecd-creator --config livecd-fedora-minimal.ks --cache somewhere-handy -f livecd-fedora-minimal

2.
use virt-manager to create a virtual machine from that livecd
(can disable storage for this virtual machine)

3.
use virt-manager to assign a physical ethernet device to that vm
(using virt-manager => Details => Add Hardware => Physical Host Device
{PCI Device, 00:09:0 MCP55 Ethernet} in my case

[
4a.
Click on run, get selinux denials
SELinux is preventing qemu-kvm (svirt_t) "sys_rawio" svirt_t. 
SELinux is preventing qemu-kvm (svirt_t) "sys_admin" svirt_t. 
]

4b.
setenforce permissive, click on run again.

Actual results:
A message is displayed in the vm console window too briefly to be read
and reverts to "Guest not running", errors in the vm's log


Expected results:
A running vm with a real PCI network device


Additional info:
Not sure if this is specific to x86_64.

Comment 1 Mark McLoughlin 2009-08-07 13:48:48 UTC
The best thing to do might be to try this from the command line using virsh; once we've got device assignment working there, we can figure out what other bugs are worth filing

First of all, do you have a machine with VT-d support enabled? i.e. if you boot with intel_iommu=on, what does 'dmesg | grep DMAR' show ?

There's a bunch more info here which might be useful:

http://fedoraproject.org/wiki/Test_Day:2009-05-07_Virtualization_KVM_PCI_Device_Assignment

Comment 2 Jón Fairbairn 2009-08-11 07:53:56 UTC
>First of all, do you have a machine with VT-d support enabled?

I'm not familiar with the terminology

> i.e. if you boot with intel_iommu=on, what does 'dmesg | grep DMAR' show ?

Nothing, but then it is an AMD box. I'll attach /proc/cpuinfo

Comment 3 Jón Fairbairn 2009-08-11 07:55:50 UTC
Created attachment 356996 [details]
/proc/cpuinfo

Comment 4 Mark McLoughlin 2009-08-11 09:14:58 UTC
(In reply to comment #2)
> >First of all, do you have a machine with VT-d support enabled?
> 
> I'm not familiar with the terminology
> 
> > i.e. if you boot with intel_iommu=on, what does 'dmesg | grep DMAR' show ?
> 
> Nothing, but then it is an AMD box. I'll attach /proc/cpuinfo

Okay, PCI device assignment on AMD machines requires the machine to have IOMMU support. AFAIK, only very recent AMD Shanghai or Istanbul based platforms have this. The Athlon 64 X2 doesn't have it

The error message is terrible, though, I'll grant you that :-)

Thanks for the report


Note You need to log in before you can comment on or make changes to this bug.