All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: "Xu, Quan" <quan.xu@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"dario.faggioli@citrix.com" <dario.faggioli@citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH v2 03/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping
Date: Wed, 20 Apr 2016 05:44:07 +0000	[thread overview]
Message-ID: <AADFC41AFE54684AB9EE6CBC0274A5D15F82385C@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <945CA011AD5F084CBEA3E851C0AB28894B88E02A@SHSMSX101.ccr.corp.intel.com>

> From: Xu, Quan
> Sent: Wednesday, April 20, 2016 1:27 PM
> 
> On  April 19, 2016 2:44pm, Tian, Kevin <kevin.tian@intel.com> wrote:
> > > From: Xu, Quan
> > > Sent: Monday, April 18, 2016 10:00 PM
> > >
> > > If IOMMU mapping and unmapping failed, the domain (with the exception
> > > of the hardware domain) is crashed, treated as a fatal error. Rollback
> > > can be lighter weight.
> >
> > What do you mean by 'lighter weight"? Please clarify it.
> >
> > >
> > > For the hardware domain, we do things on a best effort basis. When
> > > rollback is not feasible (in early initialization phase or trade-off
> > > of complexity), at least, unmap upon maps error or then throw out error
> > message.
> >
> > remove 'or'. Based on next sentence, is above specific for IOMMU mapping?
> >
> > >
> > > IOMMU unmapping should perhaps continue despite an error, in an
> > > attempt to do best effort cleanup.
> > >
> 
> 
> 
> Could I enhance the commit log as below:
> """
> If IOMMU mapping and unmapping failed, the domain (with the exception of the hardware
> domain) is crashed,
> treated as a fatal error. Rollback can be lighter weight (at least errors need to be
> propagated).

Still not clear about 'lighter weight'. Then what is the 'heavier weight' side then?
Isn't "at least errors need to be propagated" exactly what 'rollback' means?

> 
> IOMMU mapping breaks for an error, unmapping upon maps, throwing out error message
> and then reporting
> the error up the call trees. When rollback is not feasible (in early initialization phase or
> trade-off of complexity)
> for the hardware domain, we do things on a best effort basis, only throwing out error
> message.

If above elaborates what earlier 'lighter weight" means, then please just
say a best-effort rollack.

> 
> IOMMU unmapping should perhaps continue despite an error, in an attempt to do best
> effort cleanup.
> """
> 
> 
> I am still not sure whether we really need throw out error message for each IOMMU
> mapping or not.
> If yes, I will throw out error message for each IOMMU mapping in next v3.

I'm not sure about your question here. Have to judge based on specific case.

