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] [PATCH 0/3] xen: msi support for Xen dom0

To: Qing He <qing.he@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 0/3] xen: msi support for Xen dom0
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 02 Sep 2009 15:55:19 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Delivery-date: Wed, 02 Sep 2009 15:56:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090901015420.GA18167@ub-qhe2>
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: <1250574314-19600-1-git-send-email-qing.he@xxxxxxxxx> <4A8B0DFA.1020002@xxxxxxxx> <20090819014552.GA21318@ub-qhe2> <4A8C50E4.8070006@xxxxxxxx> <20090901015420.GA18167@ub-qhe2>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3
On 08/31/09 18:54, Qing He wrote:
> I finished reading the new-interrupt-routing branch and had some revisit
> on MSI. Basically, I think this branch is OK, exposing Xen vectors to
> guest is quite weird (also includes `index' field of map_pirq call),
> this `vector' is now even renamed to `irq' because of per-cpu vector.
>   

OK, good.

> And my MSI patches don't conflict significantly with the
> new-interrupt-routing branch. We can consider the setting up of MSI as
> two aspects: one is programming the interrupt source (by writing to
> config space and MSIX mmio), the other is software: creating new irqs,
> and starting them.  The method I use now is to add a branching
> in arch_setup_msi_irqs, to (1) set the irq_chip of these new irqs to
> pirq; (2) avoid programming the config space. This can be changed to
> funciton pointers with no additional pain.
>   

Yep.

>>> So trapping and emulating for msi will first need a decoupling of that,
>>> allowing dom0 to use only vector to index its msi. This requires changing
>>> of the current pirq based xen irq, which seems quite annoying at Xen side,
>>> especially if per-cpu vector is in.
>>>   
>>>       
>> What about making pirq == vector, so the "vector" seen by the kernel
>> isn't a real vector at all, and Xen remaps from the pirq/vector to the
>> real vector when emulating the write?
>>     
> But the vector is allocated by the kernel, right? How can Xen know which
> vector (and its CPU affinity) is related to a pirq?
>   

In the current dom0 scheme, the kernel does a hypercall to ask Xen to
allocate the vector for a given pirq.

> For suspend/resume of MSI devices support, what the kernel does on bare
> metal is simply to reprogram the interrupt source, including writing vectors
> and set enable bit. On Xen, the reprogramming is done in the hypervisor,
> so we just need to bypass kernel the kernel reprogramming: If using T&E,
> just ignore address/data writing and if not, an arch specific hook is
> needed.
>   

That's fairly straightforward, since the PCI config space is mapped
anyway.  We just need to have some way to create mappings that will trap
(ie, we can't use the ptes the kernel establishes as-is, as they won't
cause a pagefault).

> And what do you mean by I/O APIC T&E? Since dom0 is eventually notified
> by evtchn, a relation between vector and evtchn has to be established,
> which doesn't exist yet. I ever think of mapping evtchns for (vcpu,
> vector) pairs at vector allocation time, so that everything else can be
> keep untouched. But that seems to involve to much change.
>   

At the moment we need to paravirtualize IO APIC register writes via
hypercall, specifically so that Xen can completely establish the
apic+pin -> vector -> pirq -> evtchn mapping.  It needs to be a
hypercall because the IO APIC doesn't have an explicit mapping within
the dom0 address space.  If we created such a mapping and trapped reads
and writes to it, it would be logically equivalent to the hypercall, but
wouldn't require kernel changes.

However, this is moot in the new-interrupt-routing branch as we take
over the whole interrupt path, so there's no problem making hypercalls
(either to update the IO APIC via register writes, or the new hypercall
to establish a gsi -> pirq mapping).

    J

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

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] [PATCH 0/3] xen: msi support for Xen dom0, Jeremy Fitzhardinge <=