From: Haitao Shan <maillists.shan@gmail.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"Kay, Allen M" <allen.m.kay@intel.com>
Subject: Re: use of struct hvm_mirq_dpci_mapping.gmsi vs. HVM_IRQ_DPCI_*_MSI flags
Date: Thu, 21 Apr 2011 15:14:40 +0800 [thread overview]
Message-ID: <BANLkTinVcOUqDst2nOj8xfzNFbHnEtwCJg@mail.gmail.com> (raw)
In-Reply-To: <4D94A88C0200007800039637@vpn.id2.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 2798 bytes --]
See comments below.
2011/3/31 Jan Beulich <JBeulich@novell.com>
> pt_irq_create_bind_vtd() initializes this substructure only when setting
> .flags to HVM_IRQ_DPCI_MACH_MSI|HVM_IRQ_DPCI_GUEST_MSI (the
> PT_IRQ_TYPE_MSI case), while the other path will not set
> HVM_IRQ_DPCI_GUEST_MSI but may also set HVM_IRQ_DPCI_MACH_MSI.
> Yet hvm_dpci_msi_eoi() and hvm_migrate_pirqs() check for
> HVM_IRQ_DPCI_MACH_MSI, i.e. may run into an uninitialized
> .gmsi.* field. What am I missing here?
>
I think these fields are introduced by MSI-to-gINTx patch. MACH_MSI means
the host (physical) is using MSI, while GUEST_MSI is just what we can guess
from its name.
I agree only checking MACH_MSI is not enough.
>
> I'm largely asking because I think struct hvm_mirq_dpci_mapping.dom
> and .digl_list could actually overlay .gmsi, as much as struct
> hvm_irq_dpci.hvm_timer could actually rather be folded into struct
> hvm_mirq_dpci_mapping (and then also overlay .gmsi). The overlay
> distinction bit would, based on initialization, be HVM_IRQ_DPCI_GUEST_MSI,
> but according to use it wouldn't be clear which of the two
> HVM_IRQ_DPCI_*_MSI bits is actually the correct one.
>
> Having a single structure only would make it a lot easier to
> convert struct hvm_mirq_dpci_mapping * in struct hvm_irq_dpci to
> a sparse struct hvm_mirq_dpci_mapping ** (populating slots only
> as they get used), thus shrinking the currently two d->nr_pirqs
> sized array allocations in pt_irq_create_bind_vtd() to a single one
> with only pointer size array elements (allowing up to about 512
> domain pirqs rather than currently slightly above 80 without
> exceeding PAGE_SIZE on allocation).
>
I also agree. But I think better Allen could do the final judgement.
Thanks!
>
> Also I'm wondering why the PT_IRQ_TYPE_MSI path of
> pt_irq_create_bind_vtd() checks that on re-use of an IRQ the
> flags are indicating the same kind of interrupt, while the other
> path doesn't bother doing so.
>
The purpuse is described in the check in notes:
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1239806337 -3600
# Node ID 3e64dfebabd7340f5852ad112c858efcebc9cae5
# Parent b2c43b0fba713912d8ced348b5d628743e52d8be
passthrough: allow pt_bind_irq for msi update
Extend pt_bind_irq to handle the update of msi guest
vector and flag.
Unbind and rebind using separate hypercalls may not be viable
sometime.
For example, the guest may update MSI address/data on fly without
disabling it first (e.g. change delivery/destination), implement these
updates in such a way may result in interrupt loss.
Signed-off-by: Qing He <qing.he@intel.com>
>
> Thanks, Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
[-- Attachment #1.2: Type: text/html, Size: 4155 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-04-21 7:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 14:15 use of struct hvm_mirq_dpci_mapping.gmsi vs. HVM_IRQ_DPCI_*_MSI flags Jan Beulich
2011-04-21 7:14 ` Haitao Shan [this message]
2011-04-26 8:48 ` Jan Beulich
2011-04-27 2:49 ` Kay, Allen M
2011-04-27 6:43 ` Jan Beulich
2011-04-28 1:31 ` Haitao Shan
2011-04-28 20:27 ` Kay, Allen M
2011-04-29 7:05 ` Jan Beulich
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=BANLkTinVcOUqDst2nOj8xfzNFbHnEtwCJg@mail.gmail.com \
--to=maillists.shan@gmail.com \
--cc=JBeulich@novell.com \
--cc=allen.m.kay@intel.com \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).