> > >          {
> > >              if ( iommu_flags )
> > >                  for ( i = 0; i < (1 << order); i++ )
> > > -                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i,
> > iommu_flags);
> > > +                {
> > > +                    ret = iommu_map_page(d, gfn + i, mfn_x(mfn) + i,
> > > + iommu_flags);
> > > +
> > > +                    if ( unlikely(ret) )
> > > +                    {
> > > +                        while (i)
> > > +                            iommu_unmap_page(d, gfn + --i);
> >
> > How about below?
> >
> > while (i-- >= 0)
> > 	iommu_unmap_page(d, gfn + i);
> >
> 
> this modification is based on discussion rooted at
> http://lists.xenproject.org/archives/html/xen-devel/2016-03/msg01779.html
> wait for Jan's decision.

Either way is OK. 'gfn + --I' just looks not very readable to me.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-04-20  5:44 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 14:00 [PATCH v2 00/11] Check VT-d Device-TLB flush error Quan Xu
2016-04-18 14:00 ` [PATCH v2 01/11] vt-d: fix the IOMMU flush issue Quan Xu
2016-04-19  6:33   ` Tian, Kevin
2016-04-19  8:33     ` Xu, Quan
2016-04-25  9:22   ` Jan Beulich
2016-04-26  1:17     ` Xu, Quan
2016-04-26  2:18     ` Xu, Quan
2016-04-26  9:10       ` Jan Beulich
2016-04-26 10:15         ` Xu, Quan
2016-04-26 10:52           ` Jan Beulich
2016-04-26 10:58             ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 02/11] IOMMU: handle IOMMU mapping and unmapping failures Quan Xu
2016-04-19  6:36   ` Tian, Kevin
2016-04-19  6:40     ` Xu, Quan
2016-04-25  9:26   ` Jan Beulich
2016-04-27 14:26     ` Xu, Quan
2016-04-27 15:02       ` Jan Beulich
2016-04-28  1:23         ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 03/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping Quan Xu
2016-04-19  6:44   ` Tian, Kevin
2016-04-20  5:27     ` Xu, Quan
2016-04-20  5:44       ` Tian, Kevin [this message]
2016-04-20  6:11       ` Jan Beulich
2016-04-20  6:26         ` Xu, Quan
2016-04-25  9:50   ` Jan Beulich
2016-04-27  8:49     ` Xu, Quan
2016-04-27  9:36       ` Jan Beulich
2016-04-27 13:10         ` Xu, Quan
2016-04-27 14:06           ` Jan Beulich
2016-04-27 15:48   ` George Dunlap
2016-04-28  1:18     ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 04/11] grant_table: avoid unnecessary work during grant table unmapping Quan Xu
2016-04-19  6:46   ` Tian, Kevin
2016-04-19 13:27     ` Xu, Quan
2016-04-20  5:35       ` Tian, Kevin
2016-04-25  9:55   ` Jan Beulich
2016-04-26  6:48     ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 05/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU unmapping Quan Xu
2016-04-19  6:51   ` Tian, Kevin
2016-04-19  7:01     ` Xu, Quan
2016-04-25 10:06   ` Jan Beulich
2016-04-26  6:49     ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 06/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping Quan Xu
2016-04-19  6:53   ` Tian, Kevin
2016-04-18 14:00 ` [PATCH v2 07/11] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones) Quan Xu
2016-04-25 10:19   ` Jan Beulich
2016-04-26 12:23     ` Xu, Quan
2016-04-26 12:48       ` Jan Beulich
2016-04-27  6:21         ` Xu, Quan
2016-04-27  6:31           ` Jan Beulich
2016-04-27  9:08             ` Xu, Quan
2016-04-27  9:38               ` Jan Beulich
2016-04-18 14:00 ` [PATCH v2 08/11] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones) Quan Xu
2016-04-19  6:58   ` Tian, Kevin
2016-04-19  8:58     ` Xu, Quan
2016-04-25 11:39   ` Jan Beulich
2016-04-26 11:50     ` Xu, Quan
2016-04-26 12:51       ` Jan Beulich
2016-04-26 13:20         ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 09/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending Quan Xu
2016-04-25 11:52   ` Jan Beulich
2016-04-25 13:58     ` Julien Grall
2016-04-25 14:50       ` Xu, Quan
2016-04-26  9:40         ` Julien Grall
2016-04-26 11:28     ` Xu, Quan
2016-04-28 14:14     ` Xu, Quan
2016-04-28 14:36       ` Jan Beulich
2016-04-28 15:03         ` Xu, Quan
2016-04-28 15:12           ` Jan Beulich
2016-04-28 16:08             ` Xu, Quan
2016-04-29  2:20               ` Tian, Kevin
2016-04-29  2:41                 ` Xu, Quan
2016-04-29  7:13                   ` Jan Beulich
2016-04-29  8:23                     ` Xu, Quan
2016-04-18 14:00 ` [PATCH v2 10/11] vt-d: propagate IOMMU Device-TLB flush error up to vt-d hardware initialization Quan Xu
2016-04-18 14:00 ` [PATCH v2 11/11] vt-d: propagate error up to ME phantom function mapping and unmapping Quan Xu
2016-04-25 12:00   ` Jan Beulich
2016-04-26 10:48     ` Xu, Quan

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=AADFC41AFE54684AB9EE6CBC0274A5D15F82385C@SHSMSX101.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=quan.xu@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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.