xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Tim (Xen.org)" <tim@xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v7 4/6] iommu: don't domain_crash() inside iommu_map/unmap_page()
Date: Thu, 13 Sep 2018 08:27:50 +0000	[thread overview]
Message-ID: <ce1a7f9a5d9642269593f7ec7e23c10f@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20180913082217.xk6zd3v2ir4po3xa@mac.bytemobile.com>

> -----Original Message-----
> From: Roger Pau Monne
> Sent: 13 September 2018 09:22
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Kevin Tian <kevin.tian@intel.com>;
> Stefano Stabellini <sstabellini@kernel.org>; Wei Liu <wei.liu2@citrix.com>;
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>; George Dunlap
> <George.Dunlap@citrix.com>; Andrew Cooper
> <Andrew.Cooper3@citrix.com>; Ian Jackson <Ian.Jackson@citrix.com>; Tim
> (Xen.org) <tim@xen.org>; Julien Grall <julien.grall@arm.com>; Jun Nakajima
> <jun.nakajima@intel.com>
> Subject: Re: [Xen-devel] [PATCH v7 4/6] iommu: don't domain_crash() inside
> iommu_map/unmap_page()
> 
> On Wed, Sep 12, 2018 at 12:30:26PM +0100, Paul Durrant wrote:
> > This patch removes the implicit domain_crash() from iommu_map(),
> > unmap_page() and iommu_iotlb_flush() and turns them into
> straightforward
> > wrappers that check the existence of the relevant iommu_op and call
> > through to it. This makes them usable by PV IOMMU code to be delivered
> in
> > future patches.
> > This patch adds a helper macro, domu_crash(), that will only invoke
> > domain_crash() if the domain is not the hardware domain and modifies
> > callers of iommu_map(), unmap_page() and iommu_iotlb_flush() to use
> this
> > should an operation fail.
> 
> I assume this is because future usages of iommu_map, unmap and flush
> will tolerate failure, and will be handled differently than crashing
> the domain.
> 

Correct. If they form part of the implementation of PV-IOMMU then there's no way we can allow guest supplied arguments to directly cause a domain crash.

> > NOTE: This patch includes one bit of clean-up in set_identity_p2m_entry()
> >       replacing use of p2m->domain with the domain pointer passed into the
> >       function.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> 

Thanks,

  Paul

> > diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> > index 0ba80cb1a8..f2c594d197 100644
> > --- a/xen/include/xen/sched.h
> > +++ b/xen/include/xen/sched.h
> > @@ -616,6 +616,11 @@ void __domain_crash(struct domain *d);
> >      __domain_crash(d);                                                    \
> >  } while (0)
> >
> > +#define domu_crash(d) do {                \
> > +    if ( !is_hardware_domain(d) )         \
> > +        domain_crash(d);                  \
> > +} while (false)
>             ^ missing spaces
> > +
> >  /*
> >   * Called from assembly code, with an optional address to help indicate
> why
> >   * the crash occured.  If addr is 0, look up address from last extable
> > --
> > 2.11.0
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xenproject.org
> > https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-09-13  8:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 11:30 [PATCH v7 0/6] paravirtual IOMMU pre-requisites and clean-up Paul Durrant
2018-09-12 11:30 ` [PATCH v7 1/6] iommu: introduce the concept of DFN Paul Durrant
2018-09-12 11:49   ` Andrew Cooper
2018-09-12 12:01     ` Paul Durrant
2018-09-12 12:14   ` Roger Pau Monné
2018-09-13  9:36     ` Paul Durrant
2018-09-12 11:30 ` [PATCH v7 2/6] iommu: make use of type-safe DFN and MFN in exported functions Paul Durrant
2018-09-13  8:09   ` Roger Pau Monné
2018-09-12 11:30 ` [PATCH v7 3/6] iommu: push use of type-safe DFN and MFN into iommu_ops Paul Durrant
2018-09-13  8:12   ` Roger Pau Monné
2018-09-12 11:30 ` [PATCH v7 4/6] iommu: don't domain_crash() inside iommu_map/unmap_page() Paul Durrant
2018-09-13  6:48   ` Tian, Kevin
2018-09-13  8:22   ` Roger Pau Monné
2018-09-13  8:27     ` Paul Durrant [this message]
2018-09-12 11:30 ` [PATCH v7 5/6] memory: add check_get_page_from_gfn() as a wrapper Paul Durrant
2018-09-13  8:30   ` Roger Pau Monné
2018-09-13  8:35     ` Paul Durrant
2018-09-12 11:30 ` [PATCH v7 6/6] vtd: add lookup_page method to iommu_ops Paul Durrant
2018-09-13  6:53   ` Tian, Kevin
2018-09-13  8:30     ` Paul Durrant
2018-09-13  8:50   ` Roger Pau Monné
2018-09-13  8:59     ` Paul Durrant

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=ce1a7f9a5d9642269593f7ec7e23c10f@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 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).