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] xl: pci completion error

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xl: pci completion error
From: Sergey Tovpeko <tsv.devel@xxxxxxxxx>
Date: Wed, 06 Oct 2010 17:08:45 +0400
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 06 Oct 2010 06:14:03 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Fx+qctd+LnjQ9nR9/XPP3B0O8Uskcr2T0SulE8QWh2E=; b=rN8ujQzO/C/lEb7DxobojmZj/lYWzef7Uqbycp/Is5jPAP15/kIdqcaKEDb98+2dI6 MHp9HjUlG/p4p+LOt7VliEFk9sDYQKt/VXiaZMivNXibGFQ/f0mGIc1j0ofDJO2WDnLs cIgqqAq9pc8EZrQLIp+swdDBLI4QTf79tanqw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=S2rL8LWg6UNvmhoMg+1WJPt3EdeGT7TBBgYO31dMKNZXzgahUUWILsDpw6r6xWBn1N FL53tcCyZgPsWFlMdAS2OgURVp9sKAywolgBIEH/q2o0NaNunm/Ewf0JVqKFSEw3fC/S EuKYyUU6L8vjSq0+RtL37IpWFncQyOxQM6xmY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1010061136220.2440@kaball-desktop>
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: <4CAB0E9A.5050507@xxxxxxxxx> <alpine.DEB.2.00.1010061136220.2440@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)
Stefano Stabellini wrote:
On Tue, 5 Oct 2010, Sergey Tovpeko wrote:
Hello, list!

xl reports the error on passthrough-ed pci device removing.

do_pci_remove device 01:00.0
libxl: error: libxl_device.c:448:libxl__wait_for_device_model Device Model not ready libxl: error: libxl_pci.c:858:do_pci_remove Device Model didn't respond in time libxl: error: libxl.c:944:libxl_domain_destroy pci shutdown failed for domid 1 libxl: error: libxl.c:896:libxl_destroy_device_model Couldn't find device model's pid: No such file or directory libxl: error: libxl.c:956:libxl_domain_destroy libxl_destroy_device_model failed for 1 libxl: error: libxl_device.c:307:libxl__devices_destroy /local/domain/1/device is empty



It seems that libxl_pci didn't get the 'pci-removed' status from qemu-dm. Please, have a look who should set this status in qemu-dm. As for me I added xenstore_record_dm_state("pci-removed");
after do_pci_del(par);
in xenstore_process_dm_command_event function.

It fixed up my issue of removing pci devices.

What guest OS are you using?
Currently "pci-removed" is only written in response of an eject command
from the guest OS, that means that if the guest doesn't support pci
hotplug the value won't be written.
If you are using Linux you should make sure that the acpiphp module is
loaded, if you are using Windows, I think the only version that supports
pci hotplug is Windows Server 2008 but I might be wrong.

The guest is Windows XP sp2 32 bit.

When I do pci hot-unplug on the fly
xl pci-detach 11:0b.0
the guest detaches the pci card correctly with 'pci-removed' signal, but on the shutdown, it doesn't.

In the code the flow is the following:
qemu-dm receives the 'pci-rem' command and sends the SCI interrupt to the guest. I think guest should catch this interrupt and write to the magic ACPI port that causes qemu-dm send 'pci-removed' signal.

On guest shutdown, libxl sends 'pci-rem' command to qemu-dm and waits for the answer. I suppose, by the time 'pci-rem' signal my guest have finished its work, and doesn't react on SCI interrupt. As a result libxl doesn't receive pci-removed signal.

It's my observation.


Sergey.










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