From: "Jan Beulich" Subject: Re: xen-unstable: commit commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c leaves HVM guest dangling after shutdown or destroy. Date: Tue, 30 Apr 2013 15:18:28 +0100 Message-ID: <517FEED402000078000D2244@nat28.tlf.novell.com> References: <881882180.20130420152124@eikelenboom.it> <82be0365-68f4-4d75-88f5-44a59c796a75@email.android.com> <5176AA2D.4020307@citrix.com> <20130430135553.GA19986@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part300013A4.3__=" Return-path: In-Reply-To: <20130430135553.GA19986@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , Konrad Rzeszutek Wilk Cc: Sander Eikelenboom , "xen-devel@lists.xen.org" , roger.pau@citrix.com 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. --=__Part300013A4.3__= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline >>> On 30.04.13 at 15:55, Konrad Rzeszutek Wilk wrote: > On Wed, Apr 24, 2013 at 10:31:20AM +0100, George Dunlap wrote: >> On Tue, Apr 23, 2013 at 4:35 PM, Roger Pau Monné wrote: >> > On 20/04/13 20:56, Konrad Rzeszutek Wilk wrote: >> >> >> >> >> >> Sander Eikelenboom wrote: >> >> >> >>> Hi, >> >>> >> >>> Commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c x86: allow >> >>> VCPUOP_register_vcpu_info to work again on PVHVM guests >> >>> >> >>> Leaves HVM guests dangling after shutdown or destroy: >> >>> >> >>> xl list gives: >> >>> (null) 16 0 4 --p--d >> >>> 11.5 >> >>> (null) 17 0 1 --ps-d >> >>> 12.0 >> >>> >> >>> (first was destroyed, second shutdown) >> >>> >> >>> The actual xl and qemu processes are gone, so guest only seem to be >> >>> still registered in the hypervisor. >> >>> >> >>> Another thing this seems to trigger (and that perhaps needs fixing) is >> >>> that a "xl shutdown --all --wait" doesn't wait anymore. >> >>> It returns immediately, probably due to the "nullified" name ? >> >> >> >> Is this only happening with Linux guests? >> > >> > AFAIK this seems to happen with guests that use >> > VCPUOP_register_vcpu_info (I'm seeing the same on FreeBSD). >> >> Are we leaving a reference to a page dangling around somewhere? > > That is my thinking. George, if you would not mind - could you add > this to the list of bugs for Xen 4.3 I am responsible for. Perhaps you can take this off the list again right away: A brief look at the code shows that unmap_vcpu_info() is being called only for PV guests. Patch below/attached (compile tested only). Jan x86: call unmap_vcpu_info() regardless of guest type This fixes a regression from 63753b3e ("x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests"). Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -2013,7 +2013,11 @@ int domain_relinquish_resources(struct d /* Drop the in-use references to page-table bases. */ for_each_vcpu ( d, v ) + { vcpu_destroy_pagetables(v); + + unmap_vcpu_info(v); + } if ( !is_hvm_domain(d) ) { @@ -2025,8 +2029,6 @@ int domain_relinquish_resources(struct d * mappings. */ destroy_gdt(v); - - unmap_vcpu_info(v); } if ( d->arch.pv_domain.pirq_eoi_map != NULL ) --=__Part300013A4.3__= Content-Type: text/plain; name="x86-unmap-vcpu-info-pvhvm.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-unmap-vcpu-info-pvhvm.patch" x86: call unmap_vcpu_info() regardless of guest type=0A=0AThis fixes a = regression from 63753b3e ("x86: allow=0AVCPUOP_register_vcpu_info to work = again on PVHVM guests").=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/domain.c=0A+++ b/xen/arch/x86/domain.c=0A@@ = -2013,7 +2013,11 @@ int domain_relinquish_resources(struct d=0A =0A = /* Drop the in-use references to page-table bases. */=0A = for_each_vcpu ( d, v )=0A+ {=0A vcpu_destroy_pagetables(= v);=0A+=0A+ unmap_vcpu_info(v);=0A+ }=0A =0A if = ( !is_hvm_domain(d) )=0A {=0A@@ -2025,8 +2029,6 @@ int domain_relin= quish_resources(struct d=0A * mappings.=0A = */=0A destroy_gdt(v);=0A-=0A- unmap_vcpu_i= nfo(v);=0A }=0A =0A if ( d->arch.pv_domain.pirq_eoi= _map !=3D NULL )=0A --=__Part300013A4.3__= 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 --=__Part300013A4.3__=--