From: "Jan Beulich" Subject: [PATCH] x86/mm: silence a pointless warning Date: Tue, 02 May 2017 09:15:56 -0600 Message-ID: <5908BECC0200007800155EE5@prv-mh.provo.novell.com> References: <5908BECC0200007800155EE5@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part271F7BBC.3__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5ZX4-0001eG-Vl for xen-devel@lists.xenproject.org; Tue, 02 May 2017 15:16:07 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: George Dunlap , Andrew Cooper , Julien Grall List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part271F7BBC.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline get_page() logs a message when it fails (dom_cow is never dying or paging_mode_external()), so better avoid the call when it's pointless to do anyway. Signed-off-by: Jan Beulich --- Possibly we could be even more rigid and bail right away if ->is_dying is set. --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -501,9 +501,9 @@ struct page_info *get_page_from_gfn_p2m( if ( fdom =3D=3D NULL ) page =3D NULL; } - else if ( !get_page(page, d) + else if ( !get_page(page, d) && /* Page could be shared */ - && !get_page(page, dom_cow) ) + (!p2m_is_shared(*t) || !get_page(page, dom_cow)) ) page =3D NULL; } p2m_read_unlock(p2m); --=__Part271F7BBC.3__= Content-Type: text/plain; name="x86-mm-silence-warning.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-mm-silence-warning.patch" x86/mm: silence a pointless warning=0A=0Aget_page() logs a message when it = fails (dom_cow is never dying or=0Apaging_mode_external()), so better = avoid the call when it's pointless=0Ato do anyway.=0A=0ASigned-off-by: Jan = Beulich =0A---=0APossibly we could be even more rigid = and bail right away if ->is_dying=0Ais set.=0A=0A--- a/xen/arch/x86/mm/p2m.= c=0A+++ b/xen/arch/x86/mm/p2m.c=0A@@ -501,9 +501,9 @@ struct page_info = *get_page_from_gfn_p2m(=0A if ( fdom =3D=3D NULL )=0A = page =3D NULL;=0A }=0A- else if ( = !get_page(page, d)=0A+ else if ( !get_page(page, d) &&=0A = /* Page could be shared */=0A- && = !get_page(page, dom_cow) )=0A+ (!p2m_is_shared(*t) || = !get_page(page, dom_cow)) )=0A page =3D NULL;=0A = }=0A p2m_read_unlock(p2m);=0A --=__Part271F7BBC.3__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part271F7BBC.3__=--