From: "Jan Beulich" Subject: Re: [PATCH v2 2/3] xen/pvh: check permissions when adding MMIO regions Date: Wed, 21 Jan 2015 11:14:14 +0000 Message-ID: <54BF981602000078000578CC@mail.emea.novell.com> References: <1421773534-15752-1-git-send-email-roger.pau@citrix.com> <1421773534-15752-3-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDtEl-0007Mu-HB for xen-devel@lists.xenproject.org; Wed, 21 Jan 2015 11:14:15 +0000 In-Reply-To: <1421773534-15752-3-git-send-email-roger.pau@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 20.01.15 at 18:05, wrote: > --- a/xen/arch/x86/domain_build.c > +++ b/xen/arch/x86/domain_build.c > @@ -319,12 +319,25 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn, > unsigned long mfn, unsigned long nr_mfns) > { > unsigned long i; > + mfn_t omfn; > + p2m_type_t t; > + p2m_access_t a; > int rc; > > for ( i = 0; i < nr_mfns; i++ ) > { > - if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), > - p2m_get_hostp2m(d)->default_access)) ) > + if ( !iomem_access_permitted(d, mfn + i, mfn + i) ) { Coding style. Jan