WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] IOMMU and AMD 890fx

To: "Huang2, Wei" <Wei.Huang2@xxxxxxx>
Subject: Re: [Xen-devel] IOMMU and AMD 890fx
From: Jens Krehbiel-Gräther <xen@xxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Jun 2010 00:09:31 +0200
Cc: "Przywara, Andre" <Andre.Przywara@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Leonardo Prosperi <leo.prosperi@xxxxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>, Eikelenboom <linux@xxxxxxxxxxxxxx>, Andrew Oakley <andrew@xxxxxxxxxxxxxxxxx>, Joop Boonen <joop_boonen@xxxxxx>
Delivery-date: Wed, 16 Jun 2010 15:12:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <3399D2269986104B959D31B7E919313C3D10B465@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <z2n56ae3d9b1005081631sf3c31fafsb24b018c70b11b1a@xxxxxxxxxxxxxx> <y2i56ae3d9b1005091101xd15a9bcbt2244a907745b26f9@xxxxxxxxxxxxxx> <3399D2269986104B959D31B7E919313C06E2BD8E@xxxxxxxxxxxxxxxxxxx> <4410545273.20100510083852@xxxxxxxxxxxxxx> <AANLkTikDGRtmZgT3DdOcdnyDTMr4TnAperaeTXcfB0cM@xxxxxxxxxxxxxx> <571239012.20100603101930@xxxxxxxxxxxxxx> <1857fd65263c9155e5f307f3b7e329d0.squirrel@xxxxxxxxxxxxxxx> <1807175740.20100603112310@xxxxxxxxxxxxxx> <ee4a6ab6f04c6a03ad99464f01b6dabc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20100603112649.GG11162@xxxxxxxxxx> <4C079729.8030502@xxxxxxx> <20100610194947.17e0f6ad@ado-gentoo> <4C113911.9030005@xxxxxxx> <20100610201527.61351484@ado-gentoo> <4C160DBF.8030701@xxxxxxxxxxxxxxxxxx> <4C163371.7090809@xxxxxxx>, <4C17F2B4.7040208@xxxxxx> <3399D2269986104B959D31B7E919313C3D10B465@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
Hi!

I now have a Asus Crosshair IV for testing and this board (as I postet earlier) supports iommu. Now I have installed Debian lenny (5.0) and compiled xen 4.0.0. Xen is running now and I have installed a hvm debian lenny to which I would like to bind a pci device but that doesn't work.
Perhaps I am doing something wrong and you could help me?


xen-01:~# xm dmesg |grep -i -e iommu -e amd-vi -e ivrs
(XEN) ACPI: IVRS CFD9FA00, 00C8 (r1  AMD     RD890S   202031 AMD         0)
(XEN) AMD-Vi: IOMMU 0 Enabled.
xen-01:~#

So as xm dmesg reports IOMMU is enabled. I passed the "iommu=1" parameter to kernel.

xen-01:~# uname -a
Linux xen-01 2.6.32-bpo.5-xen-amd64 #1 SMP Fri Jun 11 12:21:09 UTC 2010 x86_64 GNU/Linux

xen-01:/boot# grep -i iommu config-2.6.32-bpo.5-xen-amd64
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
CONFIG_AMD_IOMMU=y
# CONFIG_AMD_IOMMU_STATS is not set
CONFIG_IOMMU_HELPER=y
CONFIG_IOMMU_API=y
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set

xen-01:/boot# grep -i backend config-2.6.32-bpo.5-xen-amd64
CONFIG_XEN_BACKEND=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_XEN_BLKDEV_BACKEND=y
CONFIG_XEN_PCIDEV_BACKEND=y
CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set


So I think the needed kernel options are enabled.

I can hide the pci device from dom0:

lspci:
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)

echo -n "0000:00:14.2" > "/sys/bus/pci/drivers/HDA Intel/unbind"
echo -n "0000:00:14.2" > /sys/bus/pci/drivers/pciback/new_slot
echo -n "0000:00:14.2" > /sys/bus/pci/drivers/pciback/bind


xen-01:~# xm pci-list-assignable-devices
0000:00:14.2


Now when I try to pass through the device to the guest I get (at first try) this message:

xen-01:~# xm pci-attach test 0000:00:14.2 8
Error: Timed out waiting for device model action
Usage: xm pci-attach [-o|--options=<opt>] <Domain> <domain:bus:slot.func> [virtual slot]

Insert a new pass-through pci device.

When I try it again, I will always get this message:

xen-01:~# xm pci-attach test 0000:00:14.2 8
Error: Failed to assign device to IOMMU (0000:00:14.2@40,msitranslate=1,power_mgmt=0) Usage: xm pci-attach [-o|--options=<opt>] <Domain> <domain:bus:slot.func> [virtual slot]

Insert a new pass-through pci device.

In /var/log/xen/xend.log there are this messages:

[2010-06-17 00:06:18 2407] DEBUG (XendDomainInfo:903) XendDomainInfo.pci_device_configure: ['pci', ['dev', ['slot', '0x14'], ['domain', '0x0000'], ['key', '0000:00:14.2@8'], ['bus', '0x00'], ['vdevfn', '0x40'], ['func', '0x2']], ['state', 'Initialising']]

[2010-06-17 00:06:18 2407] DEBUG (XendDomainInfo:675) XendDomainInfo.hvm_pci_device_create: {'devs': [{'slot': '0x14', 'domain': '0x0000', 'key': '0000:00:14.2@8', 'bus': '0x00', 'vdevfn': '0x40', 'func': '0x2', 'uuid': 'f9a78b41-aad2-8c31-73a3-2b2162c8ebb4'}], 'states': ['Initialising']}

[2010-06-17 00:06:18 2407] DEBUG (XendDomainInfo:801) XendDomainInfo.hvm_pci_device_insert_dev: {'slot': '0x14', 'domain': '0x0000', 'key': '0000:00:14.2@8', 'bus': '0x00', 'vdevfn': '0x40', 'func': '0x2', 'uuid': 'f9a78b41-aad2-8c31-73a3-2b2162c8ebb4'}

[2010-06-17 00:06:18 2407] DEBUG (XendDomainInfo:822) XendDomainInfo.hvm_pci_device_insert_dev: 0000:00:14.2@40,msitranslate=1,power_mgmt=0


dmesg gives this log:

[ 2177.373375] pciback 0000:00:14.2: seizing device
[ 2177.373488] xen: registering gsi 16 triggering 0 polarity 1
[ 2177.373497] xen_allocate_pirq: returning irq 16 for gsi 16
[ 2177.373519] xen: --> irq=16
[ 2177.373528] Already setup the GSI :16
[ 2177.373551] pciback 0000:00:14.2: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 2177.373582] pciback 0000:00:14.2: PCI INT A disabled


and xm dmesg this:

(XEN) domctl.c:853:d0 XEN_DOMCTL_assign_device: assign device (0:14.2) failed


So can anyone tell me what I am doing wrong??

Hope someone could help me!

   Jens


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>