From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH] Extra check in grant table code for mapping of shared frame Date: Mon, 17 Sep 2012 17:29:37 +0100 Message-ID: <20120917162937.GA72055@ocelot.phlegethon.org> References: <7A2C5C61-AFEF-4258-9EEB-CC4A0727920E@gridcentric.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser Cc: Andres Lagar-Cavilla , Andres Lagar-Cavilla , JBeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 12:17 +0100 on 17 Sep (1347884247), Keir Fraser wrote: > Probably needs Tim to comment on it. Assuming he's any wiser about this c= ode > than the rest of us. ;) Looks OK to my limited understanding. :) Tim. > On 17/09/2012 12:00, "Andres Lagar-Cavilla" wro= te: > = > > ping=8A > > Thanks, > > Andres > > On Sep 13, 2012, at 11:27 AM, Andres Lagar-Cavilla wrote: > > = > >> xen/common/grant_table.c | 9 ++++++--- > >> 1 files changed, 6 insertions(+), 3 deletions(-) > >> = > >> = > >> Signed-off-by: Andres Lagar-Cavilla > >> = > >> diff -r 5ce5b53ea68f -r 40b91bed1275 xen/common/grant_table.c > >> --- a/xen/common/grant_table.c > >> +++ b/xen/common/grant_table.c > >> @@ -649,9 +649,12 @@ __gnttab_map_grant_ref( > >> } > >> else if ( owner =3D=3D rd || owner =3D=3D dom_cow ) > >> { > >> - if ( gnttab_host_mapping_get_page_type(op, ld, rd) && > >> - !get_page_type(pg, PGT_writable_page) ) > >> - goto could_not_pin; > >> + if ( gnttab_host_mapping_get_page_type(op, ld, rd) ) > >> + { > >> + if ( (owner =3D=3D dom_cow) || > >> + !get_page_type(pg, PGT_writable_page) ) > >> + goto could_not_pin; > >> + } > >> = > >> nr_gets++; > >> if ( op->flags & GNTMAP_host_map ) > > = > = > =