From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86/HAP: avoid using bogus/misleading locking Date: Mon, 29 May 2017 06:37:37 -0600 Message-ID: <592C3231020000780015D449@prv-mh.provo.novell.com> References: <592C3231020000780015D449@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0A327201.3__=" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFJvb-0001M9-TK for xen-devel@lists.xenproject.org; Mon, 29 May 2017 12:37:44 +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 , Tim Deegan 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. --=__Part0A327201.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hap_teardown() unconditionally releases the paging lock and is always being called without the lock held: Lock acquire should then be unconditional too. Signed-off-by: Jan Beulich --- While this is only a cosmetic change afaict I would still like to explore whether to include this in 4.9. --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -576,8 +576,7 @@ void hap_teardown(struct domain *d, bool ASSERT(d->is_dying); ASSERT(d !=3D current->domain); =20 - if ( !paging_locked_by_me(d) ) - paging_lock(d); /* Keep various asserts happy */ + paging_lock(d); /* Keep various asserts happy */ =20 if ( paging_mode_enabled(d) ) { --=__Part0A327201.3__= Content-Type: text/plain; name="x86-HAP-teardown-locking.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-HAP-teardown-locking.patch" x86/HAP: avoid using bogus/misleading locking=0A=0Ahap_teardown() = unconditionally releases the paging lock and is always=0Abeing called = without the lock held: Lock acquire should then be=0Aunconditional = too.=0A=0ASigned-off-by: Jan Beulich =0A---=0AWhile = this is only a cosmetic change afaict I would still like to=0Aexplore = whether to include this in 4.9.=0A=0A--- a/xen/arch/x86/mm/hap/hap.c=0A+++ = b/xen/arch/x86/mm/hap/hap.c=0A@@ -576,8 +576,7 @@ void hap_teardown(struct = domain *d, bool=0A ASSERT(d->is_dying);=0A ASSERT(d !=3D current->d= omain);=0A =0A- if ( !paging_locked_by_me(d) )=0A- paging_lock(d)= ; /* Keep various asserts happy */=0A+ paging_lock(d); /* Keep various = asserts happy */=0A =0A if ( paging_mode_enabled(d) )=0A {=0A --=__Part0A327201.3__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part0A327201.3__=--