From: "Jan Beulich" Subject: [PATCH] x86/mm: fix mod_l1_entry() return value when encountering r/o MMIO page Date: Wed, 20 Jun 2012 16:18:41 +0100 Message-ID: <4FE205F1020000780008ADFB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEEC04DC1.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel 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. --=__PartEEC04DC1.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline While putting together the workaround announced in http://lists.xen.org/archives/html/xen-devel/2012-06/msg00709.html, I found that mod_l1_entry(), upon encountering a set bit in mmio_ro_ranges, would return 1 instead of 0 (the removal of the write permission is supposed to be entirely transparent to the caller, even more so to the calling guest). Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1875,6 +1875,7 @@ static int mod_l1_entry(l1_pgentry_t *pl break; case 1: l1e_remove_flags(nl1e, _PAGE_RW); + rc =3D 0; break; } if ( page ) --=__PartEEC04DC1.0__= Content-Type: text/plain; name="x86-mm-mod-l1-entry-mmio-ro.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-mm-mod-l1-entry-mmio-ro.patch" x86/mm: fix mod_l1_entry() return value when encountering r/o MMIO = page=0A=0AWhile putting together the workaround announced in=0Ahttp://lists= .xen.org/archives/html/xen-devel/2012-06/msg00709.html, I=0Afound that = mod_l1_entry(), upon encountering a set bit in=0Ammio_ro_ranges, would = return 1 instead of 0 (the removal of the write=0Apermission is supposed = to be entirely transparent to the caller, even=0Amore so to the calling = guest).=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/mm.c=0A+++ b/xen/arch/x86/mm.c=0A@@ -1875,6 +1875,7 @@ = static int mod_l1_entry(l1_pgentry_t *pl=0A break;=0A = case 1:=0A l1e_remove_flags(nl1e, _PAGE_RW);=0A+ rc = =3D 0;=0A break;=0A }=0A if ( page )=0A --=__PartEEC04DC1.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartEEC04DC1.0__=--