From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Xen-devel <xen-devel@lists.xensource.com>,
"Han, Weidong" <weidong.han@intel.com>,
Keir Fraser <keir.fraser@eu.citrix.com>,
"Jiang, Yunhong" <yunhong.jiang@intel.com>
Subject: Re: Re: APIC rework
Date: Wed, 25 Nov 2009 13:00:31 -0500 [thread overview]
Message-ID: <20091125180031.GA5531@phenom.dumpdata.com> (raw)
In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC201CD419316@pdsmsx503.ccr.corp.intel.com>
On Wed, Nov 25, 2009 at 11:21:45PM +0800, Zhang, Xiantao wrote:
> Konrad Rzeszutek Wilk wrote:
> > On Wed, Nov 25, 2009 at 10:43:47AM +0800, Zhang, Xiantao wrote:
> >> Konrad Rzeszutek Wilk wrote:
> >>>> At least dom0 parses this info from DSDT, so we can't have the
> >>>> assuption whether it is used or not, I think. And I also agree to
> >>>> add a new physdev_op to handle this case, and it should be better
> >>>> way to go. Based on this idea, I worked out the patch, attached!
> >>>> In this patch, we introduced a new physdev_op PHYSDEVOP_setup_gsi
> >>>> for each GSI setup, and each domain can require to map each GSI in
> >>>> this case. In addition, I believe it is very safe to port the
> >>>> hypervisor patch to xen-3.4-x tree and keeps pv_ops dom0 running
> >>>> on it, since no logic is changed. BTW, I also tested apic and
> >>>> non-apic cases, they works fine after applying the patches.
> >>>
> >>> But I don't think you tested PCI front and PCI back.
> >>>
> >>> Mainly these lines worry me (can you inline the patch next time
> >>> too, please):
> >>>
> >>> + map_irq.domid = DOMID_SELF;
> >>> + map_irq.type = MAP_PIRQ_TYPE_GSI;
> >>> + map_irq.index = gsi;
> >>> + map_irq.pirq = irq;
> >>> + rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq,
> >>> &map_irq);
> >>>
> >>> For PCI passthrough to work, the domid needs to be for the guest
> >>> domain, while in this case it is set to Dom0.
> >>> There is already a method of extracting the domain id for PCI
> >>> devices passed to the guest. Look in the 'xen_create_msi_irq'
> >>> function.
> >>
> >> Could you detail the concern ? This hypercall is only related to
> >> GSI, not MSI, why it has side-effect about pci passthrough ?
> >
> > This is for PV guests _without_ using QEMU. They are using the PCI
> > backend to "enable" a device (drivers/xen/pciback and
> > drivers/pci/xen-pcifront.c).
> > The front and back-end communicate the IRQ number (GSI) to the guest
> > when enabling a INTx PCI device (not MSI ones).
> >
> > Then the PV guest can bind the IRQ (GSI) number to its own event
> > channel and
> > have fully working PCI device.
> >
> > With your change, the privileged domain pins the device to itself,
> > not to
> > other domains.
>
> But I think dom0 should own the device first during boot, and then assign it to PV guest when this device is required by pcifront? Basically, we don't know which devices should be reserved for non-previleged domains, right ? So I think the GSI should be initialized and bind to dom0 when dom0 boots? Once the devices is assigned to PV guests, it maybe need to do the unmapping operation about the GSI from dom0 and do mapping for the domU.
During boot the device can be owned by pciback or by the modele for which a
PCI entry exist. Look for pciback.hide entry.
There are two modes of execution:
1). First being what you described wherein the device initially belogs to Dom0.
The user unbinds it from the PCI device and binds it to the pciback module.
At that point, the device is disabled and ready for PV guests. When a PV guest
starts pciback module makes the pci_enable_device call and sets the IRQ, etc
for the device (for MSI, it obviously gets the IDT value from the hypervisor
call).
2). Dom0 boots where the user specified on the command line pciback.hide=(0000:01:03.1).
The pciback owns the device (is binded to it) and the native module that would
load for this PCI device is not called.
It is correct that the unmapping/mapping and the ownership needs to be dynamic. As user
could bind to the pciback module, give it to guest, kill the guest, then map the PCI device
back to dom0, and after that repeat the whole thing.
>
> BTW, I just met a strange issue with the function xen_create_msi_irq you mentioned, and it blocks initialization of SR-IOV devices' VFs , and I think it should be a bug.
Hmm.. I am not sure if this is the appropiate place for it. You see
this driver is designed for the machines that don't have SR-IOV, VFs,
or VT-d to be able to passthrough a PCI device to the PV guest. You can
use this to run PV guests on Pentium 4 style machine.
I think that the SR-IOV devices would go through a different call stack
to enable the device? Either way, I recently got my hands on a SR-IOV machine
and will see how this works.
Has the 2.6.31.5 been working before with SR-IOV cards or is this
your first experiment with this.
>
> In the function xen_create_msi_irq, there is one line as following to get the domid of the specified device, but a strange domid(0xfff0) is returned by this call, could you help to check whether this strange domid is from?
> domid = rc = xenbus_walk( "/local/domain/0", get_domid_for_dev, dev);
That is due to casting (domid is short int, rc is int).
You need to check if rc is negative, and if so set the domid to DOMID_SELF.
The next line below does this:
if (domid <= 0)
domid = DOMID_SELF;
Ohh wait, looks like the fix for this never got pushed upstream. That
should have been 'if (rc <= 0)'. Yikes.
rc is -16 (EBUSY). That implies that xenstored has not
been initialized on Dom0.
> ^^^^^^^
> Xiantao
>
next prev parent reply other threads:[~2009-11-25 18:00 UTC|newest]
Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-19 1:19 Announcing xen/master: pvops git trees rearranged Jeremy Fitzhardinge
2009-09-19 10:36 ` Marc - A. Dahlhaus
2009-09-20 19:29 ` Marc - A. Dahlhaus
2009-09-21 6:22 ` Pasi Kärkkäinen
2009-09-21 8:49 ` Marc - A. Dahlhaus [ Administration | Westermann GmbH ]
2009-09-21 9:03 ` Pasi Kärkkäinen
2009-09-21 9:18 ` Marc - A. Dahlhaus [ Administration | Westermann GmbH ]
2009-09-21 14:39 ` Konrad Rzeszutek Wilk
2009-09-21 16:19 ` [Cluster-devel] Re: [Xen-devel] " Marc
2009-09-21 15:20 ` Pasi Kärkkäinen
2009-09-19 14:46 ` pvops: AHCI problems with SB600 Patrick Scharrenberg
2009-09-21 5:57 ` Patrick Scharrenberg
2009-09-21 15:06 ` Konrad Rzeszutek Wilk
2009-09-22 9:00 ` Patrick Scharrenberg
2009-09-22 14:08 ` Konrad Rzeszutek Wilk
2009-09-23 7:37 ` Patrick Scharrenberg
2009-09-23 12:09 ` Konrad Rzeszutek Wilk
2009-09-23 12:06 ` Konrad Rzeszutek Wilk
2009-09-23 19:22 ` Jeremy Fitzhardinge
2009-09-23 19:32 ` Konrad Rzeszutek Wilk
2009-09-23 20:09 ` Jeremy Fitzhardinge
2009-09-23 20:30 ` Jeremy Fitzhardinge
2009-09-23 21:24 ` Konrad Rzeszutek Wilk
2009-09-23 21:56 ` Jeremy Fitzhardinge
2009-09-24 12:44 ` Konrad Rzeszutek Wilk
2009-09-24 18:23 ` Jeremy Fitzhardinge
2009-09-24 21:36 ` Konrad Rzeszutek Wilk
2009-09-24 19:12 ` Patrick Scharrenberg
2009-09-21 14:43 ` Announcing xen/master: pvops git trees rearranged (AMD tests?) Konrad Rzeszutek Wilk
2009-09-21 19:25 ` Announcing xen/master: pvops git trees rearranged Pasi Kärkkäinen
2009-09-21 19:30 ` Jeremy Fitzhardinge
2009-09-21 19:50 ` Pasi Kärkkäinen
2009-09-21 20:21 ` Jeremy Fitzhardinge
2009-09-21 20:26 ` Pasi Kärkkäinen
2009-09-21 20:29 ` Jeremy Fitzhardinge
2009-09-21 20:36 ` Pasi Kärkkäinen
2009-09-23 13:16 ` Christian Tramnitz
2009-09-23 20:13 ` Jeremy Fitzhardinge
2009-09-24 3:17 ` Qing He
2009-09-24 19:38 ` Jeremy Fitzhardinge
2009-09-24 8:15 ` Zhang, Xiantao
2009-09-25 1:44 ` Zhang, Xiantao
[not found] ` <706158FABBBA044BAD4FE898A02E4BC201C9AC7ED0@pdsmsx503.ccr.corp.intel.com>
[not found] ` <4AC54350.7040909@goop.org>
[not found] ` <706158FABBBA044BAD4FE898A02E4BC201C9AC8A88@pdsmsx503.ccr.corp.intel.com>
[not found] ` <4AD75A0B.9020508@goop.org>
[not found] ` <706158FABBBA044BAD4FE898A02E4BC201C9BD87FA@pdsmsx503.ccr.corp.intel.com>
2009-11-12 0:47 ` APIC rework Jeremy Fitzhardinge
2009-11-12 1:00 ` Jeremy Fitzhardinge
2009-11-12 23:51 ` Jeremy Fitzhardinge
2009-11-13 5:27 ` Zhang, Xiantao
2009-11-13 7:24 ` Keir Fraser
2009-11-13 23:57 ` Jeremy Fitzhardinge
2009-11-14 8:04 ` Keir Fraser
2009-11-16 10:38 ` Zhang, Xiantao
2009-11-16 18:37 ` Jeremy Fitzhardinge
2009-11-17 3:13 ` Zhang, Xiantao
2009-11-17 3:45 ` Keir Fraser
2009-11-17 5:20 ` Jeremy Fitzhardinge
2009-11-17 5:44 ` Keir Fraser
2009-11-17 12:46 ` Zhang, Xiantao
2009-11-17 13:05 ` Keir Fraser
2009-11-17 14:17 ` Zhang, Xiantao
2009-11-17 18:51 ` Jeremy Fitzhardinge
2009-11-18 3:37 ` Zhang, Xiantao
2009-11-18 14:29 ` Konrad Rzeszutek Wilk
2009-11-20 1:47 ` Zhang, Xiantao
2009-11-17 19:49 ` Keir Fraser
2009-11-18 3:12 ` Jiang, Yunhong
2009-11-18 3:25 ` Zhang, Xiantao
2009-11-18 9:37 ` Keir Fraser
2009-11-24 10:04 ` Zhang, Xiantao
2009-11-24 19:25 ` Jeremy Fitzhardinge
2009-11-25 1:42 ` Zhang, Xiantao
2009-11-24 19:44 ` Konrad Rzeszutek Wilk
2009-11-24 23:35 ` Jeremy Fitzhardinge
2009-11-25 14:10 ` Konrad Rzeszutek Wilk
2009-11-25 19:14 ` Jeremy Fitzhardinge
2009-11-30 14:26 ` Konrad Rzeszutek Wilk
2009-11-25 2:43 ` Zhang, Xiantao
2009-11-25 13:41 ` Konrad Rzeszutek Wilk
2009-11-25 15:21 ` Zhang, Xiantao
2009-11-25 18:00 ` Konrad Rzeszutek Wilk [this message]
2009-11-26 11:53 ` Zhang, Xiantao
2009-11-30 14:34 ` Konrad Rzeszutek Wilk
2009-12-03 2:13 ` Zhang, Xiantao
2009-12-03 14:38 ` Konrad Rzeszutek Wilk
2009-11-25 18:59 ` Jeremy Fitzhardinge
2009-11-26 1:11 ` Zhang, Xiantao
2009-11-18 14:15 ` Konrad Rzeszutek Wilk
2009-11-20 1:45 ` Zhang, Xiantao
2009-11-17 5:12 ` Jeremy Fitzhardinge
2009-09-24 13:20 ` Announcing xen/master: pvops git trees rearranged Christian Tramnitz
2009-09-24 17:47 ` Andy Burns
2009-09-24 18:29 ` Thiago Camargo Martins Cordeiro
2009-09-24 19:32 ` Thiago Camargo Martins Cordeiro
2009-09-24 20:00 ` Jeremy Fitzhardinge
2009-09-24 19:56 ` Jeremy Fitzhardinge
2009-10-11 15:39 ` Pasi Kärkkäinen
2009-10-12 20:02 ` Konrad Rzeszutek Wilk
2009-10-14 21:14 ` Pasi Kärkkäinen
2009-10-15 20:04 ` Konrad Rzeszutek Wilk
2009-10-16 9:01 ` Pasi Kärkkäinen
2009-10-20 16:58 ` [drm:r100_ring_test] *ERROR* radeon: ring test failed Konrad Rzeszutek Wilk
2009-10-21 11:54 ` Pasi Kärkkäinen
2009-10-21 18:31 ` Konrad Rzeszutek Wilk
2009-10-21 18:52 ` Pasi Kärkkäinen
2009-10-21 19:50 ` Jeremy Fitzhardinge
2009-10-21 20:22 ` Pasi Kärkkäinen
2009-10-27 15:46 ` Pasi Kärkkäinen
2009-10-27 17:00 ` Konrad Rzeszutek Wilk
2009-10-27 17:30 ` Pasi Kärkkäinen
2009-10-27 19:45 ` Pasi Kärkkäinen
2009-10-27 19:41 ` Konrad Rzeszutek Wilk
2009-10-27 20:18 ` Pasi Kärkkäinen
2009-10-27 20:13 ` Konrad Rzeszutek Wilk
2009-10-27 20:36 ` Pasi Kärkkäinen
2010-01-01 17:21 ` Pasi Kärkkäinen
2010-01-04 13:37 ` Konrad Rzeszutek Wilk
2010-01-04 19:42 ` Pasi Kärkkäinen
2010-01-14 20:05 ` Konrad Rzeszutek Wilk
2010-01-15 7:18 ` Pasi Kärkkäinen
2009-10-27 20:23 ` Pasi Kärkkäinen
2009-12-04 16:07 ` Announcing xen/master: pvops git trees rearranged Stefan Kuhne
2009-12-04 18:58 ` Pasi Kärkkäinen
2009-12-04 19:27 ` Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091125180031.GA5531@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=jeremy@goop.org \
--cc=keir.fraser@eu.citrix.com \
--cc=weidong.han@intel.com \
--cc=xen-devel@lists.xensource.com \
--cc=xiantao.zhang@intel.com \
--cc=yunhong.jiang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.